WO2013029560A1 - 一种获得变换块尺寸的方法和模块 - Google Patents
一种获得变换块尺寸的方法和模块 Download PDFInfo
- Publication number
- WO2013029560A1 WO2013029560A1 PCT/CN2012/080857 CN2012080857W WO2013029560A1 WO 2013029560 A1 WO2013029560 A1 WO 2013029560A1 CN 2012080857 W CN2012080857 W CN 2012080857W WO 2013029560 A1 WO2013029560 A1 WO 2013029560A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- transform block
- block
- width
- height
- size
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/85—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/12—Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
- H04N19/122—Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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/176—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/61—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/96—Tree coding, e.g. quad-tree coding
Definitions
- the present invention relates to the field of communications technologies, and in particular, to a method and a module for obtaining a transform block size. Background technique
- video data may be compressed using a variety of video compression methods, including: intra-frame compression and inter-frame compression.
- the inter-frame compression method based on motion estimation is used.
- the encoding end of the image compresses and encodes the image by using the interframe compression method.
- the encoding end divides the image block to be encoded into several equal-sized sub-blocks.
- the residual transformed and quantized values are entropy encoded.
- the entropy encoded bit stream and the motion vector information are sent to the decoding end, where the motion vector information indicates the position difference between the current sub-image block and the prediction block.
- the entropy encoded bit stream is first obtained, and entropy decoding is performed to obtain a corresponding residual, and corresponding motion vector information; and then the corresponding matching image block is obtained in the reference image according to the motion vector information (ie, the above prediction block) And adding, according to the value of each pixel in the matching image block and the value of the corresponding pixel in the residual value, the value of each pixel in the current sub-image block is obtained.
- Intra prediction refers to predicting an image block by using information in the image to obtain a prediction block, and the encoding end obtains pixels corresponding to the prediction block according to the prediction mode, the prediction direction, and the pixel values around the image block, and the image block pixel and the prediction block.
- the pixel is subtracted to obtain a residual, and the residual is transformed into the code stream after being transformed, quantized and entropy encoded;
- the decoding end parses the code stream, and performs entropy decoding, inverse quantization, and inverse transform on the code stream to obtain a residual block, and the decoding end is obtained according to the decoding end.
- the prediction mode, the prediction direction, and the pixel values around the image block are obtained as prediction blocks, and the residual block pixels are added to the prediction block pixels to obtain a reconstructed image block.
- the coding unit is an image block that is operated when encoding or decoding is performed on the encoding end or the decoding end.
- the prediction unit is an image block having an independent prediction mode in the coding unit.
- a prediction unit may contain multiple prediction blocks, and the prediction block is a coding unit for pre-preprocessing The image block of the operation.
- a transform unit is an image block that performs a transform operation in a coding unit, and may also be referred to as a transform block. Considering that the correlation value of the intra-prediction block is stronger, the block transform has higher energy concentration than the block transform.
- an image block may contain one or more prediction blocks, which are predicted in units of prediction blocks at the codec end; meanwhile, one image block contains one or more transform blocks, and the codec is in units of transform blocks. Make a transformation.
- a super-macroblock In existing video codec standards, such as Moving Picture Experts Group (MPEG), H.264/AVC (Advanced Video Coding), an image block, or macroblock (macroblock) ), a super-macroblock, etc., are divided into a number of sub-image blocks having sizes of 16x16, 16x8, 8x16, 8x8, 8x4, 4x8, 4x4, etc., and the sub-image blocks are subjected to the above-mentioned sizes.
- MPEG Moving Picture Experts Group
- H.264/AVC Advanced Video Coding
- macroblock macroblock
- these sub-image blocks are rectangular blocks of NXM (N and M are integers greater than 0), and N and M have a multiple relationship.
- the common way for an image block to be divided into sub-image blocks is as follows: 2Nx2N division mode, the image block only contains one sub-image block, that is, the image block is not divided into smaller sub-image blocks, as shown in FIG. 1a; 2NxN division mode Dividing the image block into two sub-image blocks of equal size, as shown in FIG. 1b; Nx2N dividing mode, dividing the image block into two sub-image blocks of the same size, as shown in FIG. 1c; NxN Dividing the image block into four equal-sized sub-image blocks, as shown in Figure 1d.
- the above N is any positive integer.
- the image block can also be used in an asymmetric division manner, as shown in Figures 2a to 2d.
- the sub-image block has two variable lengths of 2N and 0.5N
- the lower sub-image block has two variable lengths of 2N and 1.5N
- U in 2NxnU indicates that the image dividing line moves relative to the vertical bisector of the image block
- the upper sub-image block has two variable lengths of 2N and 1.5N
- the lower sub-image block has two variable lengths of 2N and 0.5N
- D in 2NxnD represents the image dividing line relative to the image.
- nLx2N indicates that the image dividing line is shifted leftward with respect to the vertical bisector of the image block
- nLx2N indicates that the image dividing line is shifted left by n relative to the vertical bisector of the image block
- the right sub-image block has two variable lengths of 1.5N and 2N
- nRx2N indicates that the image dividing line is shifted to the right of the vertical bisector of the image block.
- 2Nx2N, 2NxN, Nx2N, 2NxnU, 2NxnD, nLx2N, nRx2N i hooks indicate that the image block Ge 'J points mode corresponds to ⁇ ; pre:; then block type.
- the image block or the transform block is divided into a plurality of sub-image blocks arranged in the vertical direction by the horizontal dividing line or the division manner of the transform block or the prediction block is a horizontal division mode, and the division is performed at this time.
- the direction is a horizontal division direction
- the above 2NxN division manner, 2NxnU division manner, and 2NxnD division manner are collectively referred to as a horizontal division manner
- the image block or the transformation block is divided into a plurality of sub-image blocks or transformation blocks arranged in a horizontal direction by a vertical division line or
- the division mode of the prediction block is the vertical division mode.
- the division direction used is the vertical division direction
- the above Nx2N division manner, nLx2N division manner, and nRx2N division manner are collectively referred to as vertical division manner.
- the image block or the transform block is divided into four sub-image blocks or transform blocks or prediction blocks by horizontal dividing lines, and the dividing manner is horizontal and vertical dividing manner, and the dividing direction used in this time is horizontal and vertical dividing directions
- the NxN division method is horizontal and vertical division.
- the transform matrix can be used to remove the correlation of the residuals of the image blocks, that is, to remove redundant information of the image blocks, so as to improve the coding efficiency, and the transformation of the data blocks in the image blocks is usually used.
- the two-dimensional transform that is, the residual information of the data block is multiplied by the transform matrix of one NXM and its transposed matrix at the encoding end, and the transform coefficients are obtained after multiplication.
- ⁇ and ⁇ ' represents the transformation moment of the transformation matrix and the transformation matrix Array
- / represents a matrix of transform coefficients obtained by transforming the residual information of the data block.
- the transformation matrix may be a Discrete Cosine Transform (DCT) matrix, an Integer Transform matrix, a KL transform (KLT) matrix, or the like.
- DCT Discrete Cosine Transform
- KLT KL transform
- Performing the above processing on the residual information of the image block is equivalent to converting the residual information of the image block from the spatial domain to the frequency domain, and the processed transform coefficient matrix/concentrated in the low frequency region; the residual information of the image block to the image block
- the transformed coefficient matrix obtained by the conversion is subjected to quantization, entropy coding, and the like, and then the bit stream obtained by the entropy coding is transmitted to the decoding end.
- the encoding end sends the indication information indicating the transformation matrix used by the current image block to the decoding end.
- the subsequent decoding end determines the transform matrix used by the encoding end according to the indication information, and decodes the bit stream sent by the encoding end according to the characteristics of the transform matrix (orthogonality of the transform matrix, etc.) to obtain a transform coefficient matrix, and the transform coefficient matrix and The transformation matrix and its transposed matrix are multiplied to recover the residual information of the data block that is approximately consistent with the encoding end.
- the above steps can be described using the following formula:
- a transform matrix of size 2 ⁇ 2 ⁇ can be used for a block of 2 ⁇ 2 ⁇ , or a transform matrix of size ⁇ or a transform matrix of size 0.5 ⁇ 0.5 ⁇ can be used.
- a tree identification method can be used in order to effectively represent how image blocks use different size transformation matrices. As shown in FIG.
- the first layer in the code stream has an indication bit for identifying whether the image block uses a size of 2 ⁇ 2 ⁇ transformation matrix, if the image block uses a size of 2 ⁇ 2 ⁇ transformation matrix (as shown in FIG. 3a), the indicator bit is 0; if the image block does not use 2Nx2N transform, the indicator bit is 1, indicating that the 2Nx2N transform matrix needs to be further divided into four transform matrices of size NxN, and 4 ratios in the second layer structure of the code stream Specifically, whether each transform matrix of size NxN is further divided; if the image block uses the transform structure as shown in FIG.
- the size of the transformation matrix is not associated with the size of the prediction block.
- the 2Nx2N image block uses asymmetric division (the division line is shown by the thick solid line in the figure)
- the transformation matrix will cross the prediction block boundary;
- the current image block uses four transform matrices of size NxN, the transform matrix will still cross the prediction block boundary; if the lower left and upper right sides of the current image block use a transform matrix of size NxN, and the top left and right of the current image block
- a transform matrix of size 0.5NX0.5N is used, the transform matrix of the size NxN at the lower left of the current image block will still cross the prediction block boundary.
- the size of the transform matrix in the prior art is not associated with the size of the prediction block, resulting in the transformation matrix crossing the prediction block boundary. Since the residual data corresponding to the boundary of the two prediction blocks has a hopping transformation, if the transformation matrix crosses the boundary of the two prediction blocks, the effect of the transformation is weakened, and the correlation of the residual of the image block cannot be effectively removed. Sexuality, can not effectively remove redundant information of image blocks, reducing coding efficiency. Summary of the invention
- the present invention provides a method for obtaining a size of a transform block, including: obtaining a division manner of an image block; and obtaining size information of the divided transform block according to a division manner of the image block and a width and a height of the transform block before division .
- the present invention also provides another method for obtaining a transform block size, comprising: obtaining a height and a width of a transform block before partitioning; a height according to the transform block before the partition, a width of the transform block before the partition, and The minimum size of the preset transform block or the minimum size of the preset transform block obtains the size information of the divided transform block.
- the invention also correspondingly provides a module for performing the above method.
- the obtaining method and module of the transform block provided by the present invention can encode the size of the transform block according to the partitioning mode of the image block or the height and width of the transform block before the partitioning, thereby effectively improving the coding efficiency.
- Figure 1 a shows a schematic diagram of the division mode of 2Nx2N
- Figure 1 b shows a schematic diagram of the division mode of 2NxN
- Figure 1c shows a schematic diagram of the partitioning mode of Nx2N
- Figure 1d shows a schematic diagram of the partitioning mode of NxN
- Figure 2a shows a schematic diagram of the partitioning mode of 2NxnU
- Figure 2b shows a schematic diagram of the partitioning mode of 2NxnD
- Figure 2c shows a schematic diagram of the partitioning mode of nLx2N
- Figure 2d shows a schematic diagram of the partitioning mode of nRx2N
- Figure 3a shows a schematic diagram of an image block using a 2Nx2N transform block
- Figure 3b shows a schematic diagram of the image block using four sizes of NxN transform blocks
- Figure 3c shows an illustration of an image block using a transform block of size NxN transform block and size 0.5 NX0.5N;
- FIG. 4a shows a schematic diagram of an image block using a 2Nx2N transform block when asymmetrically divided
- FIG. 4b shows a schematic diagram of an image block using four sizes of NxN transform blocks when asymmetric partitioning
- FIG. 4c shows an image block use size when asymmetric partitioning is used.
- FIG. 5 is a flowchart of an image encoding method according to Embodiment 1 of the present invention
- FIG. 6 is a flowchart of an image encoding method according to Embodiment 2 of the present invention.
- Figure 6a shows a schematic diagram of an image block using a size Nx2N transform block
- Figure 6b shows a schematic diagram of an image block using a 0.5Nx2N transform block
- Figure 6c shows a schematic diagram of image block sizes Nx2N and NxN transform blocks
- FIG. 6d is a schematic diagram showing an image block using 0.5X2N and 0.5NX0.5N transform blocks;
- FIG. 7 is a flowchart of an image encoding method according to Embodiment 3 of the present invention.
- Figure 7a shows a schematic diagram of an image block using a 2Nx2N transform block
- Figure 7b shows a schematic diagram of an image block using a 0.5Nx2N transform block
- Figure 7c is a schematic diagram showing an image block using 0.5NX2N and 0.5NX0.5N transform blocks;
- Figure 8 is a flowchart of an image encoding method according to Embodiment 5 of the present invention.
- Figure 8a shows a schematic diagram of two prediction blocks corresponding to Nx2 N transform blocks
- 8b is a schematic diagram showing a Nx2N transform block corresponding to a left prediction block and an NxN transform block corresponding to a right prediction block;
- 8c is a schematic diagram showing a left prediction block corresponding to an Nx2N transform block and a right prediction block corresponding to a 0.5X0.5N transform block;
- FIG. 9 is a flowchart of an image decoding method according to Embodiment 6 of the present invention.
- FIG. 10 is a flowchart of an image decoding method according to Embodiment 7 of the present invention.
- FIG. 11 is a flowchart of an image decoding method according to Embodiment 8 of the present invention.
- FIG. 12 is a structural diagram of an image encoding apparatus according to an embodiment of the present invention.
- FIG. 13 is a structural diagram of an image decoding apparatus according to an embodiment of the present invention.
- FIG. 14 is a schematic diagram of transform block partitioning according to an embodiment of the present invention.
- FIG. 18 is a method for obtaining a transform block size according to an embodiment of the present invention.
- FIG. 19 is a method for obtaining a transform block size according to still another embodiment of the present invention.
- 20 and 21 are schematic diagrams of a variation block size obtaining module according to an embodiment of the present invention. detailed description
- Embodiment 1 is a diagrammatic representation of Embodiment 1:
- an embodiment of the present invention provides an image encoding method, where the method specifically includes: 501. Determine, according to a division manner of an image block, a prediction block used by the image block. Wherein, each step of the embodiment can be performed by an image encoding device.
- the division mode of the image block can be divided into: the division mode of nLx2N and the division mode of 2NxnL.
- the division mode of nLx2N belongs to vertical division.
- the image block is divided into sub-image blocks of 0.5NX2N and sub-image blocks of 1.5NX2N.
- the division mode of 2NxnL belongs to horizontal division, for example, the image block is divided into 2NX0. 5N sub-image block and 2NX1 .5N sub-image block.
- the determining, according to the division manner of the image block, the prediction block used by the image block specifically includes: determining the size of the prediction block used by the image block according to the division manner of the image block.
- the size of the prediction block is the same as the size of the sub-image block that is divided.
- the transform block corresponding to the image block is a transform block used by the image block; and the transform block corresponding to the prediction block is: a sub-image block that matches the size of the prediction block.
- the transform block corresponding to the image block or the prediction block is used in the image block or the prediction block, and the corresponding number of partition layers in the image block or the prediction block is used in the image block or the prediction block. Divide the number of layers.
- the number of division layers is the number of division layers corresponding to the transformation block corresponding to the image block or the prediction block.
- the at least one transform block corresponding to the image block (or prediction block) corresponds to the N+1 partition layer in the image block (or prediction block)
- the at least one transform block The horizontal size is smaller than a horizontal size of the transform block corresponding to the Nth partition layer; and/or the vertical size of the at least one transform block is smaller than a vertical size of the transform block corresponding to the Nth partition layer.
- the horizontal size of the at least one transform block is smaller than the horizontal size of the transform block corresponding to the Nth partition layer. Specifically, the horizontal size of the at least one transform block is the horizontal size of the transform block corresponding to the Nth partition layer.
- the vertical size of the at least one transform block is smaller than the vertical size of the transform block corresponding to the second partition layer. Specifically, the vertical size of the at least one transform block is a transform block corresponding to the second partition layer. l/m 2 of the vertical dimension, where m 2 is greater than or equal to 2. Where m ⁇ om 2 may or may not be equal.
- the transformation corresponding to the image block or the prediction block is identified.
- the identification information of the number of division layers corresponding to the block includes: a flag bit that identifies that the transform block of the first partition layer is not further divided; when one transform block corresponding to the image block or the prediction block is in the image block or the prediction block
- the identification information of the number of division layers corresponding to the transformation block corresponding to the image block or the prediction block includes: identifying a further division of the transformation block of the first division layer a flag bit, where the transform block corresponding to the image block or the prediction block is a transform block further divided by the transform block of the first partition layer; when the image block or the prediction block corresponds to one transform block in the
- the identifier of the number of division layers corresponding to the block is the third division layer.
- the information includes: a flag bit that further divides the transform block of the first partition layer, and a flag bit that further divides the transform block of the second partition layer, where the transform block corresponding to the image block or the prediction block is The transform block of the second partition layer is further divided into transform blocks, and the transform block of the second partition layer is a transform block obtained by further dividing the transform block of the first partition layer.
- step 502 the number of division layers corresponding to the transform block corresponding to the prediction block in the prediction block may be determined.
- Step 503 may be: determining, according to the division manner of the image block and the determined number of division layers, the prediction block corresponding to the prediction block. For the specific implementation of the step, refer to the detailed description of the embodiment shown in FIG. 6 , and details are not described herein again. It should be noted that, when the determined transform block corresponding to the prediction block corresponds to the first partition layer in the prediction block, the size of the transform block is the most d, and the size of the prediction block.
- Step 504 may be: determining identification information that identifies the number of division layers corresponding to the transformation block corresponding to the prediction block.
- Step 504 may be: writing identifier information identifying the number of division layers corresponding to the transformation block corresponding to the prediction block into the code stream. And determining, when the at least one transform block corresponding to the prediction block is the Nth partition layer, the identifier of the number of partition layers corresponding to the at least one transform block corresponding to the prediction block.
- the information includes: identifying a flag bit that is not further divided by the at least one transform block corresponding to the Nth partition layer; when the at least one transform block corresponding to the prediction block is greater than the corresponding number of partition layers in the prediction block
- the identification information that identifies the number of division layers corresponding to the at least one transformation block corresponding to the prediction block includes: one transformation block corresponding to the Nth division layer a flag bit divided by the step, wherein one transform block corresponding to the Nth partition layer is a previous transform block of the at least one transform block.
- N is an integer greater than 1, such as 1, 2, 3, 4, 5, and the like.
- the size of the transform block determined according to the partitioning manner of the image block and the specific partition layer is the smallest when the number of partition layers corresponding to the transform block corresponding to the prediction block is a specific partition layer.
- the size of the prediction block, wherein the minimum prediction block is the smallest prediction block among the prediction blocks of the determined image block.
- the specific dividing layer may be the first dividing layer.
- step 502 the number of division layers corresponding to the transform block corresponding to the image block in the image block is determined.
- Step 503 is to determine, according to the division manner of the image block and the determined number of division layers, the image block corresponding to the image block.
- the step refer to the detailed description of the embodiment shown in FIG. 7 , and details are not described herein again.
- Step 504 may be: determining identification information that identifies a number of division layers corresponding to the transform block corresponding to the image block.
- Step 504 may be: writing identifier information identifying the number of division layers corresponding to the transform block corresponding to the image block into the code stream.
- the identifier information that identifies the number of partition layers corresponding to the at least one transform block corresponding to the image block includes: a flag bit further divided by a transform block corresponding to the Nth partition layer, where N is greater than An integer of 1, such as 1, 2, 3, 4, 5, etc.
- the one transform block corresponding to the Nth partition layer is a previous transform block of the at least one transform block.
- the size of the transformation block determined according to the division manner of the image block and the first specific division layer Is the size of the image block;
- the corresponding transforming block of the image block is the second specific dividing layer in the image block, according to the dividing manner of the image block and the second specific dividing layer Determining that the size of the transform block is a size of a minimum prediction block, wherein the minimum prediction block is a prediction block of the determined image block The smallest forecast block in the middle.
- the second specific dividing layer is the next first dividing layer of the first specific dividing layer, wherein the first specific dividing layer number may be the first dividing layer, and the second specific dividing layer may be the second dividing layer.
- the minimum prediction block is the smallest prediction block in the prediction block used by the determined image block, that is, the minimum prediction block is the prediction block in which the horizontal size and/or the vertical size are the smallest among the prediction blocks used by the image block.
- the embodiment of the present invention considers the division manner of the image block when determining the size of the transform block, and writes the identification information of the number of division layers corresponding to the transform block corresponding to the image block or the prediction block into the code stream, so as to use layer by layer.
- the method of the identification identifies the size of the transform block, which not only ensures that the transform block does not cross the boundary of the prediction block, but also effectively identifies the size of the transform block, thereby effectively improving the coding efficiency.
- Embodiment 2 is a diagrammatic representation of Embodiment 1:
- an embodiment of the present invention provides an image encoding method, which determines a partitioning level of a transform block used by an image block and a specific size of a transform block used by an image block, and the method specifically includes:
- the image encoding device searches for a prediction block in the reference image according to a division manner of the image block, where the prediction block is an image block that matches a sub-image block size divided by the image block.
- the size matching in the embodiments of the present invention may be the same size, or the size difference may be within a predetermined range.
- the image encoding device obtains residual and motion vector information according to the divided sub-image block and the corresponding prediction block.
- the residual is the difference between the divided sub-image block and the pixel value of the corresponding pixel of the prediction block; for example, the difference between the divided sub-image block and the brightness value of the corresponding pixel of the prediction block, or the division The difference between the chrominance values of the corresponding pixel points of the sub-image block and the prediction block.
- the motion vector information indicates a position difference between the divided sub-image block and the prediction block.
- the image encoding device determines a corresponding number of division layers of the transform block used by the image block in the image block.
- the size of the transform block corresponding to the first partition layer is the size of the minimum prediction block.
- the traversal method is usually used to obtain an optimal coding mode. That is, in the embodiments of the present invention for describing image coding, the image coding apparatus can traverse the number of division layers that can be used, and determine which division layer number can be used for transformation. The effect is the best, wherein the size of the transform block corresponding to the first partition layer is the size of the minimum prediction block.
- the image encoding device determines a size of the transform block used by the image block according to the division manner of the image block and the determined number of division layers.
- the image block corresponding to the partitioning mode is Nx2N partitioning
- the image block is divided into two sub-image blocks of size Nx2N.
- the size of the prediction block is Nx2N.
- the first method of determining the size of the layer-by-layer identification is determined according to the image block dividing manner.
- the size of the transform corresponding to the partition layer is Nx2N, that is, the image block is divided into two Nx2N data blocks, and each block uses a transform block of Nx2N, respectively. As shown in FIG.
- the transform block of the Nx2N further divides the size of the obtained transform block, that is, the size of the transform block of the second partition layer further divided by the transform block of the first partition layer (ie, the transform block of size Nx2N), at this time,
- the horizontal size corresponding to the transform block of the next layer is the same as the horizontal size of the transform block corresponding to the current layer
- the vertical size corresponding to the transform block of the next layer is half of the vertical size of the transform block corresponding to the current layer, that is, the transform block at this time
- the size is NxN, where the next layer of transform blocks is the second partition layer, and the current layer is the first partition layer.
- the image block when the image block is divided into nLx2N partitions, it is assumed that the image block is divided into two sub-image blocks of size 0.5Nx2N and 1.5Nx2N, respectively.
- 5Nx2N ⁇ The image block corresponding to the prediction block size is 0. 5Nx2N and 1. 5Nx2N.
- the size of the transform corresponding to the first partition layer in the method of layer-by-layer identifier transform size is determined according to the image block partition manner.
- 5x2N ⁇ Each of the data blocks is divided into four 0. 5x2N data blocks, each data block uses a transformation of 0.
- 5x2N respectively, which is the same as the smallest prediction block size in the above-mentioned prediction block, that is, the size of the transformation block is 0. 5Nx2N.
- the transform structure used in the nLx2N partitioning mode is the same as nLx2N. At this time, it can be ensured that the size of the transform does not exceed the prediction block, that is, the transform does not cross the boundary of the prediction block, thereby ensuring the efficiency of the transform. If it is determined that the image block uses the transform block of the first partition layer, the effect of the transform can be made very good. As shown in FIG. 6d, when the second size of the image block is 0.
- 5Nx2N when the data block needs to use a further divided transform block, that is, when the transform block of the second split layer is needed, according to the image block division manner and the partition layer.
- the number is determined by the transform block of the 0.5Nx2N to further divide the size of the obtained transform block, that is, the transform block of the first partition layer (ie, the transform block having a size of 0. 5Nx2N) Dividing the size of the transform block of the second partition layer in one step, at this time, the horizontal size corresponding to the transform block of the next layer is the same as the horizontal size of the transform block corresponding to the current layer, and the vertical dimension corresponding to the transform block of the next layer is the current The size of the transform block is 0. 5NxO. 5N, where the next layer of the transform block is the second partition layer, and the current layer is the first partition layer.
- the other data blocks that do not use the further divided transform blocks are still using a 0.5 Nx2N transform.
- the image block is divided into two or more sub-image blocks in the horizontal direction by horizontal division, such as 2NxN, 2NxnU, 2NxnD, Nx2N, nRxN, the image block is determined to be the same as the foregoing.
- the number of division layers allowed in a certain division mode, or the minimum allowable transformation size in a certain division manner may be predetermined, wherein the number of division layers allowed in a certain division manner is the division.
- the maximum number of division layers that can be used can be preset in the codec system.
- the image coding device and the image decoding device can be preset to use up to two layers; or, image coding
- the device may also write indication information indicating the maximum number of division layers that can be used in the code stream, so as to notify the image decoding device of the maximum number of division layers that can be used; wherein, the minimum transformation size allowed in a certain division mode is the division.
- the size of the transform block corresponding to the highest number of layers allowed in the mode that is, setting the minimum transform block size in the image encoding device and the image decoding device, such as presetting the Nx2N image block partition mode in the image encoding device and the image decoding device
- the minimum allowable transform block size is NxN, and the nLx2N image block partition mode is preset.
- the minimum transform block size is 0. 5NxO. 5N; or, the image encoding device writes indication information indicating the minimum transform block size allowed in the code stream, so as to notify the image decoding device of the minimum transform block size allowed to be used, such as in the code. 5N ⁇
- the stream is written in the Nx2N image block partition mode, the minimum transform block size is NxN, and the minimum value of the transform block size is 0. 5NxO. 5N.
- the image coding apparatus determines identification information of the number of division layers corresponding to the transformation block used for identifying the image block.
- the identifier information for determining the number of division layers corresponding to the transform block corresponding to the identifier image block includes: 2 bits, and the value of the bit is the first specific value, for example, 1 for indicating the pair
- the Nx2N transform block corresponding to a partition layer is not further divided; for FIG.
- the identifier information for determining the number of partition layers corresponding to the transform block corresponding to the identifier image block includes: 2 bits, corresponding to the left Nx2N
- the value of the bit of the block is a first specific value, such as 1, for indicating that the Nx2N transform block corresponding to the first partition layer is not further divided
- the value of the bit corresponding to the right Nx2N block is two specific values, such as 0, used to indicate that the Nx2N transform block corresponding to the first partition layer needs to be further divided.
- the identifier information for determining the number of division layers corresponding to the transform block corresponding to the identifier image block includes: 4 bits, and the value of the bit is the first specific value, for example, 1 for indicating The 0.5Nx2N transform block corresponding to the first partition layer is not further divided; for FIG.
- the identifier information for determining the number of partition layers corresponding to the transform block corresponding to the identifier image block includes: 4 bits, corresponding to the first and third bits
- the value of the bits of the four 0.5Nx2N transform blocks is a first specific value, such as 1, for indicating that the three 0.5Nx 2N transform blocks are not further divided, corresponding to the bits of the second 0.5Nx2N transform block.
- the value is a second specific value, such as 0, to indicate that further partitioning is required for this 0.5Nx 2N transform block.
- the image coding apparatus transforms the residual of the image block by using the corresponding transform block, and then performs quantization, and encodes the quantized value.
- the image coding apparatus writes the identification information of the division layer number corresponding to the transformation block corresponding to the prediction block, the coding result of step 606, and the indication information indicating the image block division manner into the code stream, and transmits the code stream.
- the above embodiment of the present invention considers the division manner of the image block when determining the size of the transform block used for the image block, and writes the identification information of the number of division layers in which the transform block for identifying the image block is used to the code stream for use.
- the layer-by-layer identification method identifies the size of the transform block, which not only ensures that the transform block does not cross the boundary of the prediction block, but also effectively identifies the size of the transform block, thereby effectively improving the coding efficiency.
- Embodiment 3 is a diagrammatic representation of Embodiment 3
- an embodiment of the present invention provides another image encoding method, which takes into account the jump of the boundary of the two sub-image blocks when the residual values obtained when the two sub-image blocks into which the image block is divided are small.
- the phenomenon is not obvious.
- the transform block used by the image across the boundary of the sub-image block does not significantly cause the conversion efficiency to be deteriorated, and the number of coded bits required for identifying a larger-sized transform is less than that for identification.
- the small size of the transformation so the image block can be better with a larger size of the transformation effect.
- the large-size transform and the small-size transform are combined by using a layer-by-layer identification method, and the embodiment specifically includes:
- Steps 701-702 are the same as steps 601-602, and are not described herein again.
- the image encoding device determines a corresponding number of division layers of the transform block used by the image block in the image block.
- the specific implementation manner of this step is similar to step 603, except that: the first partition layer corresponds to The size of the transform block is the size of the image block, that is, 2N x 2N; the size of the transform block corresponding to the second partition layer is the size of the minimum prediction block.
- the image coding apparatus determines a size of the transform block used by the image block according to the division manner of the image block and the determined number of division layers.
- the size of the transform block used to determine the image block according to the manner in which the image block is divided and the determined number of partition layers is similar to step 604, except that: in the embodiment, the first partition layer corresponds to The size of the transform block is 2Nx2N, and the size of the transform block corresponding to the second partition layer in this embodiment is equivalent to the size of the transform block corresponding to the first partition layer in the foregoing embodiment.
- the transform block corresponding to the third partition layer in this embodiment The size is equivalent to the size of the transform block corresponding to the second partition layer in the above embodiment, and so on.
- the image block is divided by nLx2N, as shown in FIG. 7a, if it is determined in step 703 that the transform block of 2Nx2N is used, the effect of the transform can be made good, and the first partition of the image block corresponds to The transform block size is 2Nx2N, and the transform block can cross the sub-image block boundary.
- the image encoding device determines the transform block of the second partition layer, the image block is determined according to the division manner of the image block and the number of division layers.
- the size of the transform block of the second partition layer is 0. 5Nx2N, and the image block is divided into four 0. 5Nx2N data blocks, and each block uses a transform block of 0.5Nx2N, as shown in FIG. 6b.
- the two 0. 5Nx2N are determined according to the image block division mode and the number of division layers.
- the horizontal size of the transform block obtained by further transforming the transform block is the same as the horizontal size of the transform block corresponding to the second partition layer, and the vertical size is a quarter of a vertical vertical of the transform block corresponding to the second partition layer.
- 5NxO. 5N Transformation block The data block of the fourth and the 0. 5x2N is divided into four 0. 5NxO. 5N blocks, each block uses 0. 5NxO. 5N transform block.
- the image encoding device determines identification information of the number of division layers in which the transform block for identifying the image block is located.
- the identifier information for determining the number of division layers corresponding to each transform block corresponding to the identifier prediction block includes one bit, and the value is a first specific value, such as 1, for indicating that the first partition layer is corresponding.
- the transform block ie, the 2Nx2N transform block
- the identifier information of the partition layer corresponding to each transform block corresponding to the identifier block includes two layers of indication information, and the indication information of the first layer includes 1 bit.
- the indication information includes 4 bits whose values are 1, respectively, indicating a transformation to the 4 second division layers.
- the identification information of the number of layers corresponding to each transform block corresponding to the prediction block includes at least two layers of indication information, and the indication information of the first layer includes 1 bit, and the value is the second.
- a specific value, such as 0, is used to indicate that the transform block corresponding to the first partition layer (ie, the 2Nx2N transform block) needs to be further divided to obtain four transform blocks of the second partition layer (ie, 0.5NX2N transform block);
- the indication information includes 4 bits, and the values of the 2nd and 3rd bits are 1, indicating that it is not necessary to further divide the two transform blocks in the middle of the figure; the values of the first and fourth bits are 0, indicating that it is necessary to The two transform blocks on both sides are further divided to obtain four transform blocks of the third partition layer (i.e., 0.5Nx0.5N transform blocks).
- the corresponding prediction block is identified.
- the identification information of the number of division layers corresponding to the transformation block only includes two layers of indication information. Otherwise, the identification information further includes indication information of the third layer, and the indication information of the third layer is used to represent the four third division layers. Whether the transform block still needs further division.
- the image coding device transforms the residual of the image block by using the corresponding transform block, and then performs quantization, and encodes the quantized value.
- the image coding apparatus writes the identification information of the number of division layers in which the transform block for identifying the image block is used, the coding result of step 706, and the indication information indicating the manner of dividing the image block into the code stream, and transmits the code stream.
- the above embodiment of the present invention considers the division manner of the image block when determining the size of the transform block used for the image block, and writes the identification information of the number of division layers in which the transform block for identifying the image block is used to the code stream for use.
- the layer-by-layer identification method identifies the size of the transform block, which not only ensures that the transform block does not cross the boundary of the prediction block, but also effectively identifies the size of the transform block, thereby effectively improving the coding efficiency.
- Embodiment 4 is a diagrammatic representation of Embodiment 4:
- the size of the corresponding transform block corresponding to the transform block corresponding to the image block or the prediction block according to the image block division manner is specifically described as follows:
- the size of the corresponding transform block is obtained by looking up the table:
- the first method determining a division manner of the image block and a transformation block size corresponding to the number of division layers by using a preset image block division manner and a correspondence between the number of division layers and the transformation block size.
- the number of division layers is the number of division layers corresponding to the image block or the transformation block corresponding to the prediction block.
- Table 1 below shows the correspondence relationship between the image block division method and the division layer number and the transformation block size.
- the second method is: determining, by using a preset image block division manner, a correspondence between the number of division layers and a ratio of the first type of size, determining a division ratio of the image block and a first type size ratio corresponding to the number of division layers, wherein The number of division layers is the number of division layers corresponding to the transformation block corresponding to the image block or the prediction block, and then determines the size of the transformation block corresponding to the image block or the prediction block according to the determined first type size ratio and the size of the image block, where
- the first type of size ratio includes: a ratio of a horizontal size of the transform block corresponding to the image block or the prediction block to a horizontal size of the image block, and a ratio of a vertical size of the transform block corresponding to the image block or the prediction block to a vertical size of the image block,
- the following table 2 shows the correspondence relationship between the image block division manner and the division layer number and the ratio of the horizontal size of the transform block to the horizontal size of the image block, and the following describes the image
- the third method determining a division ratio of the image block and a second type size ratio corresponding to the number of layers by using a preset image block division method, a division layer number, and a second type size ratio, wherein
- the number of division layers is the number of division layers corresponding to the transformation block corresponding to the image block or the prediction block, and then determining the corresponding image block or the prediction block according to the determined second type size ratio and the size of the prediction block.
- the second type of size ratio includes: a ratio of a horizontal size of the transform block corresponding to the image block or the prediction block to a horizontal size of the prediction block, and a vertical size and a prediction block of the transform block corresponding to the image block or the prediction block.
- the ratio of the vertical size of the image block or the horizontal size of the minimum prediction block and the image block of the image block or the prediction block corresponding to the horizontal size of the minimum prediction block and the image block may be specifically included in a specific embodiment.
- Table 4 shows the correspondence between the image block division mode and the number of division layers and the ratio of the horizontal size of the transformation block to the horizontal size of the minimum prediction block.
- Table 5 shows the image block division method and the division layer number. Correspondence between the vertical dimension of the transform block and the vertical dimension of the smallest predictor block.
- Embodiment 5 is a diagrammatic representation of Embodiment 5:
- Another embodiment of the present invention provides an image encoding method, which differs from the above two embodiments mainly in that: This embodiment uses a layer-by-layer identification method in units of prediction blocks.
- Steps 801-802 are the same as steps 601-602, and are not described herein again.
- the image coding device determines a corresponding number of division layers of the transform block corresponding to the prediction block in the prediction block.
- the size of the transform block corresponding to the first partitioning level is the size of the minimum prediction block.
- the image coding device determines a size of the transform block corresponding to the prediction block according to the division manner of the image block and the determined number of division layers.
- the image block corresponding to the partitioning mode is Nx2N partitioning
- the image block is divided into two sub-image blocks of size Nx2N.
- the size of the prediction block is Nx2N.
- the two prediction block corresponding transform blocks are the transform blocks of the first partition layer, and the transform block size used by the two prediction blocks is Nx 2N, and the partition flags are respectively set for the two prediction blocks.
- the identifier uses the first partition layer; as shown in FIG. 8b, the partition layer of the transform block corresponding to the prediction block on the left side of the image block is still the first partition layer, and the partition layer of the transform block corresponding to the right prediction block is the second partition.
- the transform block size used by the left prediction block is still Nx2N
- the transform block size used by the right prediction block is determined to be NxN according to the number of division layers (second partition layer) and the image block division manner (Nx2N), and the left side is respectively set to the left and
- the partitioning flag of the right prediction block is used to identify the left prediction block using the first layer partition, and the right prediction block uses the second partition layer; as shown in FIG.
- the partition layer corresponding to the prediction block corresponding to the left side of the image block at this time Still the first partition layer
- the partition layer of the transform block corresponding to the right prediction block is the third partition layer, so the transform block size used by the left prediction block is still Nx2N, right
- the transform block size used by the prediction block is determined to be 0. 5NxO. 5N according to the number of division layers (third partition layer) and the image block division manner (Nx2N), and the division flags of the left and right prediction blocks are respectively set to identify the left prediction.
- the block uses the first layer partition
- the right prediction block uses the third layer partition.
- the image coding device determines identification information of the number of division layers corresponding to the transformation block corresponding to the prediction prediction block.
- the identification information for determining the number of division layers corresponding to the transform block corresponding to the left prediction block includes: 1 bit, and the value of the bit is a first specific value, such as 1, for indicating the first
- the Nx2N transform block corresponding to the partition layer is not further divided
- the identifier information for determining the number of partition layers corresponding to the transform block corresponding to the right prediction block includes: 1 bit, and the value of the bit is the first specific value, used to represent The Nx2N transform block corresponding to the first partition layer is not further divided; as shown in FIG. 8b, the identifier information of the number of partition layers corresponding to the transform block corresponding to the left prediction block is the same as that of FIG.
- the identification information of the number of division layers corresponding to the transform block includes: 1 bit, and the value of the bit is a second specific value, which is used to indicate further division of the Nx2N transform block corresponding to the first partition layer; as shown in FIG. 8c
- the identification information of the number of division layers corresponding to the transformation block corresponding to the left prediction block is the same as that of FIG. 8a, and the number of division layers corresponding to the transformation block corresponding to the right prediction block is determined.
- the identifier information includes: two layers of indication information, where the first layer indication information includes: 1 bit, and the value of the bit is a second specific value, which is used to indicate that the Nx2N transform block corresponding to the first partition layer is further divided, and 2 is obtained. Change of the second division layer The block is changed (the size is NxN); the second layer indication information includes: 2 bits, and the transform block for indicating the 2 second partition layers is further divided, so that the right prediction block can be used to obtain the transform of the third partition layer. Piece.
- the image coding device transforms the residual of the image block by using the corresponding transform block, and then performs quantization, and encodes the quantized value.
- the image coding apparatus writes the identification information of the number of division layers in which the transformation block corresponding to the prediction block is located, the coding result of step 806, and the indication information indicating the division manner of the image block into the code stream, and transmits the code stream.
- the foregoing embodiment of the present invention considers the division manner of the image block when determining the size of the transformation block corresponding to the prediction block, and writes the identification information of the number of division layers in which the transformation block corresponding to the prediction block is located into the code stream, so as to use layer by layer.
- the method of the identification identifies the size of the transform block, which not only ensures that the transform block does not cross the boundary of the prediction block, but also effectively identifies the size of the transform block, thereby effectively improving the coding efficiency.
- an embodiment of the present invention provides an image decoding method, where the method specifically includes:
- the execution subject of each step of the embodiment is an image decoding device.
- the image decoding device obtains the division mode of the image block from the code stream transmitted by the image coding device, that is, the resolution code stream obtains the division manner of the image block.
- the division manner of the image block may be divided into: a division manner of the nLx2N and a division manner of the 2NxnL.
- the step of determining the prediction block used by the image block according to the division manner of the image block in the step specifically includes: determining the size of the prediction block used by the image block according to the division manner of the image block.
- the parsing code stream obtains identification information that identifies a corresponding number of layers of the transform block corresponding to the image block or the prediction block in the image block or the prediction block, and determines the image block or the prediction block according to the identifier information. a corresponding number of division layers of the corresponding transform block in the image block or the prediction block; wherein the transform block corresponding to the image block or the prediction block includes one or more transform blocks.
- the step of the method includes: when the identifier information includes: an identifier for indicating that the transform block corresponding to the Nth partition layer is not further divided, the image decoding device determines, according to the identifier information, that the image block or the prediction block corresponds to The number of corresponding layers of the at least one transform block in the image block or the prediction block And determining, by the image decoding device, the image block or the prediction block according to the identifier information, where the identifier information includes: an identifier for further dividing the at least one transform block corresponding to the Nth partition layer. Corresponding at least one transform block has a corresponding number of partition layers in the image block or the prediction block that is greater than the Nth partition layer.
- the specific process of determining, according to the identifier information, the corresponding number of layers of the transform block corresponding to the prediction block in the prediction block includes:
- N is equal to M-1
- the value of the bit in the Nth layer indication information is the first specific value, determining that the number of division layers corresponding to the transform block corresponding to the bit is the Nth division layer
- the value of the bit in the Nth layer indication information is the second specific value, determining that the number of division layers corresponding to the transform block corresponding to the bit is the Mth division layer; wherein, M is a predetermined division layer Number or the number of division layers corresponding to the predetermined minimum transform block; where N is greater than or equal to 1;
- the N is less than M-1
- determining that the number of division layers corresponding to the transform block corresponding to the bit is the Nth division layer
- the value of the bit in the Nth layer indication information is the second specific value, continue to read the next layer of indication information from the identification information until the M-1 layer indication information is read or read.
- the value to all the bits is the N+a layer indication information of the first specific value, wherein the N+a is less than or equal to M.
- the number of bits in the Nth layer indication information is a minimum prediction in the prediction block.
- the number of bits in the first layer indication information is one;
- the number of bits in the layer 2 indication information is the number of the smallest prediction blocks in the image block.
- the embodiment of the present invention considers the division manner of the image block when determining the size of the transform block, and writes the identification information of the number of division layers corresponding to the transform block corresponding to the image block or the prediction block into the code stream, so as to use layer by layer.
- the method of identification identifies the size of the transform block, which ensures that the transform block does not cross the edge of the prediction block
- the boundary at the same time, effectively identifies the size of the transform block, effectively improving the coding efficiency.
- an embodiment of the present invention provides an image decoding method, where the image decoding method corresponds to the image encoding method shown in FIG.
- the image decoding device parses the indication information of the division manner of the image block in the code stream, and obtains a division manner of the image block according to the instruction information.
- the division manner of the image block may be an Nx2N division manner or an nLx2N division manner. 1002.
- the image decoding device searches for a prediction block in a reference image according to a division manner of the image block, where the prediction block is an image block that matches a sub-image block size divided by the image block.
- the image decoding device parses the code stream to obtain identification information of the number of division layers corresponding to the transformation block used by the identification image block in the image block, and determines, according to the identification information, the transformation block used by the image block in the image block. The corresponding number of division layers.
- the size of the transform block corresponding to the first partition layer is the size of the minimum prediction block.
- step 1003 and step 1004 include:
- the image decoding device determines, according to the division manner, the number of bits of the first layer indication information in the identification information, that is, the number of the smallest prediction block in the image block is the number of bits of the first layer indication information, when the image block division mode is Nx2N Determining the number of bits of the first layer indication information is 2; when the image block division mode is nLx2N, for example, dividing the image block into two sub-image blocks of 0.5Nx2N and 1.5Nx2N, the number of bits of the first layer indication information
- the first layer indicates that the transform block size corresponding to the information identifier image block is not divided into smaller sizes, it is determined that the number of partition layers corresponding to the current image block is the first partition layer, and when the image block partition mode is Nx2N 5Nx2N, ⁇
- the size of the transform block corresponding to the image block is Nx2N, that is, the size of the transform block corresponding to the first partition layer is consistent with the size of the prediction block; when the image block
- the first The transform block size corresponding to the partition layer is consistent with the smallest prediction block size in the prediction block.
- the first layer indication information identifies that the transform block size of some first partition layers is divided into smaller sizes, the number of partition layers is added to the current partition layer number, that is, the number of partition layers becomes the second partition layer.
- the transform block size of the second partition layer corresponding to the image block is NxN, that is, the horizontal size corresponding to the next layer of the transform block is the same as the horizontal size of the transform block corresponding to the current layer, and the vertical size corresponding to the next layer of the transform block is half of the vertical size of the transform block corresponding to the current layer, as shown in FIG. 6b.
- the size of the transform block of the next layer is determined to be 0. 5NxO.
- the horizontal size corresponding to the transform block of the next layer is the same as the horizontal size of the transform block corresponding to the current layer, and
- the vertical size corresponding to the next layer of transform blocks is one quarter of the vertical size of the transform block corresponding to the current layer, as shown in FIG. 6d.
- the coding and decoding device can be configured to be the same as the coding end, and the specific implementation manner is the same as that of the coding end. . Specifically, the manner of determining the size of the transform block for the image block according to the manner in which the image block is divided and the number of the divided layers is the same as that in the fourth embodiment, and details are not described herein.
- the embodiment of the present invention considers the division manner of the image block when determining the size of the transform block used by the image block, and writes the identification information of the number of division layers corresponding to the transform block used for the image block to the code stream, so that The method of layer-by-layer identification is used to identify the size of the transform block, which not only ensures that the transform block does not cross the boundary of the prediction block, but also effectively identifies the size of the transform block, thereby effectively improving the coding efficiency.
- an embodiment of the present invention provides an image decoding method, which corresponds to the image encoding method shown in FIG. 7, and specifically includes:
- Steps 1111-1102 are the same as steps 1001-1002, and are not described herein again.
- Step 1113 The image decoding device parses the code stream to obtain identification information of the number of transform block partition layers used for identifying the image block, and determines, according to the identifier information, a corresponding number of partition layers of the transform block used by the image block in the image block.
- the first layer indication information is obtained from the identifier information of the transform block partition layer corresponding to the prediction block of the identifier image block, where the first layer indication information includes one bit, that is, the first bit is obtained, according to The value of the first bit determines whether the first partition layer is further divided. If the value of the first bit indicates that the first partition layer is not further divided, the transform block corresponding to the determined image block is one transform block, that is, 2Nx2N. a transform block; if the value of the first bit indicates that the first partition layer is further divided, determining the number of bits of the second layer indication information in the identifier information according to the size of the smallest prediction block in the prediction block of the image block.
- the partitioning mode is 0.5Nx2N
- the size of the minimum prediction block is also 0.5Nx2N
- the image block of size 2Nx2N corresponds to the transformation of 4 sizes and the minimum prediction block size.
- Block so the bit of the second layer indication information is determined to be 4, and the 4 bits are read. If the bit value is the first specific value, such as 1, the transform block indicating the second partition layer is not further divided. If the bit value is a second specific value, such as 0, the transform block indicating the second partition layer needs to be further divided; for the graph illustrated in FIG. 7b, the 4 bits are all the first specific value, and then the determination is made.
- the transform block of the image block is corresponding to the second partition layer in the image block, that is, each transform block used for determining the image block is a transform block of the second partition layer; for the graph illustrated in FIG. 7c,
- the 2nd and 3rd bits of the 4 bits are the first specific value, indicating that it is not necessary to further divide the transform block corresponding to the 2nd and 3rd bits of the second partition layer, and determine the 4 used for the image block.
- the number of division layers of the transform blocks corresponding to the second and third bits of the bits is the second division layer; the first and fourth bits are the second specific value, indicating that the first and fourth bits of the second division layer need to be
- the corresponding transform block is further divided to obtain 4 third
- the layered transform block in this case, the number of partition layers allowed in the partition mode is 3 layers, or the minimum transform block size allowed in the partition mode is 0. 5NxO. 5N, it is determined that the image block needs to correspond to 4
- the transform block further divided by the transform blocks corresponding to the first and fourth bits of the bits has a partition layer corresponding to the third partition layer.
- Step 1104 Determine a size of the transform block used by the image block according to a division manner of the image block and the number of the division layers.
- the size of the transform block corresponding to the first partition layer is the size of the image block, that is, 2N x2N; the size of the transform block corresponding to the second partition layer is the size of the minimum prediction block.
- the size of the transformation block corresponding to the image block is determined to be 2Nx2N, that is, the size of the transformation block corresponding to the first division layer is consistent with the image block. As shown in FIG. 7a); when the number of division layers corresponding to the image block is the second division layer, when the image block division mode is nLx2N, the image is determined according to the division manner of the image block and the number of division layers (ie, the second division layer) The size of the transform block corresponding to the block is 0.
- 5Nx2N that is, the size of the transform corresponding to the second partition layer is the same as the smallest prediction block size in the prediction block, as shown in FIG. 7b);
- the size of the transforming block to be used is determined to be 0. 5NxO. 5N , that is, next, according to the dividing manner of the image block and the number of dividing layers (ie, the third dividing layer).
- the horizontal size corresponding to the layer transform block is the same as the horizontal size of the transform block corresponding to the current layer, and the vertical size corresponding to the next layer transform block is one quarter of the vertical size of the transform block corresponding to the current layer, as shown in the figure. 7c) is shown.
- the manner of determining the size of the corresponding block of the image block according to the manner of dividing the image block and the number of the divided layers is the same as that described in the foregoing Embodiment 4, and details are not described herein again.
- the division of the image block is considered when determining the size of the transform block used for the image block.
- the identification information of the number of division layers of the transform block used for identifying the image block is written into the code stream, so as to identify the size of the transform block by using a layer-by-layer identification method, which ensures that the transform block does not cross the boundary of the prediction block.
- the size of the transform block is effectively identified, which effectively improves the coding efficiency.
- an embodiment of the present invention provides an image decoding method, which corresponds to the image encoding method shown in FIG. 7.
- the image decoding device separately parses the partitioning flags corresponding to the two prediction blocks (ie, the corresponding transform blocks corresponding to the identifier prediction block).
- the identification information of the hierarchical layer is determined according to the division flags of the two prediction blocks respectively, and the number of division layers corresponding to the transformation blocks corresponding to the two prediction blocks is respectively determined, and two according to the division manner of the image block and the determined division layer number respectively The size of the transform block corresponding to the prediction block.
- an embodiment of the present invention provides an image encoding apparatus, including:
- a prediction block determining unit 10 configured to determine a prediction block used by the image block according to a division manner of the image block
- a division level determining unit 20 configured to determine a number of division layers corresponding to the transform block corresponding to the image block or the prediction block in the image block or the prediction block, where the transform block corresponding to the image block or the prediction block includes one Or multiple transform blocks;
- a transform block size determining unit 30 configured to determine a size of the transform block corresponding to the image block or the prediction block according to a division manner of the image block and the number of division layers;
- the identification information determining unit 40 is configured to determine identification information that identifies the number of division layers corresponding to the transform block corresponding to the image block or the prediction block;
- the writing unit 50 is configured to write the identification information into the code stream.
- the relationship between the transform block size corresponding to the upper partition layer and the transform block size corresponding to the lower partition layer (for example, the transform block size corresponding to the Nth partition layer and the transform block size corresponding to the N+1 partition layer) Relationship, wherein the Nth dividing layer is the upper dividing layer of the (N+1)th layer, the N+1th layer is the lower layer of the Nth layer, and the size of the transform block corresponding to the layer is defined
- the Nth dividing layer is the upper dividing layer of the (N+1)th layer
- the N+1th layer is the lower layer of the Nth layer
- the size of the transform block corresponding to the layer is defined
- the dividing hierarchy determining unit 20 is configured to determine, when the at least one transform block corresponding to the image block or the prediction block has a corresponding number of partition layers in the image block or the prediction block, is an Nth partition layer, An identification information packet of the number of division layers corresponding to the at least one transform block corresponding to the image block or the prediction block And including: a flag bit that is not further divided by the at least one transform block of the Nth partition layer; or, the partition level determining unit 20 is configured to: when the image block or the prediction block corresponds to at least one transform block And determining, when the number of the corresponding layer of the image block or the prediction block is greater than the Nth layer, the identification information that identifies the number of layers corresponding to the at least one transform block corresponding to the image block or the prediction block includes: The flag bit further divided by the transform block corresponding to the Nth division layer.
- the transform block size determining unit 30 is configured to query a partitioning manner of the image block and a transform block size corresponding to the number of the layered layers, where a specific correspondence relationship may be as shown in Table 1;
- the transform block size determining unit 30 is configured to query a partitioning manner of the image block and a first type of size ratio corresponding to the number of divided layers; wherein, the first type of size ratio includes: the image block Or a ratio of a horizontal size of the transform block corresponding to the prediction block to a horizontal size of the image block and a ratio of a vertical size of the transform block corresponding to the image block or the prediction block to a vertical size of the image block; according to the first type size ratio Determining, by the horizontal size and the vertical size of the image block, a transform block size corresponding to the image block or the prediction block, wherein the specific correspondence may be as shown in Table 2 and Table 3;
- the transform block size determining unit 30 is configured to query a dividing manner of the image block and a second type size ratio corresponding to the number of dividing layers; and the second type of size ratio includes: the image block or the prediction block a ratio of a horizontal size of the corresponding transform block to a horizontal size of the prediction block and a vertical size of the transform block corresponding to the image block or the prediction block to a vertical size of the prediction block; according to the second type size ratio and the prediction block Determining, by the horizontal size and the vertical size, the transform block size corresponding to the image block or the prediction block, where the second type of size ratio may specifically include: a horizontal size of the transform block corresponding to the image block or the prediction block and a level of the minimum prediction block a ratio of the size to a ratio of a vertical size of the transform block corresponding to the image block or the prediction block to a vertical size of the minimum prediction block; and then determining the image block or the prediction block according to the determined second type size ratio and the size of the minimum prediction block The size of the
- the embodiment of the present invention considers the division manner of the division manner of the image block when determining the size of the transformation block, and writes the identification information of the division layer number corresponding to the transformation block corresponding to the image block or the prediction block into the code stream.
- the layer-by-layer identification method it not only ensures that the transform block does not cross the boundary of the prediction block, but also effectively identifies the size of the transform block, thereby effectively improving the coding efficiency.
- an embodiment of the present invention provides an image decoding apparatus, including:
- a prediction block determining unit 60 configured to obtain a division manner of the image block, according to the division of the image block Means, determining a prediction block used by the image block;
- the identification information obtaining unit 70 is configured to obtain, by the parsing code stream, identification information that identifies a corresponding number of layers of the transform block corresponding to the image block or the prediction block in the image block or the prediction block;
- a partitioning level determining unit 80 configured to determine, according to the identifier information, a number of partitioning layers corresponding to the transform block corresponding to the image block or the prediction block in the image block or the prediction block; where the image block or the prediction block corresponds to The transform block includes one or more transform blocks;
- the transform block size determining unit 90 is configured to determine a size of the transform block corresponding to the image block or the prediction block according to a division manner of the image block and the number of division layers.
- the identifier information includes: an identifier for indicating that the transform block corresponding to the Nth partition layer is not further divided; wherein the partition level determining unit is configured to determine the image block or according to the identifier information And the at least one of the transform blocks corresponding to the block of the prediction block is the Nth partition layer in the image block or the prediction block; or the identifier information includes: An identifier that is further divided by the at least one transform block, the partitioning level determining unit, configured to determine, according to the identifier information, that at least one transform block in the transform block corresponding to the image block or the prediction block is in the image block or the prediction block The corresponding number of division layers is larger than the Nth division layer.
- transform block size determining unit 90 The structure and function of the transform block size determining unit 90 are similar to those of the transform block size determining unit 30 in the image encoding apparatus, and will not be described herein.
- the embodiment of the present invention considers the division manner of the division manner of the image block when determining the size of the transformation block, and writes the identification information of the division layer number corresponding to the transformation block corresponding to the image block or the prediction block into the code stream.
- the layer-by-layer identification method it not only ensures that the transform block does not cross the boundary of the prediction block, but also effectively identifies the size of the transform block, thereby effectively improving the coding and decoding efficiency.
- the number of division layers of the transform block corresponding to the image block (or the number of division layers of the transform block corresponding to the prediction block) is used to determine the size of the transform block, according to the division layer number of the specific transform block and the division of the image block.
- the way to obtain the specified divided transform block size can be obtained.
- the transform blocks have different sizes, and the ratio of the width and the height of the transform block corresponding to the specific number of division layers is also different.
- the first The transform block size corresponding to a partition layer is 2Nx2N, and the ratio of the width and height of the transform block is 1:1; the size of the transform block corresponding to the second partition layer is 0. 5Nx2N, and the ratio of the width and the height of the transform block is 1: 4 ⁇
- the size of the transform block corresponding to the third partition layer is 0. 5NxO. 5N, the ratio of the transform block is 1:1. That is to say, the number of division layers can be used to identify the size of the transformation block under the division mode of the specified image block.
- the initial transform block size corresponding to the image block is consistent with the image block size (the transform block size corresponding to the first partition layer in the third embodiment), the partition of the transform block and the image block partition
- the relationship of the mode, the number of transform blocks divided into smaller sizes is always fixed (such as divided into four smaller transform blocks, or divided into two smaller transform blocks), the size of the transform block cannot exceed The maximum transform block size allowed in the video codec system, the size of the transform block cannot be smaller than the minimum transform block size allowed in the video codec system.
- the information of the transform block is used (the height of the transform block, the width of the transform block, the average value of the transform block height and width, the preset maximum transform block size, and the preset minimum The transform block size) and the image block division manner, or the information of the aforementioned transform block can be used to determine the divided transform block size.
- the image block division method Nx2N will be taken as an example to explain the numerical relationship according to the image block division manner and the width and height of the transform block, and the method of obtaining the size of the divided transform block based only on the numerical relationship of the width and height of the transform block.
- the size of the image block is 2Mx2M
- the preset maximum transform block size is 2M
- the preset minimum transform block size is 0.25M.
- the transform block is divided into four rules, that is, the transform block is always divided into four smaller transform blocks.
- the smaller size may be that the width of the divided transform block is smaller than the width of the pre-partition transform block, or the height of the divided transform block is smaller than the height of the pre-partition transform block, or the width and height of the divided transform block are smaller than Divide the width and height of the pre-transform block. Let the initial size of the transform block be equal to the size of the image block.
- the divided value is determined according to the numerical relationship between the width and height of the transform block before the partition, and the numerical relationship between the width and height of the transform block before the partition and the maximum size of the preset transform block. Transform the size of the block.
- the numerical relationship may be greater than or equal to or less than.
- the initial value of the transform block size is equal to the size of the image block, and the transform block size is 2Mx2M at this time, as shown in FIG.
- the width and height of the transform block before division are equal to the width and height of the image block
- the width of the transform block before the partition is equal to the height of the transform block before the partition
- the transform block has not been further divided at this time.
- the transform block follows two rules when performing the partitioning: 1.
- the ratio of the width and the height of the transform block after the transform block is divided. It depends on the way the image block is divided; 2.
- the transform block is divided into four methods. Therefore, it can be seen that the transform block needs to be divided into four 0.5Mx2M transform blocks in the vertical direction, as shown in FIG.
- the size of the transform block must be smaller than or equal to the preset maximum transform block size, if the initial value of the transform block size is equal to the size of the image block and the image block size is larger than the preset maximum transform block size, as described above,
- the initial size of the transform block is also larger than the preset maximum transform block size, and the transform block is divided into four transform blocks whose width and height are both half of the original.
- the transform block is divided according to the image block division manner, and the transform block is divided into four.
- the transform block is smaller in size, so the width of the divided transform block is four times higher.
- the above process uses the information of the transform block and the division manner of the image block to determine whether the transform block needs to be divided and the size of the divided transform block.
- the width or height of the transform block is smaller than the preset maximum transform block size, and the width of the transform block is not equal to high, it can be known that the transform block has been divided according to the image block partition manner, and the transform block size before the partition is 0.5Mx2M; When it is determined that the transform blocks labeled 0 and 3 are further divided into smaller-sized transform blocks as shown in FIG.
- the transform block size obtained by the partition is 0.25 Mx2M
- the size of the transform block obtained by the partition is 0.5 ⁇ 0.5 ⁇
- the size of the divided transform block obtained by the two partitioning methods is different from the size of the prediction block (Mx2M), so that the transform block is known.
- the transform block size 0.25 MxM obtained by dividing the horizontal and vertical directions is the optimal partition size, as shown in FIG.
- the above process uses only the information of the transform block for judging whether the transform block needs to be divided and the size of the divided transform block.
- the width or height of the transform block before division is equal to the preset minimum transform block size, as in this example, the width is equal to 0.25. M, even if the width of the transform block before division is not equal to high, the horizontal and vertical division cannot be performed as described above, otherwise the width or height of the divided transform block will be smaller than the preset minimum transform block size.
- the transform block may be divided in another direction (the direction in which the transform block side length is larger than the preset minimum transform block size) to obtain a smaller-sized transform block;
- the transform block is divided in the vertical direction to obtain four 0.25Mx0.25M transform blocks, as shown in FIG.
- the above process uses only the information of the transform block for judging whether the transform block needs to be divided and the size of the divided transform block.
- the transform block determines whether the transform block needs to be divided and the size of the transformed transform block based only on the transform block information and the image block division manner, or only based on the transform block information.
- the procedure described in the above steps is for explaining how to determine the size of the transform block according to the transform block width and height and the image block division manner, or only whether the transform block needs to be divided and divided according to the transform block width and height, and Explain the principle of judgment and division.
- only transform block information and image block division mode, or transform block information are needed. The following is a specific example.
- the size of the image block is 32x32, and the image block is divided into vertical division mode, that is, the image block division mode is one of Nx2N nLNx2N nRx2N, the preset maximum transformation block size is 16, and the preset minimum transformation block size is 4 .
- log2TrafoHeight and log2TrafoWidth are both 5
- the preset maximum transform block size expressed in index form is 4
- the preset minimum transform block size expressed in exponential form is 2.
- log2TrafoHe lg ht operation i ⁇ log2T rafoWidth is equivalent to ⁇ operation, 1 « log2TrafoSize is equivalent to 2 1 ⁇ 3 ⁇ 423 ⁇ 4 ⁇ : operation; "»" stands for right shift operation, ( log2TrafoHeight + log2TrafoHeight ) » 1 etc.
- the price is the same as (log2TrafoHeight + log2TrafoHeight) / 2 operation.
- log2TrafoHeight log2Trafo Width and log2TrafoSize represent the size of the transform block in exponential form. Therefore, when the transform block is divided into smaller sub-transform blocks, the change in the size of the transform block can be expressed by adding or subtracting the values of the parameters log2TrafoHeight log2Trafo Width and log2TrafoSize. For example, when the current transform block size is 16x16, the value of log2TrafoHeight is 4, the value of log2TrafoWidth is 4, and the value of log2TrafoSize is 4.
- the size becomes 16x4, and the value of log2TrafoWidth is at this time.
- the value remains unchanged at 4, the value of log2TrafoHeight becomes 2 ( 4 - 2 ), and the value of log2TrafoSize becomes 3 ( 4 - 1 , which is the average of 4 and 2).
- the width or height of the transform block is equal to the preset minimum transform block size, it is also possible to judge using the average value of the width and the height of the transform block (log2TrafoSize). Due to the above method, The width (or height) of the divided transform block is one quarter of the width (or height) of the pre-transformed block and the high (or wide) value of the transform block is unchanged, that is, the log2Trafo Width of the divided transform block.
- log2TrafoHeight is the value of log2Trafo Width or log2TrafoHeight of the pre-partition transform block minus 2 and the value of log2TrafoHeight (or log2TrafoWidth) of the transform block is unchanged. It can be seen that when the value of log2TrafoHeight is not equal to log2Trafo Width, the value of log2TrafoSize is always greater than the minimum value of log2TrafoHeight and log2Trafo Width plus 1.
- log2TrafoSize when the value of log2TrafoSize is equal to the preset minimum value of the transform block plus 1, the value of one of the log2TrafoHeight and log2Trafo Width must be equal to the preset minimum value of the transform block, and the value relationship of log2TrafoHeight and log2Trafo Width (greater than, equal to Or less than) a parameter whose value is equal to the preset minimum value of the transform block.
- the initial value of the height and width of the transform block is 5 , due to the height of the transform block ( log2TrafoHeight ) and width
- Uog2TrafoWidth is greater than the preset maximum transform block size 4 (the value of log2TrafoSize is also 5, which is greater than the preset maximum transform block size). Therefore, the transform block is divided into four sub-transform blocks each having a height and a width of four. At this time, when the divided transform block is further divided, since the height and width of the transform block are both 4 (the value of log2TrafoSize is 4) and both are equal to the preset maximum transform block size 4, and the image block is divided into Nx2N. Or nLx2N or nRx2N, the height of the divided transform block is still 4, the value of the width is reduced by 2 to 2, and the value of log2TrafoSize is 3.
- the width of the transform block 2 is equal to the preset minimum transform block size 2 (the value of log2TrafoSize is equal to the preset minimum transform block size plus 1), then the width of the divided transform block remains unchanged at 2, and the high value minus 2 becomes 2. .
- the image block is divided into horizontal division modes, that is, the image block division mode is 2NxN, 2NxnU,
- the division principle of the transform block is the same as the above method, and will not be described again.
- the size of the image block is still 32x32
- the preset maximum transform block size is 16
- the preset minimum transform block size is 4.
- the initial value of the height and width of the transform block is 5, since the height of the transform block (log2TrafoHeight) and width (log2Trafo Width) are both greater than the preset maximum transform block size 4 (the value of log2TrafoSize is also 5, greater than the default Maximum transform block size). Therefore, the transform block is divided into four sub-transform blocks each having a height and a width of four.
- the maximum value or the minimum value of the size of the transform block may also refer to the pixel information included in the transform block, and the maximum or minimum value of the size of the transform block may be transformed into a block.
- the product of width and height is expressed. . Therefore, in the step of judging whether the width or height of the transform block is equal to the minimum size (the minimum value of the size) of the preset transform block, it is also possible to judge using the product of the width and the height of the transform block.
- the width (or height) of the divided transform block is a quarter of the width (or height) of the pre-delimited transform block, and the value of the height (or width) of the transform block is unchanged, that is, after the partition
- the value of log2TrafoWidth or log2TrafoHeight of the transform block is the value of log2Trafo Width or log2TrafoHeight of the pre-division transform block minus 2 and the value of log2TrafoHeight (or log2Trafo Width) of the transform block is unchanged.
- log2TrafoHeight when the value of log2TrafoHeight is not equal to log2Trafo Width, the value of log2TrafoSize is always greater than the minimum value in log2TrafoHeight and log2TrafoWidth plus 1. Therefore, consistent with the principle described above, when the product of log2TrafoHeight and log2TrafoWidth is equal to four times the minimum value of the preset transform block, the value relationship of log2TrafoHeight and log2Trafo Width (greater than, equal to or less than) is known. Divide the direction.
- the initial value of the height and width of the transform block is 5, and the value of the largest transform block is 16x16, and the value of the smallest transform block is 4x4. Since the product of the high (log2TrafoHeight) and the width (log2Trafo Width) of the transform block is larger than the preset maximum transform block size. Therefore, the transform block is divided into four sub-transform blocks of height and width of four.
- the divided transform block is further divided, since the height and width of the transform block are both 4 (the value of log2TrafoSize is 4) and the product of the height and the width is equal to the preset maximum transform block size, and the image block is If the partitioning mode is Nx2N or nLx2N or nRx2N, the height of the divided transform block is still 4, the value of the width is reduced by 2 to 2, and the value of log2TrafoSize is 3.
- the divided transform block is further divided, because The width of the transform block is 2 and is equal to four times the preset minimum transform block size, and the width of the divided transform block remains unchanged at 2, and the high value minus 2 becomes 2.
- the image block is divided into horizontal division modes, that is, the image block division mode is 2NxN, 2NxnU,
- the division principle of the transform block is the same as the above method, and will not be described again.
- the size of the image block is still 32x32
- the preset maximum transform block size is 16x16
- the preset minimum transform block size is 4x4.
- the initial value of the height and width of the transform block is 5, since the product of the high (log2TrafoHeight) and the width (log2Trafo Width) of the transform block is larger than the preset maximum transform block size. Therefore, the transform block is divided into four sub-transform blocks each having a height and a width of four.
- the resulting transform block is When the row is further divided, since the height and width of the transform block are 4 (the value of log2TrafoSize is 4) and both are equal to the preset maximum transform block size 4, and the image block is divided into 2NxN, 2NxnU, 2NxnD,
- the transform block has a width of 4, a high value minus 2 becomes 2, and a log2TrafoSize value of 3; at this time, when the divided transform block is further divided, since the transform block has a height of 2 and is equal to a preset minimum Four times the size of the transform block, the height of the divided transform block is still 2, and the value of the width is reduced by 2.
- the width of the transformed block after division is equal to the width of the transform block before division, and the height of the transformed block after partitioning is smaller than the height of the pre-transformed block;
- the height of the transformed block after division is equal to the height of the transform block before division, and the width of the transformed block after partitioning is smaller than the width of the transform block before division;
- the width of the divided transform block is smaller than the width of the pre-partition transform block, and the height of the divided transform block is smaller than the height of the pre-partition transform block.
- the parameter interTUSplitDirection can be set to identify the relationship between the size of the divided transform block and the size of the pre-distorted transform block, thereby obtaining the size of the divided transform block. Let the value of interTUSplitDirection be 0, 1, and 2, respectively, indicating the above three cases, I, II, and III.
- interTUSplitDirection is 0 when the division of the image block and the value of the width and height of the transform block or the relationship between the width and height of the transform block satisfy one of the following conditions:
- the image block division mode is a horizontal division mode, and the width of the transformation block before division is equal to the height of the transformation block before division, and the width and height of the transformation block before division are less than or equal to the maximum size of the preset transformation block, and the division transform block is The width and height are greater than or equal to the preset minimum size of the transform block;
- the image block division manner is a horizontal division manner, the width of the transformation block before division is equal to the height of the transformation block before division, and the average value of the width and height of the transformation block before division is less than or equal to the maximum size of the preset transformation block, and An average value of the width and height of the transform block before the division is greater than or equal to a preset minimum size of the transform block; a width of the transform block before the partition is equal to a minimum value of the preset transform block, and the pre-partition The height of the transform block is greater than the width of the transform block before the partition;
- the average of the width of the transform block before the partition and the transform block before the partition is equal to the pre-
- the minimum value of the transform block is increased by 1, and the height of the transform block before the partition is larger than the width of the transform block before the partition.
- interTUSplitDirection when the division of the image block and the value of the width and height of the transform block or the relationship between the width and height of the transform block satisfy one of the following conditions:
- the image block division manner is a vertical division manner, and the width of the transformation block before the division is equal to the height of the transformation block before division, and the width and height of the transformation block before division are less than or equal to the maximum size of the preset transformation block, before division.
- the width and height of the transform block are greater than or equal to a preset minimum size of the transform block;
- the image block division manner is a vertical division manner, the width of the transformation block before division is equal to the height of the transformation block before division, and the average value of the width and height of the transformation block before division is less than or equal to the maximum size of the preset transformation block, and The average of the width and height of the transform block before the division is greater than or equal to the minimum size of the preset transform block; the height of the transform block before the partition is equal to the minimum value of the preset transform block, and the transform before the partition The width of the block is greater than the height of the transform block before the division;
- the average of the width of the transform block before the partition and the transform block before the partition is equal to the minimum value of the preset transform block plus 1 and the width of the transform block before the partition is greater than the partition The height of the previous transform block.
- an embodiment of the present invention further provides a method for obtaining a transform block size, including:
- Step 1501 Obtain a division manner of the image block
- Step 1502 Obtain size information of the divided transform block according to the division manner of the image block and the width and height of the transform block before division.
- the size information of the transform block refers to the width or height of the transform block, and other information for indicating the width or height of the transform block.
- an embodiment of the present invention further provides a method for obtaining a transform block size, including:
- Step 1601 determining a minimum value of a preset transform block maximum size and a preset transform block size
- Step 1602 determining, according to the height of the transform block before the partition, the width of the transform block before the partition, and the The minimum size of the preset transform block or the minimum size of the preset transform block obtains the size information of the divided transform block.
- the preset maximum size of the transform block may be determined before the video sequence is encoded, or may be encoded. An image is determined before it can be determined before encoding a stripe, or it can be determined before encoding an image block or encoding a prediction block or encoding a transform block.
- the preset maximum size of the transform block may be determined when the video sequence header or the sequence parameter set is decoded, or may be determined when the image header or the image parameter set is decoded, or may be determined when the supplemental enhancement information is decoded. It can also be determined when decoding an image block or a prediction block or a transform block.
- the minimum value of the size of the preset transform block may be determined before the video sequence is encoded, or may be determined before encoding an image, or may be determined before encoding a stripe, or may be encoded in an image block or coded.
- the prediction block is determined before encoding a transform block.
- the minimum value of the size of the preset transform block may be determined when decoding a video sequence header or a sequence parameter set, or may be determined when decoding an image header or an image parameter set, or may be supplemental enhancement information. It is determined that it can also be determined when decoding an image block or a prediction block or a transform block.
- the maximum or minimum value of the size of the transform block may also refer to the pixel information contained in the transform block, and the maximum or minimum value of the size of the transform block may be expressed by the product of the width and the height of the transform block.
- the method for obtaining a transform block provided by the embodiment of the present invention can encode the size of the transform block according to the partitioning mode of the image block or the height and width of the transform block before the partitioning, thereby effectively improving the coding efficiency.
- the present invention also provides a variable block size obtaining module for performing the above steps 1501 and 1502, which includes
- a dividing mode obtaining module 202 configured to obtain a dividing manner of the image block
- the size information obtaining module 204 is configured to obtain size information of the divided transform block according to the division manner of the image block and the width and height of the transform block before the division.
- an embodiment of the present invention further provides a transform block size obtaining module for performing steps 1601 and 1602, which includes:
- the preset size determining module 212 is configured to determine a minimum value of a preset transform block maximum size and a preset transform block size
- a size information obtaining module 214 configured to: according to a height of the transform block before the division, a width of the transform block before the partition, and a maximum size of the preset transform block or a minimum size of the preset transform block The size information of the divided transform block is obtained.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明提供了一种获得变换块的尺寸的方法,包括:获得图像块的划分方式;根据所述图像块的划分方式和划分前的变换块的宽和高,获得划分后的变换块的尺寸信息。采用本发明实施例提供的变换块的获得方法,可以根据图像块的划分方式,或者划分前的变换块的高和宽对变换块的尺寸进行编码,有效提高了编码的效率。
Description
一种获得变换块尺寸的方法和模块
技术领域
本发明涉及通信技术领域, 特别涉及一种获得变换块尺寸的方法和模块。 背景技术
为了尽量减少传送视频数据所需要的带宽, 可以釆用多种视频压缩方法对 视频数据进行压缩, 其中视频压缩方法包括: 帧内压缩和帧间压缩。 现在多釆 用基于运动估计的帧间压缩方法, 具体的, 图像的编码端釆用帧间压缩方法对 图像压缩并编码的过程包括: 编码端将待编码图像块划分成若干个大小相等的 子图像块, 然后针对每个子图像块, 在参考图像中搜索与当前子图像块最匹配 的图像块作为预测块, 然后将该子图像块与预测块的相应像素值相减得到残差, 并将该残差经变换与量化后得到的值进行熵编码, 最后将熵编码得到的比特流 和运动矢量信息一并发给解码端, 其中, 运动矢量信息表示当前子图像块与预 测块的位置差。 在图像的解码端, 首先获得熵编码比特流后进行熵解码, 得到 相应的残差, 及相应的运动矢量信息; 然后根据运动矢量信息在参考图像中获 得相应的匹配图像块(即上述预测块), 再根据匹配图像块中各像素点的值和残 差值中对应像素点的值相加得到当前子图像块中各像素点的值。 帧内预测是指 利用本幅图像内的信息对图像块进行预测得到预测块, 编码端根据预测模式、 预测方向、 图像块周围的像素值得到预测块对应的像素, 将图像块像素与预测 块像素相减得到残差, 残差经变换、 量化和熵编码后写入码流中; 解码端解析 码流, 对码流进行熵解码、 反量化、 反变换后得到残差块, 解码端根据预测模 式、 预测方向、 图像块周围的像素值得到预测块, 将残差块像素与预测块像素 相加得到重构图像块。
现在的视频编解码标准中存在编码单元( coding unit )、预测单元( prediction unit )和变换单元(transform unit ) 的概念。 其中, 编码单元 是在编码端或解 码端进行编码或解码时操作的图像块。 预测单元是编码单元中具有独立预测模 式的图像块。 一个预测单元中可能包含多个预测块, 预测块是编码单元进行预
测操作的图像块。 变换单元是编码单元中进行变换操作的图像块, 也可称为变 换块。 考虑到预测块内部差值信号的相关性较强, 而大块变换比小块变换能量 集中性能更高。 更广义的, 一个图像块可包含一个或多个预测块, 在编解码端 以预测块为单位进行预测; 同时, 一个图像块包含一个或多个变换块, 在编解 码端以变换块为单位进行变换。
在现有的视频编解码标准中, 如移动图像专家组(Moving Picture Experts Group, MPEG ) , H.264/AVC (Advanced Video Coding, 增强视频编码), 一个 图像块, 或称为宏块 (macroblock)、 超宏块 (super-macroblock)等, 被划分为若 干子图像块, 这些子图像块的尺寸为 16x16、 16x8、 8x16、 8x8、 8x4、 4x8、 4x4等,子图像块以这些尺寸进行上述的运动估计和运动补偿, 图像的编码端需 要将标识图像块划分方式的码字发送给图像的解码端, 以便图像的解码端获知 图像编码端的划分方式, 并根据该划分方式和运动矢量信息, 确定相应的预测 块。 在现有的视频编解码标准中这些子图像块均为 NXM(N和 M均为大于 0的 整数)的矩形块, 并且 N和 M具有倍数关系。
图像块被划分成子图像块的常用方式有: 2Nx2N划分方式, 图像块只包含 一个子图像块, 即该图像块不被划分成更小的子图像块, 如图 1 a所示; 2NxN 划分方式, 将图像块划分成上下两个等大的子图像块, 如图 1 b所示; Nx2N划 分方式, 将图像块划分成左右两个等大的子图像块, 如图 1 c所示; NxN划分方 式,将图像块划分成四个等大的子图像块,如图 1 d所示。上述 N为任意正整数。
此外, 图像块还可以釆用非对称划分方式, 如图 2a至图 2d所示。 图 2a 和 2b 所示划分方式将一个图像块划分成上下两个不等大的矩形子图像块, 图 2a所示 2NxnU划分方式(其中 n = 0.5 N ) 划分出的两个子图像块中, 上边子 图像块两条变长为 2N和 0.5N , 下边子图像块两条变长为 2N和 1.5N , 其中, 2NxnU中的 U表示图像划分线相对该图像块的垂直平分线上移, 2NxnU表示图 像划分线相对该图像块的垂直平分线上移 n, 其中, n=x*N , 其中 x大于或等于 0并小于或者等于 1 ;; 图 2b 所示 2NxnD划分方式(其中 n = 0.5 N )划分出的 两个子图像块中, 上边子图像块两条变长为 2N和 1.5N , 下边子图像块两条变 长为 2N和 0.5N , 其中, 2NxnD中的 D表示图像划分线相对该图像块的垂直平 分线下移, 2NxnD表示图像划分线相对该图像块的垂直平分线下移 n, 其中, n=x*N, 其中 X大于或等于 0并小于或者等于 1 ;。 图 2c和 2d所示划分方式将
一个图像块划分成左右两个不等大的矩形子图像块, 图 2c所示 nLx2N划分方 式(其中 n = 0.5 N; )划分出的两个子图像块中, 左边子图像块两条变长为 0.5N 和 2N , 其中, nLx2N中的 L表示图像划分线相对该图像块的垂直平分线左移, nLx2N表示表示图像划分线相对该图像块的垂直平分线左移 n, 其中, n=x*N, 其中 X大于或等于 0并小于或者等于 1 ;,右边子图像块两条变长为 1 .5N和 2N; 图 2d 所示 nRx2N划分方式(其中 n = 0.5 N; ) 划分出的两个子图像块中, 左 边子图像块两条变长为 1.5N和 2N ,右边子图像块两条变长为 0.5N和 2N , nRx2N 中的 R表示图像划分线相对该图像块的垂直平分线右移, nRx2N表示表示图像 划分线相对该图像块的垂直平分线右移 n, 其中, n=x*N, 其中 X大于或等于 0 并小于或者等于 1。
上述图像块的划分方式也可以使用预测块类型进行指代。 2Nx2N、 2NxN、 Nx2N、 2NxnU、 2NxnD、 nLx2N、 nRx2N i勾表示图像块戈' J分方式对应^;预:;则块 类型。
在上述图像块的划分方式中, 通过水平划分线将图像块或者变换块划分成 沿垂直方向排列的多个子图像块或者变换块或预测块的划分方式为水平划分方 式, 这时候釆用的划分方向为水平划分方向, 上述 2NxN划分方式、 2NxnU划 分方式、 2NxnD划分方式统称为水平划分方式; 而通过垂直划分线将图像块或 者变换块划分成沿水平方向排列的多个子图像块或者变换块或预测块的划分方 式为垂直划分方式, 这时候釆用的划分方向为垂直划分方向, 上述 Nx2N 划分 方式、 nLx2N 划分方式、 nRx2N 划分方式统称垂直划分方式。; 同时通过水平 划分线将图像块或者变换块划分成四个子图像块或变换块或预测块的划分方式 为水平和垂直划分方式, 这时候釆用的划分方向则为水平和垂直划分方向, 上 述 NxN划分方式为水平和垂直划分方式。
在现有的视频编码和解码技术中, 可以使用变换矩阵去除图像块的残差的 相关性, 即去除图像块的冗余信息, 以便提高编码效率, 图像块中的数据块的 变换通常釆用二维变换,即在编码端将数据块的残差信息分别与一个 NXM的变 换矩阵及其转置矩阵相乘, 相乘之后得到的是变换系数。 上述步骤可以使用以 下公式描述:
f = T xCxT
其中, (:代表数据块的残差信息, Γ和 Γ'代表变换矩阵和变换矩阵的转置矩
阵, /代表数据块的残差信息经变换后得到的变换系数矩阵。 其中, 变换矩阵可 以是离散余弦变换 (Discrete Cosine Transform, DCT)矩阵, 整数变换 (Integer Transform)矩阵、 KL变换 (Karhunen Loeve Transform, KLT)矩阵等。其中, KLT 可以更好的考虑图像块或图像块残差的紋理信息, 因此使用 KLT可以达到较好 的效果。 对图像块的残差信息进行上述处理相当于将图像块的残差信息从空域转换 至频域,且经处理后得到的变换系数矩阵/集中于低频区域; 编码端对图像块的 残差信息进行上述变换之后, 对变换后得到的变换系数矩阵再进行量化、 熵编 码等处理后, 将熵编码得到的比特流发送給解码端。 为了使解码端知道编码端 所釆用的变换矩阵类型和尺寸, 通常, 编码端会将表示当前图像块所使用的变 换矩阵的指示信息发送給解码端。
后续解码端根据上述指示信息确定编码端釆用的变换矩阵, 根据变换矩阵 的特点(变换矩阵的正交性等), 对编码端发送的比特流进行解码得到变换系数 矩阵, 将变换系数矩阵与变换矩阵及其转置矩阵相乘, 可恢复得到与编码端近 似一致的数据块的残差信息。 上述步骤可以使用以下公式描述:
C = Tx fxT
其中, (:代表数据块的残差信息, Γ和 Γ'代表变换矩阵和变换矩阵的转置矩 阵, /代表解码端得到的变换系数矩阵。
由于图像块的残差可能存在不同的分布规律, 使用某一特定尺寸的变换矩 阵往往达不到好的变换效果, 因此, 现有技术中会尝试对图像块的残差使用不 同尺寸的变换矩阵(也称为变换块); 因此, 对于一个 2Νχ2Ν 的图像块可以使 用尺寸为 2Νχ2Ν的变换矩阵, 也可以使用尺寸为 ΝχΝ的变换矩阵、 或尺寸为 0.5ΝΧ0.5Ν的变换矩阵。 为了有效地表示图像块如何使用不同尺寸的变换矩阵, 可以使用树形标识方法。 如图 3所示, 当标识图像块使用的变换尺寸时, 码流 中第一层有用于标识图像块是否使用尺寸为 2ΝΧ2Ν变换矩阵的指示位, 如果图 像块使用尺寸为 2Νχ2Ν变换矩阵(如图 3a所示 ), 则该指示位为 0; 如果图像 块不使用 2Nx2N变换时, 则该指示位为 1 , 表示需要将尺寸为 2Nx2N变换矩 阵进一步划分成四个尺寸为 NxN的变换矩阵, 并在码流第二层结构中用 4个比
特分别标识每一个尺寸为 NxN的变换矩阵是否进一步划分; 如果图像块使用如 图 3b所示的变换结构时, 4个比特都为 0, 表示每一个尺寸为 NxN的变换矩阵 不再进一步划分; 当选用如图 3c所示的变换结构时, 则 4个比特中有 2个比特 为 0, 2个比特为 1 , 2个比特为 0表示对左下和右上的尺寸为 NxN的变换矩阵 不再进行划分; 2个比特为 1表示需要对左上和右下的尺寸为 NxN的变换矩阵 需要进一步划分, 得到尺寸为 0.5NX0.5N的变换矩阵; 然后在码流第三层结构 中用 4个比特表示是否需要对左上的尺寸为 0.5NX0.5N的变换矩阵进行进一步 划分, 用 4个比特表示是否需要对右下的尺寸为 0.5NX0.5N的变换矩阵进行进 一步划分, 如果图像块使用如图 3c所示的变换结构时, 上述 4 + 4个比特都为 0, 表示不再进一步划分。 通过上述在码流中逐层标识可以有效的及灵活的表示 出图像块和子图像块使用的变换尺寸。
现有技术中使用逐层标识的上述方法中, 变换矩阵的尺寸并没有与预测块 的尺寸关联。 如图 4a)所示, 当 2Nx2N图像块使用非对称划分(划分线如图中粗 实线所示)时, 如果当前图像块使用尺寸为 2NX2N变换矩阵, 则变换矩阵会跨 过预测块边界; 如果当前图像块使用四个尺寸为 NxN的变换矩阵, 则变换矩阵 仍会跨过预测块边界; 如果当前图像块的左下和右上釆用尺寸为 NxN的变换矩 阵, 且当前图像块的左上和右下釆用尺寸为 0.5NX0.5N的变换矩阵时, 当前图 像块的左下的尺寸为 NxN的变换矩阵仍然会跨过预测块边界。
现有技术具有如下缺点:
现有技术中变换矩阵的尺寸并没有与预测块的尺寸关联, 导致变换矩阵会 跨过预测块边界。 由于两个预测块边界对应的残差数据会存在跳跃性的变换, 所以如果变换矩阵跨过了两个预测块的边界则会使变换的作用减弱, 不能有效 的去除图像块的残差的相关性, 不能有效的去除图像块的冗余信息, 降低编码 效率。 发明内容
本发明提供一种获得变换块的尺寸的方法, 包括: 获得图像块的划分方式; 根据所述图像块的划分方式和划分前的变换块的宽和高, 获得划分后的变换块 的尺寸信息。
本发明还提供另一种获得变换块尺寸的方法, 其包括: 获得划分前的变换 块的高和宽; 根据所述划分前的变换块的高、 所述划分前的变换块的宽, 以及 预设的变换块最大尺寸或预设的变换块的尺寸的最小值获得划分后的变换块的 尺寸信息。
本发明还相应的提供了用于执行上述方法的模块。
釆用本发明提供的变换块的获得方法和模块, 可以进根据图像块的划分方 式, 或者划分前的变换块的高和宽对变换块的尺寸进行编码, 有效提高了编码 的效率。 附图说明
为了更清楚地说明本发明实施例的技术方案, 下面将对实施例中所需要使 用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些 实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可 以根据这些附图获得其他的附图。
图 1 a表示划分方式为 2Nx2N的示意图;
图 1 b表示划分方式为 2NxN的示意图;
图 1 c表示划分方式为 Nx2N的示意图;
图 1 d表示划分方式为 NxN的示意图;
图 2a表示划分方式为 2NxnU的示意图;
图 2b表示划分方式为 2NxnD的示意图;
图 2c表示划分方式为 nLx2N的示意图;
图 2d表示划分方式为 nRx2N的示意图;
图 3a表示图像块使用尺寸为 2Nx2N变换块的示意图;
图 3b表示图像块使用 4个尺寸为 NxN变换块的示意图;
图 3c表示图像块使用尺寸为 NxN变换块和尺寸为 0.5NX0.5N的变换块的示 意图;
图 4a表示非对称划分时图像块使用尺寸为 2Nx2N变换块的示意图; 图 4b表示非对称划分时图像块使用 4个尺寸为 NxN变换块的示意图; 图 4c表示非对称划分时图像块使用尺寸为 NxN变换块和尺寸为 0.5NX0.5N 的变换块的示意图;
图 5是本发明实施例一提供的一种图像编码方法流程图;
图 6是本发明实施例二提供的一种图像编码方法流程图;
图 6a表示图像块使用尺寸为 Nx2N变换块的示意图;
图 6b表示图像块使用尺寸为 0.5Nx2N变换块的示意图;
图 6c表示图像块使用尺寸为 Nx2N和 NxN变换块的示意图;
图 6d表示图像块使用尺寸为 0.5X2N和 0.5NX0.5N变换块的示意图; 图 7是本发明实施例三提供的一种图像编码方法流程图;
图 7a表示图像块使用尺寸为 2Nx2N变换块的示意图;
图 7b表示图像块使用尺寸为 0.5Nx2N变换块的示意图;
图 7c表示图像块使用尺寸为 0.5NX2N和 0.5NX0.5N变换块的示意图; 图 8是本发明实施例五提供的一种图像编码方法流程图;
图 8a表示两个预测块对应 Nx2 N变换块的示意图;
图 8b表示左边预测块对应 Nx2N变换块、 右边预测块对应 NxN变换块的示意 图;
图 8c表示左边预测块对应 Nx2N变换块、 右边预测块对应 0.5X0.5N变换块的 示意图;
图 9是本发明实施例六提供的一种图像解码方法流程图;
图 10是本发明实施例七提供的一种图像解码方法流程图;
图 11是本发明实施例八提供的一种图像解码方法流程图;
图 12是本发明一实施例提供的图像编码设备结构图;
图 13是本发明一实施例提供的图像解码设备结构图。
图 14-图 17是本发明实施例提供的变换块划分的示意图。
图 18是本发明实施例提供的变换块尺寸的获得方法。
图 19是本发明又一实施例提供的变换块尺寸的获得方法。
图 20和 21是本发明实施例提供的变化块尺寸获得模块的示意图。 具体实施方式
实施例一:
参阅图 5 , 本发明实施例提供一种图像编码方法, 该方法具体包括: 501、 根据图像块的划分方式, 确定所述图像块所使用的预测块。
其中, 该实施例的各步骤可以由图像编码设备执行。
其中,图像块的划分方式可以分为: nLx2N的划分方式和 2NxnL的划分方式。 其中, nLx2N的划分方式属于垂直划分, 比如, 将图像块划分成 0.5NX2N的子图 像块和 1 .5NX2N的子图像块; 其中, 2NxnL的划分方式属于水平划分, 比如将图 像块划分成 2NX0.5N的子图像块和 2NX1 .5N的子图像块。其中, 该步骤中根据图 像块的划分方式, 确定所述图像块所使用的预测块具体包括: 根据图像块的划 分方式, 确定所述图像块所使用的预测块的尺寸。 其中, 预测块的尺寸与所划 分成的子图像块的尺寸相同。
502、 确定所述图像块或预测块对应的变换块在所述图像块或预测块中对应 的划分层数; 其中, 所述图像块或预测块对应的变换块包括一个或者多个变换 块。
其中, 本发明各实施例中, 所述图像块对应的变换块是该图像块所釆用的 变换块; 所述预测块对应的变换块是: 与所述预测块尺寸匹配的子图像块所釆 用的变换块。 其中, 所述图像块或预测块对应的变换块在所述图像块或预测块 中对应的划分层数为所述图像块或预测块对应的变换块在所述图像块或预测块 中使用的划分层数。
503、 根据图像块的划分方式和所述划分层数确定所述图像块或预测块对应 的变换块的尺寸。 其中, 所述划分层数是所述图像块或预测块对应的变换块所 对应的划分层数。
其中, 当所述图像块(或预测块)对应的至少一个变换块在所述图像块(或 预测块) 中对应的划分层数是第 N+1划分层时, 所述至少一个变换块的水平尺 寸小于第 N划分层对应的变换块的水平尺寸; 和 /或所述至少一个变换块的垂直 尺寸小于第 N划分层对应的变换块的垂直尺寸。
其中,所述至少一个变换块的水平尺寸小于第 N划分层对应的变换块的水平 尺寸具体为:所述至少一个变换块的水平尺寸为第 N划分层对应的变换块的水平 尺寸的 其中, 1¾大于或者等于 2; 其中, 所述至少一个变换块的垂直尺寸 小于第 Ν划分层对应的变换块的垂直尺寸具体为:所述至少一个变换块的垂直尺 寸为第 Ν划分层对应的变换块的垂直尺寸的 l/m2, 其中, m2大于或者等于 2。 其 中, m^om2可以相等, 也可以不相等。
504、 确定标识所述图像块或预测块对应的变换块所对应的划分层数的标识
信息。
具体的, 当所述图像块或预测块对应的一个变换块在所述图像块或预测块 中对应的划分层数为第 1划分层, 所述标识所述图像块或预测块对应的该变换 块所对应的划分层数的标识信息包括: 标识对第 1 划分层的变换块不进一步划 分的标志位; 当所述图像块或预测块对应的一个变换块在所述图像块或者预测 块中对应的划分层数为第 2 划分层时, 所述标识所述图像块或预测块对应的该 变换块所对应的划分层数的标识信息包括: 标识对第 1 划分层的变换块进一步 划分的标志位, 其中, 所述图像块或预测块对应的该变换块是所述第 1 划分层 的变换块进一步划分得到的变换块; 当所述图像块或预测块对应的一个变换块 在所述图像块或者预测块中对应的划分层数为第 3 划分层时, 所述标识所述图 像块或预测块对应的该变换块所对应的划分层数的标识信息包括: 标识对第 1 划分层的变换块进一步划分的标志位, 和, 标识对第 2 划分层的变换块进一步 划分的标志位, 其中, 所述图像块或预测块对应的该变换块是所述第 2 划分层 的变换块进一步划分得到的变换块, 第 2划分层的变换块是对所述第 1 划分层 的变换块进一步划分得到的变换块。
505、 将所述标识信息写入码流。
可选的, 在一种实施方式中:
步骤 502中可以是确定所述预测块对应的变换块在所述预测块中对应的划 分层数; 步骤 503可以是根据图像块的划分方式和所确定的划分层数确定所述预 测块对应的变换块的尺寸, 该步骤具体的实现方式参见后续图 6所示实施例的详 细描述, 在此不再赘述。 需要说明的是, 当所确定的所述预测块对应的变换块 在所述预测块中对应的划分层数为第一划分层时, 该变换块的尺寸是最 d、预测 块的尺寸。步骤 504可以是确定标识所述预测块对应的变换块对应的划分层数的 标识信息; 步骤 504可以是将标识所述预测块对应的变换块对应的划分层数的标 识信息写入码流。 其中, 当所述预测块对应的至少一个变换块在预测块中对应 的划分层数为第 N划分层时,确定标识所述预测块对应的所述至少一个变换块对 应的划分层数的标识信息包括:标识对对应所述第 N划分层的所述至少一个变换 块不进一步划分的标志位; 当所述预测块对应的至少一个变换块在所述预测块 中对应的划分层数大于第 N划分层时,确定标识所述预测块对应的所述至少一个 变换块所对应的划分层数的标识信息包括:对第 N划分层对应的一个变换块进一
步划分的标志位, 其中, 所述第 N划分层对应的一个变换块是所述至少一个变换 块的上一级变换块。 其中, N为大于 1的整数, 比如可以为 1、 2、 3、 4、 5等。 其 中, 当所述预测块对应的变换块在所述预测块中对应的划分层数为特定划分层 时, 根据图像块的划分方式和所述特定划分层确定的所述变换块的尺寸是最小 预测块的尺寸, 其中, 所述最小预测块为所确定的图像块的预测块中尺寸最小 的预测块。 其中, 特定划分层可以为第一划分层。
可选的, 在另一种实施方式中:
步骤 502中是确定所述图像块对应的变换块在所述图像块中对应的划分层 数; 步骤 503可以是根据图像块的划分方式和所确定的述划分层数确定所述图像 块对应的变换块的尺寸; 该步骤具体的实现方式参见后续图 7所示实施例的详细 描述, 在此不再赘述。 需要说明的是: 当所确定的所述图像块对应的变换块在 所述图像块中对应的划分层数为第一划分层时, 根据图像块的划分方式和所确 定的划分层数确定的变换块的尺寸是所述图像块的尺寸; 当所确定的所述图像 块对应的变换块在所述图像块中对应的划分层数为第二划分层时, 根据图像块 的划分方式和所确定的划分层数确定的变换块的尺寸是最小预测块的尺寸。 步 骤 504可以是确定标识所述图像块对应的变换块对应的划分层数的标识信息; 步 骤 504可以是将标识所述图像块对应的变换块对应的划分层数的标识信息写入 码流。 其中, 当所述图像块对应的至少一个变换块在图像块中对应的划分层数 为第 N划分层时 ,确定标识所述图像块对应的所述至少一个变换块对应的划分层 数的标识信息包括:标识对所述第 N划分层的所述至少一个变换块不进一步划分 的标志位; 当所述图像块对应的至少一个变换块在所述图像块中对应的划分层 数大于第 N划分层时,确定标识所述图像块对应的所述至少一个变换块所对应的 划分层数的标识信息包括: 对第 N划分层对应的一个变换块进一步划分的标志 位, 其中, N为大于 1的整数, 比如可以为 1、 2、 3、 4、 5等。 其中, 所述第 N划 分层对应的一个变换块是所述至少一个变换块的上一级变换块。 其中, 当所述 图像块对应的变换块在所述图像块中对应的划分层数为第一特定划分层时, 根 据图像块的划分方式和第一特定划分层确定的所述变换块的尺寸是所述图像块 的尺寸; 当所述图像块对应的变换块在所述图像块中对应的划分层数为第二特 定划分层时, 根据图像块的划分方式和所述第二特定划分层确定所述变换块的 尺寸是最小预测块的尺寸, 其中, 所述最小预测块为所确定的图像块的预测块
中尺寸最小的预测块。 其中, 第二特定划分层是第一特定划分层的下一级划分 层数, 其中, 第一特定划分层数可以是第一划分层, 第二特定划分层可以是第 二划分层。
其中, 所述最小预测块为所确定的图像块所使用的预测块中尺寸最小的预 测块, 即最小预测块为图像块所使用的预测块中水平尺寸和 /或垂直尺寸最小的 预测块。
本发明实施例在确定变换块尺寸的时候考虑了图像块的划分方式, 并将标 识所述图像块或预测块对应的变换块对应的划分层数的标识信息写入码流, 以 便使用逐层标识的方法标识变换块的尺寸, 既保证了变换块不会跨过预测块的 边界, 同时又有效的标识了变换块的尺寸, 有效的提高了编码效率。
实施例二:
为了使本发明提供的上述技术方案更加清楚,如下两个实施例对本发明上述 技术方案进行详细介绍:
参阅图 6 , 本发明实施例提供一种图像编码方法, 该方法确定图像块釆用的 变换块所在的划分层次和图像块釆用的变换块的具体尺寸, 该方法具体包括:
601、 图像编码设备根据图像块的划分方式, 在参考图像中查找预测块, 所 述预测块是与该图像块所划分成的子图像块尺寸匹配的图像块。
其中,本发明各实施例中的尺寸匹配可以是尺寸相同,或者尺寸相差在预定 范围内。
602、 图像编码设备根据所划分成的子图像块和相应的预测块, 获得残差和 运动矢量信息。
其中, 残差为所划分成的子图像块与预测块相应像素点的像素值的差值; 比如, 所划分成的子图像块与预测块相应像素点的亮度值的差值, 或者所划分 成的子图像块与预测块相应像素点的色度值的差值。 其中, 运动矢量信息表示 所划分成的子图像块与预测块的位置差。
603、 图像编码设备确定图像块釆用的变换块在图像块中对应的划分层数。 其中, 第一划分层对应的变换块的尺寸为最小预测块的尺寸。
在视频编码方法中, 当图像编码设备存在多种实现方法时通常会釆用遍历 的方法获得最优的编码方式。 即, 本发明各描述图像编码的实施例中, 图像编 码设备可以遍历各种可以使用的划分层数, 确定使用哪种划分层数能够使变换
的效果最好, 其中, 第一划分层对应的变换块的尺寸为最小预测块的尺寸。
604、图像编码设备根据图像块的划分方式和所确定的划分层数确定所述图 像块釆用的变换块的尺寸。
比如, 当图像块对应的划分方式为 Nx2N划分时, 图像块被划分成两个大小 为 Nx2N子图像块, 此时, 预测块的大小为 Nx2N。 此时, 如图 6a所示, 如果在 步骤 603 中确定图像块釆用第一划分层就能够使变换的效果很好, 根据该图像 块划分方式决定在逐层标识变换尺寸的方法中第一划分层对应的变换的尺寸为 Nx2N , 即图像块被划分成两个 Nx2N的数据块, 每个块分别使用 Nx2N的变换块。 如图 5c所示, 当图像块的第二个尺寸为 Nx2N的数据块需要使用进一步划分的 变换块时, 即需要使用第二划分层的变化块时, 根据图像块划分方式和划分层 数确定这个 Nx2N的变换块进一步划分所得到的变换块的尺寸, 即对第一划分层 的变换块(即尺寸为 Nx2N的变换块)进一步划分得到的第二划分层的变换块的 尺寸, 此时, 下一层变换块对应的水平尺寸与当前层对应的变换块的水平尺寸 相同, 并且下一层变换块对应的垂直尺寸为当前层对应的变换块的垂直尺寸的 一半, 即此时变换块的尺寸为 NxN , 该处下一层变换块为第二划分层, 当前层为 第一划分层。
再如, 如图 6b所示, 当图像块釆用的划分方式为 nLx2N划分时, 假定图像 块被划分成两个大小分别为 0. 5Nx2N和 1. 5Nx2N的子图像块, 此时这两个子图 像块分别对应的预测块大小为 0. 5Nx2N和 1. 5Nx2N。 此时, 如果确定图像块釆用 第一划分层的变换块就能够使变换的效果很好, 则根据图像块划分方式决定在 逐层标识变换尺寸的方法中第一划分层对应的变换的尺寸与上述预测块中最小 的预测块尺寸一致,即变换块的尺寸为 0. 5Nx2N ,即图像块被划分成四个 0. 5x2N 数据块, 每个数据块分别使用 0. 5x2N的变换。 nLx2N划分方式釆用的变换结构 与 nLx2N—致。 此时, 可以保证变换的尺寸不超过预测块, 即变换不会跨过预 测块的边界, 从而保证变换的效率。 如果确定图像块釆用第一划分层的变换块 就能够使变换的效果很好。 又如图 6d所示, 当图像块的第二个尺寸为 0. 5Nx2N 数据块需要使用进一步划分的变换块时, 即需要使用第二划分层的变换块时, 根据图像块划分方式和划分层数确定这个 0. 5Nx2N 的变换块进一步划分所得到 的变换块的尺寸, 即对第一划分层的变换块(即尺寸为 0. 5Nx2N 的变换块)进
一步划分得到的第二划分层的变换块的尺寸, 此时, 下一层变换块对应的水平 尺寸与当前层对应的变换块的水平尺寸相同, 并且下一层变换块对应的垂直尺 寸为当前层对应的变换块的垂直尺寸的一半, 此时变换块的尺寸为 0. 5NxO. 5N, 该处下一层变换块为第二划分层, 当前层为第一划分层。 其它不釆用进一步划 分的变换块的数据块则仍釆用 0. 5Nx2N变换。
当图像块釆用水平划分方式将图像块沿水平方向划分成两个或多个子图像 块时, 如 2NxN、 2NxnU、 2NxnD、 Nx2N、 nRxN, 图像块确定釆用变换结构的方式 与前述相同。
在上述编码过程中, 可以预定某个划分方式下允许的划分层数, 或者预定 的某个划分方式下允许的最小变换尺寸时, 其中, 某个划分方式下允许的划分 层数即是该划分方式下最多可使用的划分层数, 该最多可使用的划分层数可在 编解码系统中预先设定, 比如图像编码设备和图像解码设备预先设定最多可使 用两层划分; 或者, 图像编码设备也可以在码流中写入标识最多可使用的划分 层数的指示信息, 以便通知图像解码设备该最多可使用的划分层数; 其中, 某 个划分方式下允许的最小变换尺寸是该划分方式下允许的最高划分层数所对应 的变换块尺寸, 即在图像编码设备和图像解码设备中设定最小变换块尺寸, 如 在图像编码设备和图像解码设备中预先设定 Nx2N图像块划分模式允许的最小变 换块尺寸为 NxN , 预先设定 nLx2N 图像块划分模式允许的最小变换块尺寸为 0. 5NxO. 5N; 或者, 图像编码设备在码流中写入标识允许的最小变换块尺寸的指 示信息, 以便通知图像解码设备允许使用的最小变换块尺寸, 如在码流中写入 标识 Nx2N图像块划分模式允许的最小变换块尺寸为 NxN的指示信息, 在码流中 写入标识 nLx2N图像块划分模式允许的最小变换块尺寸为 0. 5NxO. 5N的指示信 息。
605、图像编码设备确定标识图像块釆用的变换块所对应的划分层数的标识 信息。
具体的, 对于图 6a, 确定标识图像块对应的变换块所对应的划分层数的标 识信息包括: 2个比特位, 比特位的值为均第一特定值, 比如 1 , 用于表示对第 一划分层对应的 Nx2N变换块不再进一步划分; 对于图 6 C, 确定标识图像块对 应的变换块所对应的划分层数的标识信息包括: 2 个比特位, 对应左边的 Nx2N
块的比特位的值为第一特定值, 比如 1 , 用于表示对该第一划分层对应的 Nx2N 变换块不再进一步划分,对应右边的 Nx2N块的比特位的值为二特定值, 比如 0 , 用于表示对该第一划分层对应的 Nx2N变换块需要进一步划分。
具体的, 如图 6b所示, 确定标识图像块对应的变换块所对应的划分层数的 标识信息包括: 4个比特位, 比特位的值为均第一特定值, 比如 1 , 用于表示对 第一划分层对应的 0.5Nx2N变换块不再进一步划分; 对于图 6 d , 确定标识图像 块对应的变换块所对应的划分层数的标识信息包括: 4个比特位, 对应第 1、 3、 4个 0.5Nx2N变换块的比特位的值为第一特定值,比如 1 ,用于表示对这 3个 0.5Nx 2N变换块不再进一步划分, 对应第 2个 0.5Nx2N变换块的比特位的值为第二特 定值, 比如 0 , 用于表示对这个 0.5Nx 2N变换块需要进一步划分。
606、 图像编码设备将图像块的残差釆用相应的变换块进行变换, 然后进行 量化, 将量化后的值进行编码。
607、图像编码设备将标识预测块对应的变换块所对应的划分层数的标识信 息、 步骤 606的编码结果和表示图像块划分方式的指示信息写入码流, 发送码 流。
本发明上述实施例在确定图像块釆用的变换块尺寸的时候考虑了图像块的 划分方式, 并将标识图像块釆用的变换块所在的划分层数的标识信息写入码流, 以便使用逐层标识的方法标识变换块的尺寸, 既保证了变换块不会跨过预测块 的边界, 同时又有效的标识了变换块的尺寸, 有效的提高了编码效率。
实施例三:
参阅图 7 , 本发明实施例提供另一种图像编码方法, 该实施例考虑到当图像 块划分成的两个子图像块做预测时得到的残差值较小时这两个子图像块的边界 的跳跃现象不明显, 此时图像釆用的变换块跨过子图像块的边界也不会明显导 致变换效率变差, 并且由于用于标识更大尺寸的变换所需的编码比特数少于用 于标识小尺寸的变换, 故此时图像块釆用更大尺寸的变换效果可能会更好。 本 实施例利用逐层标识的方法将大尺寸变换和小尺寸变换相结合, 该实施例具体 包括:
步骤 701-702与步骤 601-602相同, 在此不再赘述。
703、 图像编码设备确定图像块釆用的变换块在图像块中对应的划分层数。 该步骤的具体实现方式与步骤 603相似, 不同之处在于: 第一划分层对应
的变换块的尺寸为该图像块的尺寸, 即 2N x2N; 第二划分层对应的变换块的尺 寸为最小预测块的尺寸。
704、图像编码设备根据图像块的划分方式和所确定的划分层数确定所述图 像块釆用的变换块的尺寸。
其中, 具体的根据图像块的划分方式和所确定的划分层数确定所述图像块 釆用的变换块的尺寸与步骤 604相似, 所不同之处在于: 该实施例中第一划分层 对应的变换块的尺寸为 2Nx2N , 该实施例中第二划分层对应的变换块的尺寸相当 于上述实施例中第一划分层对应的变换块的尺寸; 该实施例中第三划分层对应 的变换块的尺寸相当于上述实施例中第二划分层对应的变换块的尺寸, 以此类 推。
比如, 当图像块釆用 nLx2N的划分方式时, 如图 7a所示, 如果在步骤 703中 确定釆用 2Nx2N的变换块就能够使变换的效果很好, 此时图像块第一划分层对应 的变换块尺寸为 2Nx2N , 此时变换块可跨过子图像块边界; 当图像编码设备确定 釆用第二划分层的变换块时, 根据图像块的划分方式和划分层数确定图像块使 用的第二划分层的变换块的尺寸为 0. 5Nx2N , 此时图像块划分成四个 0. 5Nx2N数 据块, 每个块分别使用 0. 5Nx2N的变换块, 如图 6b所示。 如图 6c所示, 当第一个 和第四个 0. 5x2N的数据块需要使用进一步划分的变换块时, 则此时根据图像块 划分方式和所在的划分层数确定这两个 0. 5Nx2N变换块被进一步划分所得到的 变换块的水平尺寸与第二划分层对应的变换块水平尺寸一致、 垂直尺寸为第二 划分层对应的变换块垂直垂直的四分之一, 此时, 第一个和第四个 0. 5x2N的数 据块被划分成 4个 0. 5NxO. 5N块, 每个块分别使用 0. 5NxO. 5N变换块。
705、图像编码设备确定标识图像块釆用的变换块所在的划分层数的标识信 息。
具体的, 对于图 7a, 确定标识预测块对应的各变换块对应的划分层数的标 识信息包括 1个比特位, 其值为第一特定值, 比如 1 , 用于表示对第一划分层对 应的变换块(即 2Nx2N 变换块) 不再进一步划分; 对图 7b , 标识预测块对应 的各变换块对应的划分层数的标识信息包括两层指示信息, 第一层的指示信息 包括 1个比特位, 其值为第二特定值, 比如 0 , 用于表示对第一划分层对应的变 换块(即 2Nx2N变换块)需要进一步划分, 得到 4个第二划分层的变换块; 第 二层的指示信息包括 4个比特位,其值分别为 1 ,表示对 4个第二划分层的变换
块不需要进一步划分; 对于图 7c, 标识预测块对应的各变换块对应的划分层数 的标识信息至少包括两层指示信息, 第一层的指示信息包括 1 个比特位, 其值 为第二特定值, 比如 0, 用于表示对第一划分层对应的变换块(即 2Nx2N变换 块)需要进一步划分, 得到 4个第二划分层的变换块(即 0.5NX2N变换块); 第二层的指示信息包括 4个比特位, 第 2、 3比特位的值为 1 , 表示不需要对图 中中间的两个变换块进一步划分; 第 1、 4比特位的值为 0 , 表示需要对图中两 边的两个变换块进一步划分, 得到 4个第三划分层的变换块(即 0.5Nx0.5N变 换块)。 此时, 当预定的 nLx2N图像块划分方式下允许的划分层数为 3 , 或者, 预定的 nLx2N图像块划分方式下允许的最小变换块尺寸为 0. 5NxO. 5N时, 则标 识预测块对应的变换块对应的划分层数的标识信息只包括两层指示信息就可以 了, 否则, 该标识信息还包括第三层的指示信息, 第三层的指示信息用于表示 4个第三划分层的变换块是否还需要进一步划分。
706、 图像编码设备将图像块的残差釆用相应的变换块进行变换, 然后进行 量化, 将量化后的值进行编码。
707、 图像编码设备将标识图像块釆用的变换块所在的划分层数的标识信 息、 步骤 706的编码结果、 表示图像块划分方式的指示信息写入码流, 并发送码 流。
本发明上述实施例在确定图像块釆用的变换块尺寸的时候考虑了图像块的 划分方式, 并将标识图像块釆用的变换块所在的划分层数的标识信息写入码流, 以便使用逐层标识的方法标识变换块的尺寸, 既保证了变换块不会跨过预测块 的边界, 同时又有效的标识了变换块的尺寸, 有效的提高了编码效率。
实施例四:
如下具体描述根据图像块划分方式与图像块或者预测块对应的变换块所对 应的划分层数通过查表方式获得对应的变换块的尺寸:
第一种方式: 利用预置的图像块划分方式、 划分层数两者与变换块尺寸的 对应关系, 确定该图像块的划分方式和划分层数所对应的变换块尺寸。 其中, 划分层数是图像块或者预测块对应的变换块所对应的划分层数, 如下表 1 示出 了图像块划分方式、 划分层数两者与变换块尺寸的对应关系。
划分层数 Nx2N图像块划分模式 nLx2N图像块划分模式 第一层 Nx2N 0. 5Nx2N
第二层 NxN 0. 5NxO. 5N
表 1
第二种方式: 利用预置的图像块划分方式、 划分层数两者与第一类尺寸比 值的对应关系, 确定图像块的划分方式和划分层数所对应的第一类尺寸比值, 其中, 划分层数是图像块或者预测块对应的变换块所对应的划分层数, 然后根 据所确定的第一类尺寸比值和图像块的尺寸, 确定图像块或者预测块对应的变 换块的尺寸, 其中, 第一类尺寸比值包括: 图像块或者预测块对应的变换块的 水平尺寸与图像块的水平尺寸的比值和图像块或者预测块对应的变换块的垂直 尺寸与图像块的垂直尺寸的比值, 其中, 如下表 2 示出了图像块划分方式、 划 分层数两者与变换块的水平尺寸与图像块的水平尺寸的比值的对应关系, 如下 表 3 示出了图像块划分方式、 划分层数两者与变换块的垂直尺寸与图像块的垂 直尺寸的比值的对应关系。
表 3
第三种方式: 利用预置的图像块划分方式、 划分层数两者与第二类尺寸比 值的对应关系, 确定图像块的划分方式和划分层数所对应的第二类尺寸比值, 其中, 划分层数是图像块或者预测块对应的变换块所对应的划分层数, 然后根 据所确定的第二类尺寸比值和预测块的尺寸, 确定该图像块或者预测块对应的
变换块的尺寸; 其中, 第二类尺寸比值包括: 图像块或者预测块对应的变换块 的水平尺寸与预测块的水平尺寸的比值和图像块或者预测块对应的变换块的垂 直尺寸与预测块的垂直尺寸的比值; 在一种具体的实施方式中, 其中, 第二类 尺寸比值具体可以包括: 图像块或者预测块对应的变换块的水平尺寸与最小预 测块的水平尺寸的比值和图像块或者预测块对应的变换块的垂直尺寸与最小预 测块的垂直尺寸的比值; 然后根据所确定的第二类尺寸比值和最小预测块的尺 寸, 确定该图像块或者预测块对应的变换块的尺寸。 其中, 表 4 示出了图像块 划分方式、 划分层数两者与变换块的水平尺寸与最小预测块的水平尺寸的比值 的对应关系, 表 5 示出了图像块划分方式、 划分层数两者与变换块的垂直尺寸 与最小预测块的垂直尺寸的比值的对应关系。
需要说明的是, 该实施例所提供的上述获得变换块的尺寸可以应用于其他 各实施例中, 即其他各实施例中获得变换块的尺寸步骤的执行过程都可以釆用 本实施例所提供的技术方案。
实施例五:
本发明如下实施例提供另一种图像编码方法, 其与上述两个实施例不同之 处主要在于: 该实施例是与预测块为单位使用逐层标识方法的。
步骤 801-802与步骤 601-602相同, 在此不再赘述。
803、 图像编码设备确定预测块对应的变换块在预测块中对应的划分层数。 其中, 第一划分层次对应的变换块的尺寸为最小预测块的尺寸。
该步骤的具体实现方式与步骤 603相似, 在比不再赘述。
804、 图像编码设备根据图像块的划分方式和所确定的划分层数确定预测块 对应的变换块的尺寸。
比如, 当图像块对应的划分方式为 Nx2N划分时, 图像块被划分成两个大小 为 Nx2N子图像块, 此时, 预测块的大小为 Nx2N。 此时, 如图 8a所示, 两个预测 块对应变换块均为第一划分层的变换块, 两个预测块釆用的变换块尺寸为 Nx 2N , 后续针对两个预测块分别设置划分标志标识使用第一划分层; 如图 8b所示, 此 时图像块左边的预测块对应的变换块的划分层仍为第一划分层, 右边的预测块 对应的变换块的划分层为第二划分层, 因此左边预测块使用的变换块尺寸仍为 Nx2N , 右边预测块使用的变换块尺寸根据划分层数(第二划分层)及图像块划 分方式(Nx2N )确定为 NxN , 后续分别设置左边和右边预测块的划分标志, 分别 用于标识左边预测块使用第一层划分, 右边预测块使用第二划分层; 如图 8c所 示, 此时图像块左边的预测块对应的变换块的划分层仍为第一划分层, 右边的 预测块对应的变换块的划分层为第三划分层, 因此左边预测块使用的变换块尺 寸仍为 Nx2N , 右边预测块使用的变换块尺寸根据划分层数(第三划分层)及图 像块划分方式(Nx2N )确定为 0. 5NxO. 5N , 分别设置左边和右边预测块的划分标 志, 分别用于标识左边预测块使用第一层划分, 右边预测块使用第三层划分。
805、图像编码设备确定标识预测块对应的变换块所对应的划分层数的标识 信息。
如图 8a所示, 确定标识左边预测块对应的变换块所对应的划分层数的标识 信息包括: 1个比特位, 比特位的值为第一特定值, 比如 1 , 用于表示对第一划 分层对应的 Nx2N变换块不再进一步划分; 确定标识右边预测块对应的变换块所 对应的划分层数的标识信息包括: 1个比特位, 比特位的值为第一特定值, 用于 表示对第一划分层对应的 Nx2N变换块不再进一步划分; 如图 8b所示, 其标识左 边预测块对应的变换块所对应的划分层数的标识信息与图 8a相同, 确定标识右 边预测块对应的变换块所对应的划分层数的标识信息包括: 1个比特位, 比特位 的值为第二特定值, 用于表示对第一划分层对应的 Nx2N变换块进一步划分; 如 图 8c所示, 其标识左边预测块对应的变换块所对应的划分层数的标识信息与图 8a相同, 确定标识右边预测块对应的变换块所对应的划分层数的标识信息包括: 两层指示信息, 第一层指示信息包括: 1个比特位, 比特位的值为第二特定值, 用于表示对第一划分层对应的 Nx2N变换块进一步划分, 得到 2个第二划分层的变
换块(尺寸为 NxN ); 第二层指示信息包括: 2个比特位, 用于表示 2个第二划分 层的变换块进一步划分, 这样就可以表示右边预测块使用得到第三划分层的变 换块。
806、 图像编码设备将图像块的残差釆用相应的变换块进行变换, 然后进行 量化, 将量化后的值进行编码。
807、 图像编码设备将标识预测块对应的变换块所在的划分层数的标识信 息、 步骤 806的编码结果、 表示图像块划分方式的指示信息写入码流, 并发送码 流。
本发明上述实施例在确定预测块对应的变换块尺寸的时候考虑了图像块的 划分方式, 并将标识预测块对应的变换块所在的划分层数的标识信息写入码流, 以便使用逐层标识的方法标识变换块的尺寸, 既保证了变换块不会跨过预测块 的边界, 同时又有效的标识了变换块的尺寸, 有效的提高了编码效率。
实施例六:
参阅图 9, 本发明实施例提供一种图像解码方法, 该方法具体包括:
901、 获得图像块的划分方式, 根据所述图像块的划分方式, 确定所述图像 块所使用的预测块。
其中, 该实施例的各步骤的执行主体为图像解码设备。
该步骤中图像解码设备从图像编码设备发送的码流中获得图像块的划分方 式, 即解析码流获得图像块的划分方式。 其中, 图像块的划分方式可以分为: nLx2N的划分方式和 2NxnL的划分方式, 具体参见步骤 501的相应描述, 在此不 再赘述。 其中, 该步骤中根据图像块的划分方式, 确定所述图像块所使用的预 测块具体包括: 根据图像块的划分方式, 确定所述图像块所使用的预测块的尺 寸。
902、 解析码流获得标识所述图像块或预测块对应的变换块在所述图像块或 预测块中对应的划分层数的标识信息, 根据所述标识信息, 确定所述图像块或 预测块对应的变换块在图像块或预测块中对应的划分层数; 其中, 所述图像块 或预测块对应的变换块包括一个或者多个变换块。
其中, 该步骤包括: 当所述标识信息包括: 用于表示不对第 N个划分层对应 的变换块进一步划分的标识, 则图像解码设备根据所述标识信息, 确定所述图 像块或预测块对应的至少一个变换块在所述图像块或预测块中对应的划分层数
为第 N划分层; 当所述标识信息包括: 用于表示对第 N划分层对应的至少一个变 换块进一步划分的标识, 则图像解码设备根据所述标识信息, 确定所述图像块 或预测块对应的至少一个变换块在所述图像块或预测块中对应的划分层数是大 于第 N划分层的。
其中, 根据所述标识信息, 确定所述预测块对应的变换块在预测块中对应 的划分层数的具体过程包括:
从所述标识信息中读取第 N层指示信息, 判断所述第 N层指示信息中的比 特位的值是第一特定值还是第二特定值;
当所述 N等于 M-1时,如果所述第 N层指示信息中的比特位的值是第一特定 值, 则确定所述比特位对应的变换块对应的划分层数是第 N划分层; 如果所述第 N层指示信息中的比特位的值是第二特定值,则确定所述比特位对应的变换块对 应的划分层数是第 M划分层; 其中, M是预定的划分层数或者预定的最小变换块 所对应的划分层数; 其中 N大于或者等于 1 ;
当所述 N小于 M-1时,如果所述第 N层指示信息中的比特位的值是第一特定 值, 则确定所述比特位对应的变换块对应的划分层数是第 N划分层; 如果所述第 N层指示信息中的比特位的值是第二特定值,继续从所述标识信息中读取下一层 指示信息,直到读取到第 M-1层指示信息或者读取到所有比特位的值都为第一特 定值的第 N+a层指示信息为止, 其中所述 N+a小于或者等于 M。
在确定所述预测块对应的变换块在预测块中对应的划分层数的过程中, 当 N 等于 1时, 所述第 N层指示信息中的比特位的数目是所述预测块中最小预测块的 个数; 或者, 确定所述图像块对应的变换块在预测块中对应的划分层数的过程 中, 当 N等于 1时, 第 1层指示信息中比特位的数目是 1个; 当 N等于 2时, 第 2层 指示信息中比特位的数目是所述图像块中最小预测块的个数。
903、 根据图像块的划分方式和所确定的划分层数确定所述图像块或预测块 对应的变换块的尺寸。
其中, 该步骤的具体实现过程与图像编码设备的操作过程相似, 在此不再 赘述。
本发明实施例在确定变换块尺寸的时候考虑了图像块的划分方式,并将标识 所述图像块或预测块对应的变换块对应的划分层数的标识信息写入码流, 以便 使用逐层标识的方法标识变换块的尺寸, 既保证了变换块不会跨过预测块的边
界, 同时又有效的标识了变换块的尺寸, 有效的提高了编码效率。
为了使本发明提供的上述技术方案更加清楚,如下两个实施例对本发明上述 技术方案进行详细介绍:
实施例七:
参阅图 10 , 本发明实施例提供一种图像解码方法, 该图像解码方法与图 6所 示图像编码方法相对应, 其具体包括:
1001、 图像解码设备从码流中解析中标识图像块的划分方式的指示信息, 根据该指示信息, 获得图像块的划分方式。
如前述, 该图像块的划分方式可以为 Nx2N划分方式, 或 nLx2N划分方式。 1002、 图像解码设备根据图像块的划分方式, 在参考图像中查找预测块, 所述预测块是与该图像块所划分成的子图像块尺寸匹配的图像块。
1003、 图像解码设备解析码流获得标识图像块釆用的变换块在图像块中所 对应的划分层数的标识信息, 根据所述标识信息, 确定图像块釆用的变换块在 图像块中所对应的划分层数。
1004、 根据图像块的划分方式和所述划分层数确定所述图像块釆用的变换 块的尺寸。 其中, 第一划分层对应的变换块的尺寸为最小预测块的尺寸。
具体的, 步骤 1003和步骤 1004包括:
图像解码设备根据划分方式, 确定标识信息中第一层指示信息的比特位数, 即图像块中最小预测块的个数为第一层指示信息的比特位数, 当图像块划分方 式为 Nx2N时,确定第一层指示信息的比特位数为 2; 当图像块划分方式为 nLx2N 时, 比如将图像块划分成 0.5Nx2N和 1.5Nx2N的两个子图像块, 则第一层指示 信息的比特位数为 4; 当所述第一层指示信息标识图像块对应的变换块尺寸不进 行更小尺寸划分时, 确定当前图像块对应的划分层数为第一划分层, 当图像块 划分方式为 Nx2N时, 确定图像块对应的变换块尺寸为 Nx2N , 即第一划分层对应 的变换块的尺寸与预测块尺寸一致; 当图像块划分方式为 nLx2N 时, 确定变换 块尺寸为 0. 5Nx2N,即第一划分层对应的变换块尺寸与预测块中最小的预测块尺 寸一致。 当第一层指示信息标识某些第一划分层的变换块尺寸往更小尺寸划分 时, 此时划分层数在当前划分层数基础上加一, 即划分层数变为第二划分层。 当图像块划分方式为 Nx2N 时, 确定图像块对应的第二划分层的变换块尺寸为
NxN , 即下一层变换块对应的水平尺寸与当前层对应的变换块的水平尺寸相同, 并且下一层变换块对应的垂直尺寸为当前层对应的变换块的垂直尺寸的一半, 如图 6b 所示; 当图像块划分方式为 nLx2N 时, 确定下一层的变换块尺寸为 0. 5NxO. 5N , 即下一层变换块对应的水平尺寸与当前层对应的变换块的水平尺寸 相同, 并且下一层变换块对应的垂直尺寸为当前层对应的变换块的垂直尺寸的 四分之一, 如图 6d所示。
其中, 可以编解码设备可以预定某个划分方式下允许的划分层数, 或者编 解码设备预定某个划分方式下允许的最小变换尺寸时, 具体的实现方式与编码 端相同, 在此不再赘述。 具体的, 根据图像块的划分方式和所述划分层数确定 所述图像块釆用的变换块的尺寸的方式与前述实施例四所述方法相同, 在此不 再赘述。
本发明实施例在确定图像块釆用的变换块尺寸的时候考虑了图像块的划分 方式, 并将标识所述图像块釆用的变换块对应的划分层数的标识信息写入码流, 以便使用逐层标识的方法标识变换块的尺寸, 既保证了变换块不会跨过预测块 的边界, 同时又有效的标识了变换块的尺寸, 有效的提高了编码效率。
实施例八:
参阅图 11 , 本发明实施例提供一种图像解码方法, 该图像解码方法与图 7所 示图像编码方法相对应, 其具体包括:
步骤 1111-1102与步骤 1001-1002相同, 在此不再赘述。
步骤 1113、 图像解码设备解析码流获得标识图像块釆用的变换块划分层数 的标识信息, 根据所述标识信息, 确定图像块釆用的变换块在图像块中对应的 划分层数。
具体的, 从标识图像块的预测块对应的变换块划分层数的标识信息中的获 取第一层指示信息, 第一层指示信息包含一个比特位, 即获取的是第一个比特 位, 根据第一比特位的值确定是否对第一划分层进一步划分, 如果第一个比特 位的值表示不对第一划分层进一步划分, 则该确定图像块对应的变换块为 1 个 变换块, 即 2Nx2N变换块; 如果第一个比特位的值表示对第一划分层进一步划 分, 则根据图像块的预测块中最小预测块的尺寸, 确定所述标识信息中的第二 层指示信息的比特位数, 比如划分方式为 0.5Nx2N, 则最小预测块的尺寸也为 0.5Nx2N,则尺寸为 2Nx2N的图像块对应 4个尺寸与最小预测块尺寸相同的变换
块, 所以确定第二层指示信息的比特位为 4个, 读取这 4个比特位, 如果比特 位值为第一特定值, 比如 1 , 表示第二划分层的该变换块不进一步划分, 如果比 特位值为第二特定值, 比如 0 , 表示第二划分层的该变换块需要进一步划分; 对 于图 7b所示意的图, 则这 4个比特位都为第一特定值, 此时确定图像块釆用的 变换块在图像块中对应的划分层数为第二划分层, 即确定图像块釆用的各变换 块是第二划分层的变换块; 对于图 7c所示意的图, 则这 4个比特位中第 2和 3 比特位为第一特定值, 表示不需要对第二划分层的第 2、 3比特位所对应的变换 块进一步划分, 确定该图像块釆用的这 4个比特位中第 2、 3所对应的变换块的 划分层数为第二划分层; 第 1、 4比特位为第二特定值, 表示需要对第二划分层 的第 1、 4比特位所对应的变换块进一步划分, 得到 4个第三划分层的变换块, 此时, 当该划分方式下允许的划分层数是 3层, 或者该划分方式下允许的最小 变换块尺寸为 0. 5NxO. 5N时, 则确定该图像块需对应 4个比特位中第 1、 4所对 应的变换块所进一步划分得到的变换块, 其所对应的划分层数为第三划分层。
步骤 1104、 根据图像块的划分方式和所述划分层数确定所述图像块釆用的 变换块的尺寸。 其中, 第一划分层对应的变换块的尺寸为该图像块的尺寸, 即 2N x2N; 第二划分层对应的变换块的尺寸为最小预测块的尺寸。
当图像块对应的划分层数为第一划分层, 如果图像块划分方式为 nLx2N时, 确定图像块对应的变换块尺寸为 2Nx2N,即第一划分层对应的变换块的尺寸与图 像块一致, 如图 7a)所示; 当图像块对应的划分层数为第二划分层时, 当图像块 划分方式为 nLx2N 时, 根据图像块的划分方式和划分层数(即第二划分层)确 定图像块对应的变换块尺寸为 0. 5Nx2N,即第二划分层对应的变换的尺寸与预测 块中最小的预测块尺寸一致, 如图 7b)所示; 当图像块中的某个 0. 5Nx2N的数据 块需要釆用的第三划分层的变换块时, 根据图像块的划分方式和划分层数(即 第三划分层)确定其釆用的变换块尺寸为 0. 5NxO. 5N , 即下一层变换块对应的水 平尺寸与当前层对应的变换块的水平尺寸相同, 并且下一层变换块对应的垂直 尺寸为当前层对应的变换块的垂直尺寸的四分之一, 如图 7c)所示。
具体的, 根据图像块的划分方式和所述划分层数确定图像块釆用对应的变 换块的尺寸的方式与前述实施例四所述方法相同, 在此不再赘述。
本发明实施例在确定图像块釆用的变换块尺寸的时候考虑了图像块的划分
方式, 并将标识图像块釆用的变换块的划分层数的标识信息写入码流, 以便使 用逐层标识的方法标识变换块的尺寸, 既保证了变换块不会跨过预测块的边界, 同时又有效的标识了变换块的尺寸, 有效的提高了编码效率。
相应的, 本发明实施例提供一种图像解码方法, 其与图 7所示图像编码方法 相对应, 图像解码设备分别解析两个预测块对应的划分标志 (即标识预测块对 应的变换块所对应的划分层次的标识信息), 根据两个预测块的划分标志分别确 定两个预测块对应的变换块所对应的划分层数, 分别根据图像块的划分方式和 所确定的划分层数确定两个预测块对应的变换块的尺寸。
需要说明的是 , 上述各实施例是以 nLx2N的划分方式为例进行描述的, 应 该理解的是,本发明上述各实施例所提供的技术方案同时也适用于 nRxN、 2NxnU、 2NxnD、 2NxN、 Nx2N等划分方式中。
参阅图 12, 本发明实施例提供一种图像编码设备, 其包括:
预测块确定单元 10, 用于根据图像块的划分方式, 确定所述图像块所使用 的预测块;
划分层次确定单元 20, 用于确定所述图像块或预测块对应的变换块在所述 图像块或预测块中对应的划分层数; 其中, 所述图像块或预测块对应的变换块 包括一个或者多个变换块;
变换块尺寸确定单元 30 , 用于根据图像块的划分方式和所述划分层数确定 所述图像块或预测块对应的变换块的尺寸;
标识信息确定单元 40, 用于确定标识所述图像块或预测块对应的变换块所 对应的划分层数的标识信息;
写入单元 50, 用于将将所述标识信息写入码流。
其中, 对于上级划分层对应的变换块尺寸与下级划分层对应的变换块尺寸 之间的关系 (比如, 第 N划分层对应的变换块尺寸与第 N+1划分层对应的变换块 尺寸间的关系, 其中, 第 N划分层为第 N+1划分层的上级划分层, 第 N+1划分层 为第 N划分层的下级划分层 ), 以及划分层所对应的变换块的尺寸的规定见方法 实施例的相应描述, 在此不再赘述。
其中, 所述划分层次确定单元 20, 用于当所述图像块或预测块对应的至少 一个变换块在所述图像块或预测块中对应的划分层数为第 N划分层时,确定标识 所述图像块或预测块对应的所述至少一个变换块对应的划分层数的标识信息包
括:标识对所述第 N划分层的所述至少一个变换块不进一步划分的标志位;或者, 所述划分层次确定单元 20, 用于当所述图像块或预测块对应的至少一个变换块 在所述图像块或预测块中对应的划分层数大于第 N划分层时,确定标识所述图像 块或预测块对应的所述至少一个变换块所对应的划分层数的标识信息包括: 对 第 N划分层对应的变换块进一步划分的标志位。
其中, 变换块尺寸确定单元 30 , 用于查询所述图像块的划分方式和所述划 分层数所对应的变换块尺寸, 其中, 具体的对应关系可以如表 1所示;
或者, 所述变换块尺寸确定单元 30 , 用用于查询所述图像块的划分方式和 所述划分层数所对应的第一类尺寸比值; 其中, 第一类尺寸比值包括: 所述图 像块或预测块对应的变换块的水平尺寸与图像块的水平尺寸的比值和所述图像 块或预测块对应的变换块的垂直尺寸与图像块的垂直尺寸的比值; 根据所述第 一类尺寸比值和图像块的水平尺寸和垂直尺寸, 确定所述图像块或预测块对应 的变换块尺寸, 其中具体的对应关系可以如表 2和表 3所示;
或者, 所述变换块尺寸确定单元 30 , 用于查询所述图像块的划分方式和所 述划分层数所对应的第二类尺寸比值; 第二类尺寸比值包括: 所述图像块或预 测块对应的变换块的水平尺寸与预测块的水平尺寸的比值和所述图像块或预测 块对应的变换块的垂直尺寸与预测块的垂直尺寸的比值; 根据所述第二类尺寸 比值和预测块的水平尺寸和垂直尺寸, 确定所述图像块或预测块对应的变换块 尺寸, 其中, 第二类尺寸比值具体可以包括: 图像块或者预测块对应的变换块 的水平尺寸与最小预测块的水平尺寸的比值和图像块或者预测块对应的变换块 的垂直尺寸与最小预测块的垂直尺寸的比值; 然后根据所确定的第二类尺寸比 值和最小预测块的尺寸, 确定该图像块或者预测块对应的变换块的尺寸。 具体 的对应关系可以如表 4和表 5所示。
本发明实施例在确定变换块尺寸的时候考虑了图像块的划分方式的划分方 式, 并将标识所述图像块或预测块对应的变换块所对应的划分层数的标识信息 写入码流, 以便使用逐层标识的方法标识变换换的尺寸, 既保证了变换块不会 跨过预测块的边界, 同时又有效的标识了变换块的尺寸, 有效的提高了编码效 率。
参阅图 13 , 本发明实施例提供一种图像解码设备, 其包括:
预测块确定单元 60 , 用于获得图像块的划分方式, 根据所述图像块的划分
方式, 确定所述图像块所使用的预测块;
标识信息获得单元 70, 用于解析码流获得标识所述图像块或预测块对应的 变换块在所述图像块或预测块中对应的划分层数的标识信息;
划分层次确定单元 80, 用于根据所述标识信息, 确定所述图像块或预测块 对应的变换块在图像块或预测块中对应的划分层数; 其中, 所述图像块或预测 块对应的变换块包括一个或者多个变换块;
变换块尺寸确定单元 90 , 用于根据图像块的划分方式和所述划分层数确定 所述图像块或预测块对应的变换块的尺寸。
其中, 对于上级划分层对应的变换块尺寸与下级划分层对应的变换块尺寸 之间的关系, 以及划分层所对应的变换块的尺寸的规定见方法实施例的相应描 述, 在此不再赘述。
其中, 所述标识信息包括: 用于表示不对第 N个划分层对应的变换块进一 步划分的标识; 此时, 所述划分层次确定单元, 用于根据所述标识信息, 确定 所述图像块或预测块对应的变换块中的至少一个变换块在所述图像块或预测块 中对应的划分层数为第 N划分层; 或者, 所述标识信息包括: 用于表示对第 N划 分层对应的至少一个变换块进一步划分的标识; 所述划分层次确定单元, 用于 根据所述标识信息, 确定所述图像块或预测块对应的变换块中至少一个变换块 在所述图像块或预测块中对应的划分层数是大于第 N划分层的。
其中, 变换块尺寸确定单元 90的结构和功能与上述图像编码设备中变换块 尺寸确定单元 30的结构和功能相似, 在此不再赘述。
本发明实施例在确定变换块尺寸的时候考虑了图像块的划分方式的划分方 式, 并将标识所述图像块或预测块对应的变换块所对应的划分层数的标识信息 写入码流, 以便使用逐层标识的方法标识变换换的尺寸, 既保证了变换块不会 跨过预测块的边界, 同时又有效的标识了变换块的尺寸, 有效的提高了编解码 效率。
在前述方法中, 图像块对应的变换块的划分层数(或预测块对应的变换块 的划分层数)用于确定变换块的尺寸, 根据特定的变换块的划分层数及图像块 的划分方式可以获得指定的划分后的变换块尺寸(变换块的宽和高)。 当划分层 数不同时, 变换块具有不同的尺寸, 此外特定划分层数对应的变换块的宽和高 的比例也不同。 例如, 以实施例三为例, 当图像块釆用 nLx2N的划分方式时, 第
一划分层对应的变换块尺寸为 2Nx2N, 变换块的宽和高的比例为 1 : 1 ; 第二划分 层对应的变换块的尺寸为 0. 5Nx2N, 变换块的宽和高的比例为 1 : 4 , 第三划分层 对应的变换块的尺寸为 0. 5NxO. 5N, 变换块的比例为 1 : 1。 也就是说划分层数可 以用于标识在指定图像块的划分方式条件下变换块的尺寸。
由于变换块的划分是遵循一定规律进行的, 如图像块对应的初始变换块尺 寸与图像块尺寸一致(实施例三中第一划分层对应的变换块尺寸), 变换块的划 分与图像块划分方式的关系, 变换块划分成尺寸更小的变换块的数目总是固定 的 (如划分成四个更小的变换块, 或划分成两个更小的变换块), 变换块的尺寸 不能超过视频编解码系统中允许的最大变换块尺寸, 变换块的尺寸不能小于视 频编解码系统中允许的最小变换块尺寸。 因此, 除了使用划分层数和图像块划 分方式, 使用变换块的信息 (变换块的高、 变换块的宽、 变换块高与宽的平均 值、 预设的最大变换块尺寸、 预设的最小变换块尺寸)及图像块划分方式, 或 仅使用前述变换块的信息一样可以确定划分后的变换块尺寸。
以下将以图像块划分方式 Nx2N为例说明根据图像块划分方式及变换块的 宽和高的数值关系, 以及仅根据变换块宽和高的数值关系获得划分后变换块的 尺寸的方法。 设图像块的尺寸为 2Mx2M, 预设的最大变换块尺寸为 2M、 预设的 最小变换块尺寸为 0.25M。 变换块按一分为四的规律进行划分, 即变换块总是划 分成四个尺寸更小的变换块。 所述的尺寸更小可以为划分后的变换块的宽小于 划分前变换块的宽, 或划分后的变换块的高小于划分前变换块的高, 或划分后 的变换块的宽和高小于划分前变换块的宽和高。 设变换块的初始尺寸等于图像 块的尺寸。
在本发明实施例中, 根据划分前的变换块宽和高间的数值关系, 及划分前 的变换块的宽和高与预设的变换块的最大尺寸间的数值关系, 来确定划分后的 变换块的尺寸。
所述的数值关系可以为大于或等于或小于。
由于变换块总是按从大往小的方式进行划分, 变换块尺寸的初始值等于图 像块的尺寸, 此时变换块尺寸为 2Mx2M, 如图 14所示。 当划分前的变换块的宽 和高均等于图像块的宽和高, 且划分前的变换块的宽等于划分前的变换块的高, 则可知此时变换块还未进行进一步的划分。 根据前述内容, 此时, 变换块进行 划分时遵循两个规则: 1、 在变换块进行划分时划分后变换块的宽和高的比例关
系取决于图像块的划分方式; 2、 变换块按一分为四方法进行划分。 因此, 可知 此时变换块需按垂直方向划分成四个 0.5Mx2M的变换块, 如图 15所示。
此外, 由于变换块的尺寸必须小于或等于预设的最大变换块尺寸, 若前所 述当变换块尺寸的初始值等于图像块的尺寸, 且图像块尺寸大于预设的最大变 换块尺寸时, 变换块的初始尺寸也大于预设的最大变换块尺寸, 此时变换块划 分成四个宽和高均为原来一半的变换块。 当变换块的尺寸等于或小于预设的最 大变换块尺寸, 且变换块的高和宽相等时, 和前述方法一致, 此时变换块根据 图像块划分方式进行划分, 并且变换块划分为四个尺寸更小的变换块, 因此划 分后的变换块的宽为高的四倍。
上述过程使用了变换块的信息及图像块的划分方式判断变换块是否需要进 行划分及划分后的变换块的尺寸。
当变换块的宽或高小于预设的最大变换块尺寸, 且变换块的宽不等于高时, 可知变换块已经根据图像块划分方式进行划分, 此时划分前变换块尺寸为 0.5Mx2M; 当确定如图 15所示标号为 0和 3的变换块进一步划分成尺寸更小的变 换块时, 则根据前述划分规则, 若变换块仍按水平方向划分则划分得到的变换 块尺寸为 0.25Mx2M, 若变换块按垂直方向划分则划分得到的变换块尺寸为 0.5Μχ0.5Μ , 这两种划分方式得到的划分后的变换块尺寸与预测块的尺寸 ( Mx2M )均有一定差异, 因此可知变换块按水平和垂直方向划分得到的变换块 尺寸 0.25MxM为最佳的划分尺寸, 如图 16所示。
上述过程仅使用了变换块的信息用于判断变换块是否需要进行划分及划分 后的变换块的尺寸。
若确定如图 16所示标号为 0的变换进一步划分成尺寸更小的变换块, 当划分 前的变换块的宽或高等于预设的最小变换块尺寸时, 如本例子中的宽等于 0.25M, 即使划分前的变换块的宽不等于高也无法按前述方法进行水平和垂直方 向划分, 否则划分后的变换块的宽或高将小于预设的最小变换块尺寸。 此时, 为了让变换块能够进一步划分成更小的变换块, 变换块可沿另一个方向 (变换 块边长大于预设最小变换块尺寸的方向) 划分得到尺寸更小的变换块; 在本例 子中变换块沿垂直方向划分得到四个 0.25Mx0.25M的变换块, 如图 17所示。
上述过程仅使用了变换块的信息用于判断变换块是否需要进行划分及划分 后的变换块的尺寸。
在上述步骤中, 变换块仅根据变换块信息及图像块划分方式, 或仅根据变 换块信息判断变换块是否需要进行划分及划分后的变换块的尺寸。 此外, 上述 步骤所描述的过程用于解释说明如何根据变换块宽和高及图像块划分方式, 或 仅根据变换块宽和高判断变换块是否需要进行划分及划分后的变换块的尺寸, 并解释判断和划分的原理, 在具体实践过程中, 仅需使用变换块信息及图像块 划分方式, 或变换块信息。 以下为一个具体的例子。
设图像块的尺寸为 32x32, 图像块的划分方式为垂直划分方式, 即图像块划 分方式为 Nx2N nLNx2N nRx2N其中一种, 预设的最大变换块尺寸为 16, 预设 的最小变换块尺寸为 4。 设变换块的宽和高使用参数 log2TrafoHeight和 log2Trafo Width表示,变换块的高与 log2TrafoHeight的关系为:变换块的高 = 1 « log2TrafoHeight; 变换块的宽与 log2TrafoWidth的关系为: 变换块的宽 = 1 « log2Trafo Width。 因此, log2TrafoHeight和 log2TrafoWidth的初始值均为 5 , 以指 数形式表示的预设的最大变换块尺寸为 4 , 以指数形式表示的预设的最小变换块 尺寸为 2。 此外, 变换块尺寸参数还可以 log2TrafoSize表示, log2TrafoSize与 log2TrafoHeight和 log2TrafoWidth的关系为: log2TrafoSize = ( log2TrafoHeight + log2TrafoHeight )》 1
上述运算操作中, "《"代表向左移位操作, 1 « log2TrafoHeight 等价于
2log2TrafoHelght 操作, i 〈〈 log2TrafoWidth 等价于 ^^^ 操作, 1 « log2TrafoSize 等价于 21<¾2¾ώδΐΗ:操作; "»"代表向右移位操作, ( log2TrafoHeight + log2TrafoHeight ) » 1 等价于( log2TrafoHeight + log2TrafoHeight ) / 2操作 下 同。
根据上述描述可知, log2TrafoHeight log2Trafo Width和 log2TrafoSize通过 指数形式表示变换块的尺寸。 因此, 当变换块被划分成更小的子变换块时, 变 换块尺寸的变化可通过对参数 log2TrafoHeight log2Trafo Width和 log2TrafoSize 数值的加减体现。 如, 当前变换块尺寸为 16x16时, log2TrafoHeight的值为 4 , log2TrafoWidth的值为 4 , log2TrafoSize的值为 4, 当变换块划分成 16x4的子变 换块时, 尺寸变为 16x4 , 此时 log2TrafoWidth的值不变仍为 4, log2TrafoHeight 的值变为 2 ( 4 - 2 ), log2TrafoSize的值变为 3 ( 4 - 1 , 即 4与 2的平均值)。
在判断变换块的宽或高是否等于预设的最小变换块尺寸的步骤中, 还可以 使用变换块的宽与高的平均值( log2TrafoSize )进行判断。 由于在上述方法中,
划分后的变换块的宽 (或高) 为划分前变换块的宽 (或高) 的四分之一而变换 块的高(或宽)的值不变,即划分后的变换块的 log2Trafo Width或 log2TrafoHeight 的值为划分前变换块的 log2Trafo Width或 log2TrafoHeight的值减 2而变换块的 log2TrafoHeight (或 log2TrafoWidth ) 的值不变。 可知, 当 log2TrafoHeight的值 不等于 log2Trafo Width 时, log2TrafoSize 的值总是大于 log2TrafoHeight 及 log2Trafo Width中的最小值加 1。 因此, 当 log2TrafoSize的值等于预设的变换块 最小值加 1时 log2TrafoHeight及 log2Trafo Width中肯定有一个参数的值等于预 设的变换块最小值,并且通过 log2TrafoHeight及 log2Trafo Width的数值关系(大 于、 等于或小于)可知其值等于预设的变换块最小值的参数。
变换块的高和宽的初始值均为 5 , 由于变换块的高 ( log2TrafoHeight )和宽
Uog2TrafoWidth )的均大于预设的最大变换块尺寸 4( log2TrafoSize的值也为 5 , 大于预设的最大变换块尺寸)。因此变换块划分为四个高和宽均为 4的子变换块。 此时, 划分得到的变换块进行进一步划分时, 由于变换块的高和宽均为 4 ( log2TrafoSize的值为 4 )且均等于预设的最大变换块尺寸 4, 且图像块的划分 方式为 Nx2N或 nLx2N或 nRx2N, 则划分后的变换块的高仍为 4 , 宽的值减 2 变为 2, log2TrafoSize的值为 3; 此时, 划分得到的变换块进行进一步划分时, 由于变换块的宽为 2且等于预设的最小变换块尺寸 2 ( log2TrafoSize的值等于预 设的最小变换块尺寸加 1 ), 则划分后的变换块的宽不变仍为 2, 高的值减 2变 为 2。
图像块的划分方式为水平划分方式, 即图像块划分方式为 2NxN、 2NxnU、
2NxnD 其中一种时, 变换块的划分原理与上述方法一致, 不再累述。 在此仍以 图像块的尺寸为 32x32举例, 预设的最大变换块尺寸为 16 , 预设的最小变换块 尺寸为 4。 变换块的高和宽的初始值均为 5 , 由于变换块的高(log2TrafoHeight ) 和宽 ( log2Trafo Width ) 的均大于预设的最大变换块尺寸 4 ( log2TrafoSize的值 也为 5 , 大于预设的最大变换块尺寸)。 因此变换块划分为四个高和宽均为 4的 子变换块。 此时, 划分得到的变换块进行进一步划分时, 由于变换块的高和宽 均为 4 ( log2TrafoSize的值为 4 )且均等于预设的最大变换块尺寸 4, 且图像块 的划分方式为 2NxN、 2NxnU、 2NxnD, 则划分后的变换块的宽仍为 4 , 高的值 减 2变为 2, log2TrafoSize的值为 3; 此时, 划分得到的变换块进行进一步划分 时, 由于变换块的高为 2且等于预设的最小变换块尺寸 2 ( log2TrafoSize的值等
于预设的最小变换块尺寸加 1 ), 则划分后的变换块的高不变仍为 2 , 宽的值减 2 变为 2。
此外, 变换块的尺寸的最大值或最小值 (也称变换块的最大尺寸或最小尺寸) 也可以指变换块所包含的像素信息, 此时变换块的尺寸的最大值或最小值可以 变换块的宽与高的乘积表示。。 因此, 在判断变换块的宽或高是否等于预设的变 换块的最小尺寸 (尺寸的最小值)的步骤中,还可以使用变换块的宽与高的乘积进 行判断。 由于在上述方法中, 划分后的变换块的宽 (或高) 为划分前变换块的 宽 (或高) 的四分之一而变换块的高 (或宽) 的值不变, 即划分后的变换块的 log2TrafoWidth 或 log2TrafoHeight 的值为划分前变换块的 log2Trafo Width 或 log2TrafoHeight的值减 2而变换块的 log2TrafoHeight (或 log2Trafo Width )的值 不变。 可知, 当 log2TrafoHeight的值不等于 log2Trafo Width时, log2TrafoSize 的值总是大于 log2TrafoHeight及 log2TrafoWidth中的最小值加 1。因此与前面所 述原理一致, 当 log2TrafoHeight与 log2TrafoWidth的乘积等于预设的变换块最 小值的四倍时通过 log2TrafoHeight及 log2Trafo Width的数值关系 (大于、 等于 或小于)可知其值变换块需要沿长边方向进行划分。
变换块的高和宽的初始值均为 5 , 设最大的变换块的值为 16x16 , 设最小的 变换块的值为 4x4。 由于变换块的高 ( log2TrafoHeight )和宽 ( log2Trafo Width ) 的乘积大于预设的最大变换块尺寸。 因此变换块划分为四个高和宽均为 4 的子 变换块。 此时, 划分得到的变换块进行进一步划分时, 由于变换块的高和宽均 为 4 ( log2TrafoSize的值为 4 )且均高和宽的乘积等于预设的最大变换块尺寸, 且图像块的划分方式为 Nx2N或 nLx2N或 nRx2N , 则划分后的变换块的高仍为 4, 宽的值减 2变为 2 , log2TrafoSize的值为 3 ; 此时, 划分得到的变换块进行 进一步划分时, 由于变换块的宽为 2且等于预设的最小变换块尺寸的四倍, 则 划分后的变换块的宽不变仍为 2, 高的值减 2变为 2。
图像块的划分方式为水平划分方式, 即图像块划分方式为 2NxN、 2NxnU、
2NxnD 其中一种时, 变换块的划分原理与上述方法一致, 不再累述。 在此仍以 图像块的尺寸为 32x32举例,预设的最大变换块尺寸为 16x16, 预设的最小变换 块尺寸为 4x4。 变换块的高和宽的初始值均为 5 , 由于变换块的高 ( log2TrafoHeight )和宽( log2Trafo Width )的乘积大于预设的最大变换块尺寸。 因此变换块划分为四个高和宽均为 4 的子变换块。 此时, 划分得到的变换块进
行进一步划分时, 由于变换块的高和宽均为 4 ( log2TrafoSize的值为 4 )且均等 于预设的最大变换块尺寸 4, 且图像块的划分方式为 2NxN、 2NxnU、 2NxnD, 则划分后的变换块的宽仍为 4, 高的值减 2变为 2, log2TrafoSize的值为 3; 此 时, 划分得到的变换块进行进一步划分时, 由于变换块的高为 2且等于预设的 最小变换块尺寸的四倍,则划分后的变换块的高不变仍为 2 ,宽的值减 2变为 2。 在上述方法中, 当图像块划分方式及划分前变换块宽和高的数值关系满足 特定条件时, 划分后变换块的宽和高的值相比于划分前的变换块的宽和高的值 会发生改变。 根据上述步骤和原理可知, 划分后变换块的尺寸的改变有以下三 种情况:
I、 划分后变换块的宽等于划分前变换块的宽, 划分后变换块的高小于划 分前变换块的高;
II、 划分后变换块的高等于划分前变换块的高, 划分后变换块的宽小于划 分前变换块的宽;
III、 划分后变换块的宽小于划分前变换块的宽, 划分后变换块的高小于 划分前变换块的高。
因此, 可设置参数 interTUSplitDirection用于标识划分后变换块的尺寸与划 分前变换块的尺寸的关系 , 从而得到划分后变换块的尺寸。 设 interTUSplitDirection的值为 0、 1、 2分别表示上述 I、 II、 III 三种情况。
当图像块的划分方式和变换块的宽和高的数值关系或变换块的宽和高的数 值关系满足以下其中一个条件时, interTUSplitDirection的值为 0:
图像块划分方式为水平划分方式, 划分前的变换块的宽等于划分前的变换 块的高, 划分前变换块的宽和高均小于或等于预设的变换块最大尺寸, 划分前 变换块的宽和高均大于或等于预设的变换块最小尺寸;
图像块划分方式为水平划分方式, 划分前的变换块的宽等于划分前的变换 块的高, 且划分前的变换块的宽和高的平均值小于或等于预设的变换块最大尺 寸, 且划分前的变换块的宽和高的平均值大于或等于预设的变换块最小尺寸; 所述划分前的变换块的宽等于所述预设的变换块的最小值, 且所述划分前 的变换块的高大于所述划分前的变换块的宽;
所述划分前的变换块的宽与所述划分前的变换块的高的平均值等于所述预
设的变换块的最小值加 1 ,且所述划分前的变换块的高大于所述划分前的变换块 的宽。
当图像块的划分方式和变换块的宽和高的数值关系或变换块的宽和高的数 值关系满足以下其中一个条件时, interTUSplitDirection的值为 1:
图像块划分方式为垂直划分方式, 且所述划分前的变换块的宽等于划分前 的变换块的高, 划分前变换块的宽和高均小于或等于预设的变换块最大尺寸, 划分前变换块的宽和高均大于或等于预设的变换块最小尺寸;
图像块划分方式为垂直划分方式, 划分前的变换块的宽等于划分前的变换 块的高, 且划分前的变换块的宽和高的平均值小于或等于预设的变换块最大尺 寸, 且划分前的变换块的宽和高的平均值大于或等于预设的变换块最小尺寸; 所述划分前的变换块的高等于所述预设的变换块的最小值, 所述划分前的 变换块的宽大于所述划分前的变换块的高时;
所述划分前的变换块的高与所述划分前的变换块的宽的平均值等于所述预 设的变换块的最小值加 1 ,且所述划分前的变换块的宽大于所述划分前的变换块 的高。
否则 (图像块的划分方式和变换块的宽和高的数值关系或变换块的宽和高 的数值关系不满足上述条件时), interTUSplitDirection的值为 2。 基于以上描述, 请参照图 18, 本发明实施例还提供一种获得变换块尺寸的方法, 其包括:
步骤 1501 : 获得图像块的划分方式;
步骤 1502: 根据所述图像块的划分方式和划分前的变换块的宽和高, 获得 划分后的变换块的尺寸信息。
在本发明实施例中, 变换块的尺寸信息是指变换块的宽或者高, 以及其他 用于指示变换块的宽或者高的信息。
同样的, 请参照图 19 , 本发明实施例还提供一种获得变换块尺寸的方法, 包括:
步骤 1601 : 确定预设的变换块最大尺寸和预设的变换块的尺寸的最小值; 步骤 1602: 根据所述划分前的变换块的高、 所述划分前的变换块的宽, 以 及所述预设的变换块最大尺寸或所述预设的变换块的尺寸的最小值获得划分后 的变换块的尺寸信息。
所述预设的变换块最大尺寸可以在编码视频序列之前确定, 也可以在编码
一幅图像之前确定, 也可以在编码一个条带之前确定, 也可以在编码一个图像 块或编码一个预测块或编码一个变换块之前确定。 所述预设的变换块最大尺寸 可以在解码视频序列头或序列参数集时确定, 也可以在解码图像头或图像参数 集时确定, 也可以在解码辅助增强信息 ( Supplemental enhancement information ) 时确定, 也可以在解码图像块或预测块或变换块时确定。
所述预设的变换块的尺寸的最小值可以在编码视频序列之前确定, 也可以 在编码一幅图像之前确定, 也可以在编码一个条带之前确定, 也可以在编码一 个图像块或编码一个预测块或编码一个变换块之前确定。 所述预设的变换块的 尺寸的最小值可以在解码视频序列头或序列参数集时确定, 也可以在解码图像 头或图像参数集时确定,也可以在解码辅助增强信息( Supplemental enhancement information ) 时确定, 也可以在解码图像块或预测块或变换块时确定。
此外, 所述的变换块的尺寸的最大值或最小值也可可以指变换块所包含的 像素信息, 此时变换块的尺寸的最大值或最小值可以变换块的宽与高的乘积表 示。
釆用本发明实施例提供的变换块的获得方法, 可以进根据图像块的划分方 式, 或者划分前的变换块的高和宽对变换块的尺寸进行编码, 有效提高了编码 的效率。
请参照图 20, 本发明还提供用于执行上述步骤 1501 和 1502的变化块尺寸获 得模块, 其包括
划分方式获得模块 202, 用于获得图像块的划分方式;
尺寸信息获得模块 204, 用于根据所述图像块的划分方式和划分前的变换块 的宽和高, 获得划分后的变换块的尺寸信息。
上述模块得具体工作方法, 在前文中已有记述, 在此不再赘述。
请参照图 21 , 本发明实施例还提供用于执行步骤 1601和 1602的变换块尺寸 获得模块, 其包括:
预设尺寸确定模块 212, 用于确定预设的变换块最大尺寸和预设的变换块的 尺寸的最小值;
尺寸信息获得模块 214 , 用于根据划分前的变换块的高、 所述划分前的变换 块的宽, 以及所述预设的变换块最大尺寸或所述预设的变换块的尺寸的最小值 获得划分后的变换块的尺寸信息。
上述模块得具体工作方法, 在前文中已有记述, 在此不再赘述。 本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤是 可以通过程序来指令相关的硬件完成, 所述的程序可以存储于一种计算机可读 存储介质中, 例如只读存储器, 磁盘或光盘等。
以上对本发明实施例所提供的图像编解码方法、 编解码设备及网络系统进 以上实施例的说明只是用于帮助理解本发明的方法及其核心思想; 同时, 对于 本领域的一般技术人员, 依据本发明的思想, 在具体实施方式及应用范围上均 会有改变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。
Claims
1、 一种获得变换块尺寸的方法, 其特征在于, 包括:
获得图像块的划分方式;
根据所述图像块的划分方式和划分前的变换块的宽和高, 获得划分后的变 换块的尺寸信息。
2、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述图像块的划分 方式和划分前的变换块的宽和高, 获得划分后的变换块的尺寸信息包括:
根据划分前的变换块的宽和高的数值关系获得所述划分后的变换块的尺寸 信息。
3、 根据权利要求 2所述的方法, 其特征在于, 所述数值关系包括大于, 等 于, 小于。
4、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述图像块的划分 方式和划分前的变换块的宽和高, 获得划分后的变换块的尺寸信息包括:
根据所述图像块的划分方式和划分前的变换块的宽和高的数值关系获得划 分方向参数;
根据所述划分方向参数和所述划分前的变换块的宽和高的值获得划分后变 换块的尺寸。
5、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述图像块的划分 方式和划分前的变换块的宽和高获得划分后的变换块的尺寸信息包括:
当图像块划分方式为水平划分方式, 且所述划分前的变换块的宽等于划分 前的变换块的高时, 所述划分后的变换块的宽等于所述划分前的变换块的宽, 所述划分后的变换块的高小于所述划分前的变换块的高;
或, 当图像块划分方式为垂直划分方式, 且所述划分前的变换块的宽等于 划分前的变换块的高时, 所述划分后的变换块的高等于所述划分前的变换块的 高, 所述划分后的变换块的宽小于所述划分前的变换块的宽。
6、 根据权利要求 5所述的方法, 其特征在于, 所述根据所述图像块的划分 方式和划分前的变换块的宽和高获得划分后的变换块的尺寸信息包括:
当图像块划分方式为水平划分方式, 划分前的变换块的宽等于划分前的变 换块的高, 划分前变换块的宽和高均小于或等于预设的变换块最大尺寸, 划分 前变换块的宽和高均大于或等于预设的变换块最小尺寸时, 所述划分后的变换 块的宽等于所述划分前的变换块的宽, 所述划分后的变换块的高小于所述划分 前的变换块的高;
或, 当图像块划分方式为垂直划分方式, 划分前的变换块的宽等于划分前 的变换块的高, 划分前的变换块的宽和高小于或等于预设的变换块最大尺寸, 划分前的变换块的宽和高大于或等于预设的变换块最小尺寸时, 所述划分后的 变换块的高等于所述划分前的变换块的高, 所述划分后的变换块的宽小于所述 划分前的变换块的宽。
7、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述图像块的划分 方式和划分前的变换块的宽和高获得划分后的变换块的尺寸信息包括:
当图像块划分方式为水平划分方式, 划分前的变换块的宽等于划分前的变 换块的高, 划分前的变换块的宽和高的平均值小于或等于预设的变换块最大尺 寸, 划分前的变换块的宽和高的平均值大于或等于预设的变换块最小尺寸时, 所述划分后的变换块的宽等于所述划分前的变换块的宽, 所述划分后的变换块 的高小于所述划分前的变换块的高;
或, 当图像块划分方式为垂直划分方式, 划分前的变换块的宽等于划分前 的变换块的高, 划分前的变换块的宽和高的平均值小于或等于预设的变换块最 大尺寸, 划分前的变换块的宽和高的平均值大于或等于预设的变换块最小尺寸 时, 所述划分后的变换块的高等于所述划分前的变换块的高, 所述划分后的变 换块的宽小于所述划分前的变换块的宽。
8、 根据权利要求 6或 7所述的方法, 其特征在于, 所述预设的变换块的最大 尺寸包括预设的变换块的高的最大值, 或预设的变换块的宽的最大值, 或预设 的变换块的高和变换块的宽的平均值的最大值, 所述预设的变换块最小尺寸包 括预设的变换块的高的最小值, 或预设的变换块的宽的最小值, 或预设的变换 块的高和变换块的宽的平均值的最小值。
9、 根据权利要求 1所述的方法, 其特征在于, 所述根据所述图像块的划分 方式和划分前的变换块的宽和高获得划分后的变换块的尺寸信息包括:
当图像块划分方式为水平划分方式, 划分前的变换块的宽等于划分前的变 换块的高, 划分前变换块的宽和高的乘积小于或等于预设的变换块最大尺寸, 划分前变换块的宽和高的乘积大于或等于预设的变换块最小尺寸时, 所述划分 后的变换块的宽等于所述划分前的变换块的宽, 所述划分后的变换块的高小于 所述划分前的变换块的高;
或, 当图像块划分方式为垂直划分方式, 划分前的变换块的宽等于划分前 的变换块的高, 划分前的变换块的宽和高的乘积小于或等于预设的变换块最大 尺寸, 划分前的变换块的宽和高的乘积大于或等于预设的变换块最小尺寸时, 所述划分后的变换块的高等于所述划分前的变换块的高, 所述划分后的变换块 的宽小于所述划分前的变换块的宽。
10、 根据权利要求 9所述的方法, 其特征在于, 所述预设的变换块最大尺寸 包括预设的变换块的高与变换块的宽的乘积的最大值所述预设的变换块的最小 尺寸包括预设的变换块的高与变换块的宽的乘积的最小值。
11、 一种获得变换块尺寸的方法, 其特征在于, 包括:
确定预设的变换块的尺寸的最大值和预设的变换块的尺寸的最小值; 根据划分前的变换块的高、 所述划分前的变换块的宽, 以及所述预设的变 换块的尺寸的最大值或所述预设的变换块的尺寸的最小值获得划分后的变换块 的尺寸信息。
12、 根据权利要求 11所述的方法, 其特征在于, 所述预设的变换块的尺寸 的最大值包括预设的变换块的高的最大值, 或预设的变换块的宽的最大值, 或 预设的变换块的高和变换块的宽的平均值的最大值, 所述预设的变换块的尺寸 的最小值包括预设的变换块的高的最小值, 或预设的变换块的宽的最小值, 或 预设的变换块的高和变换块的宽的平均值的最小值。
13、 根据权利要求 12所述的方法, 其特征在于, 当所述划分前的变换块的高等于所述预设的变换块的最小值, 所述划分前 的变换块的宽大于所述划分前的变换块的高时, 所述划分后的变换块的高等于 所述划分前的变换块的高, 所述划分后的变换块的宽小于所述划分前的变换块 的宽;
或, 当所述划分前的变换块的宽等于所述预设的变换块的最小值, 且所述 划分前的变换块的高大于所述划分前的变换块的宽时, 所述划分后的变换块的 宽等于所述变换块的宽, 所述划分后的变换块的高小于所述划分前的变换块的 高;
14、 根据权利要求 11所述的方法, 其特征在于, 所述根据划分前的变换块 的高、 划分前的变换块的宽, 及所述预设的变换块的尺寸的最大值或所述预设 的变换块的尺寸的最小值获得划分后的变换块的尺寸信息包括:
当所述划分前的变换块的高与所述划分前的变换块的宽的平均值等于所述 预设的变换块的最小值加 1 , 且所述划分前的变换块的宽大于所述划分前的变换 块的高时, 所述划分后的变换块的高等于所述划分前的变换块的高, 所述划分 后的变换块的宽小于所述划分前的变换块的宽;
或, 当所述划分前的变换块的宽与所述划分前的变换块的高的平均值等于 所述预设的变换块的最小值加 1 , 且所述划分前的变换块的高大于所述划分前的 变换块的宽时, 所述划分后的变换块的宽等于所述划分前的变换块的宽, 所述 划分后的变换块的高小于所述划分前的变换块的高。
15、 根据权利要求 11所述的方法, 其特征在于, 所述根据划分前的变换块 的高、 划分前的变换块的宽, 及所述预设的变换块的尺寸的最大值或所述预设 的变换块的尺寸的最小值获得划分后的变换块的尺寸信息包括:
当所述划分前的变换块的高不等于所述划分前的变换块的宽, 且所述划分 前的变换块的宽和所述划分前的变换块的高小于所述预设的变换块最大值时, 所述划分后的变换块的宽小于所述划分前的变换块的宽, 所述划分后的变换块 的高小于所述划分前的变换块的高;
或, 当所述划分前的变换块的高不等于所述划分前的变换块的宽, 且所述 划分前的变换块的宽和所述划分前的变换块的高的平均值小于所述预设的变换 块最大值时, 所述划分后的变换块的宽小于所述划分前的变换块的宽, 所述划 分后的变换块的高小于所述划分前的变换块的高。
16、 根据权利要求 14或 15所述的方法, 其特征在于, 所述预设的变换块的 最大尺寸包括预设的变换块的高的最大值, 或预设的变换块的宽的最大值, 或 预设的变换块的高和变换块的宽的平均值的最大值, 所述预设的变换块最小尺 寸包括预设的变换块的高的最小值, 或预设的变换块的宽的最小值, 或预设的 变换块的高和变换块的宽的平均值的最小值。
17、 根据权利要求 11所述的方法, 其特征在于, 所述根据划分前的变换块 的高、 划分前的变换块的宽, 及所述预设的变换块的尺寸的最大值或所述预设 的变换块的尺寸的最小值获得划分后的变换块的尺寸信息包括:
当所述划分前的变换块的高与所述划分前的变换块的宽的乘积等于所述预 设的变换块的最小值的四倍时, 且所述划分前的变换块的宽大于所述划分前的 变换块的高时, 所述划分后的变换块的高等于所述划分前的变换块的高, 所述 划分后的变换块的宽小于所述划分前的变换块的宽;
或, 当所述划分前的变换块的宽与所述划分前的变换块的高的乘积等于所 述预设的变换块的最小值的四倍时, 且所述划分前的变换块的高大于所述划分 前的变换块的宽时, 所述划分后的变换块的宽等于所述划分前的变换块的宽, 所述划分后的变换块的高小于所述划分前的变换块的高。
18、 根据权利要求 17所述的方法, 其特征在于, 所述预设的变换块的尺寸 的最大值包括预设的变换块的高与变换块的宽的乘积的最大值, 所述预设的变 换块的尺寸的最小值包括预设的变换块的高与变换块的宽的乘积的最小值。
19、 根据权利要求 11所述的方法, 其特征在于, 所述根据划分前的变换块 的高、 划分前的变换块的宽, 及所述预设的变换块的尺寸的最大值或所述预设 的变换块的尺寸的最小值获得划分后的变换块的尺寸信息包括:
当所述划分前的变换块的高不等于所述划分前的变换块的宽, 且所述划分 前的变换块的宽和所述划分前的变换块的高的乘积小于或等于所述预设的变换 块最大值时, 所述划分后的变换块的宽小于所述划分前的变换块的宽, 所述划 分后的变换块的高小于所述划分前的变换块的高。
20、 一种变化块尺寸获得模块, 其特征在于, 包括:
划分方式获得模块, 用于获得图像块的划分方式;
尺寸信息获得模块, 用于根据所述图像块的划分方式和划分前的变换块的 宽和高, 获得划分后的变换块的尺寸信息。
21、 一种变化块尺寸获得模块, 其特征在于, 包括:
预设尺寸确定模块, 用于确定预设的变换块的尺寸的最大值和预设的变换 块的尺寸的最小值;
尺寸信息获得模块, 用于根据划分前的变换块的高、 所述划分前的变换块 的宽, 以及所述预设的变换块的尺寸的最大值或所述预设的变换块的尺寸的最 小值获得划分后的变换块的尺寸信息。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP16184019.4A EP3157256B1 (en) | 2011-08-31 | 2012-08-31 | Method for coding an image comprising determining transform block size |
EP12827243.2A EP2693751A4 (en) | 2011-08-31 | 2012-08-31 | METHOD AND MODULE FOR DETERMINING THE SIZE OF A TRANSFORMATION BLOCKS |
US14/144,059 US9338454B2 (en) | 2011-08-31 | 2013-12-30 | Method and apparatus for obtaining size of transform block |
US15/091,378 US9609363B2 (en) | 2011-08-31 | 2016-04-05 | Method and apparatus for obtaining size of transform block |
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110255243 | 2011-08-31 | ||
CN201110255243.6 | 2011-08-31 | ||
CN201210019843.7A CN102970526B (zh) | 2011-08-31 | 2012-01-21 | 一种获得变换块尺寸的方法和模块 |
CN201210019843.7 | 2012-01-21 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US14/144,059 Continuation US9338454B2 (en) | 2011-08-31 | 2013-12-30 | Method and apparatus for obtaining size of transform block |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2013029560A1 true WO2013029560A1 (zh) | 2013-03-07 |
Family
ID=47755344
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2012/080857 WO2013029560A1 (zh) | 2011-08-31 | 2012-08-31 | 一种获得变换块尺寸的方法和模块 |
Country Status (4)
Country | Link |
---|---|
US (2) | US9338454B2 (zh) |
EP (2) | EP2693751A4 (zh) |
CN (1) | CN102970526B (zh) |
WO (1) | WO2013029560A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113273203A (zh) * | 2018-12-22 | 2021-08-17 | 北京字节跳动网络技术有限公司 | 两步交叉分量预测模式 |
Families Citing this family (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9280834B2 (en) * | 2011-04-04 | 2016-03-08 | Telefonaktiebolaget L M Ericsson (Publ) | Method and a processor for texture compression |
CN102970526B (zh) * | 2011-08-31 | 2016-12-14 | 华为技术有限公司 | 一种获得变换块尺寸的方法和模块 |
CN104284188B (zh) * | 2014-10-11 | 2018-03-13 | 华为技术有限公司 | 预测块的划分方法、编码设备和解码设备 |
WO2017088093A1 (en) * | 2015-11-23 | 2017-06-01 | Mediatek Singapore Pte. Ltd. | On the smallest allowed block size in video coding |
JPWO2018092868A1 (ja) | 2016-11-21 | 2019-10-17 | パナソニック インテレクチュアル プロパティ コーポレーション オブ アメリカPanasonic Intellectual Property Corporation of America | 符号化装置、復号装置、符号化方法及び復号方法 |
EP3544300B1 (en) * | 2016-11-21 | 2021-10-13 | Panasonic Intellectual Property Corporation of America | Devices and methods for image coding and decoding using a block size dependent split ratio |
WO2019041219A1 (zh) * | 2017-08-31 | 2019-03-07 | 深圳市大疆创新科技有限公司 | 编码方法、解码方法以及编码装置和解码装置 |
EP3737098A4 (en) | 2018-01-02 | 2021-06-09 | Samsung Electronics Co., Ltd. | CODING PROCESS AND ASSOCIATED APPARATUS, AND DECODING PROCESS AND ASSOCIATED APPARATUS |
JP2021502771A (ja) * | 2018-05-03 | 2021-01-28 | エルジー エレクトロニクス インコーポレイティド | 画像コーディングシステムにおいてブロックサイズに応じた変換を使用する画像デコード方法およびその装置 |
EP3840387B1 (en) * | 2018-10-12 | 2024-03-06 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method for encoding/decoding image signal and device for same |
CN111200735B (zh) * | 2018-11-19 | 2023-03-17 | 华为技术有限公司 | 一种帧间预测的方法及装置 |
WO2020119742A1 (zh) * | 2018-12-15 | 2020-06-18 | 华为技术有限公司 | 块划分方法、视频编解码方法、视频编解码器 |
CN111327894B (zh) * | 2018-12-15 | 2022-05-17 | 华为技术有限公司 | 块划分方法、视频编解码方法、视频编解码器 |
CN111327899A (zh) | 2018-12-16 | 2020-06-23 | 华为技术有限公司 | 视频译码器及相应方法 |
WO2020125595A1 (zh) * | 2018-12-16 | 2020-06-25 | 华为技术有限公司 | 视频译码器及相应方法 |
CN111355959B (zh) * | 2018-12-22 | 2024-04-09 | 华为技术有限公司 | 一种图像块划分方法及装置 |
WO2020125761A1 (zh) * | 2018-12-22 | 2020-06-25 | 华为技术有限公司 | 一种图像块划分方法及装置 |
WO2020135409A1 (zh) * | 2018-12-24 | 2020-07-02 | 华为技术有限公司 | 视频解码方法、装置及解码设备 |
CN111355951B (zh) * | 2018-12-24 | 2023-11-10 | 华为技术有限公司 | 视频解码方法、装置及解码设备 |
CN113316937B (zh) * | 2019-01-13 | 2024-01-02 | Lg 电子株式会社 | 处理视频信号的方法和设备 |
AU2020303803B2 (en) * | 2019-06-24 | 2023-12-07 | Lg Electronics Inc. | Image encoding/decoding method and device using maximum transform size restriction of chroma component encoding block, and method for transmitting bitstream |
US11375243B2 (en) * | 2019-07-17 | 2022-06-28 | Tencent America LLC | Method and apparatus for video coding |
CN113259663B (zh) * | 2021-06-08 | 2021-10-15 | 浙江华创视讯科技有限公司 | 一种图像块划分方法及装置 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005159947A (ja) * | 2003-11-28 | 2005-06-16 | Matsushita Electric Ind Co Ltd | 予測画像生成方法、画像符号化方法および画像復号化方法 |
CN101019435A (zh) * | 2004-09-08 | 2007-08-15 | 松下电器产业株式会社 | 动态图像编码方法及动态图像解码方法 |
CN101686395A (zh) * | 2005-07-21 | 2010-03-31 | Lg电子株式会社 | 对视频信号进行编码和解码的方法 |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3399747B1 (en) * | 2001-09-14 | 2021-05-12 | Ntt Docomo, Inc. | Decoding method |
CN101500161B (zh) * | 2008-01-31 | 2012-03-21 | 华为技术有限公司 | 基于自适应块变换的帧内预测方法及装置 |
KR101484280B1 (ko) * | 2009-12-08 | 2015-01-20 | 삼성전자주식회사 | 임의적인 파티션을 이용한 움직임 예측에 따른 비디오 부호화 방법 및 장치, 임의적인 파티션을 이용한 움직임 보상에 따른 비디오 복호화 방법 및 장치 |
PL3907999T3 (pl) * | 2010-09-02 | 2024-04-08 | Lg Electronics, Inc. | Predykcja międzyramkowa |
US8964833B2 (en) * | 2011-07-19 | 2015-02-24 | Qualcomm Incorporated | Deblocking of non-square blocks for video coding |
CN102970526B (zh) * | 2011-08-31 | 2016-12-14 | 华为技术有限公司 | 一种获得变换块尺寸的方法和模块 |
-
2012
- 2012-01-21 CN CN201210019843.7A patent/CN102970526B/zh active Active
- 2012-08-31 EP EP12827243.2A patent/EP2693751A4/en not_active Withdrawn
- 2012-08-31 EP EP16184019.4A patent/EP3157256B1/en active Active
- 2012-08-31 WO PCT/CN2012/080857 patent/WO2013029560A1/zh active Application Filing
-
2013
- 2013-12-30 US US14/144,059 patent/US9338454B2/en active Active
-
2016
- 2016-04-05 US US15/091,378 patent/US9609363B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2005159947A (ja) * | 2003-11-28 | 2005-06-16 | Matsushita Electric Ind Co Ltd | 予測画像生成方法、画像符号化方法および画像復号化方法 |
CN101019435A (zh) * | 2004-09-08 | 2007-08-15 | 松下电器产业株式会社 | 动态图像编码方法及动态图像解码方法 |
CN101686395A (zh) * | 2005-07-21 | 2010-03-31 | Lg电子株式会社 | 对视频信号进行编码和解码的方法 |
Non-Patent Citations (1)
Title |
---|
See also references of EP2693751A4 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113273203A (zh) * | 2018-12-22 | 2021-08-17 | 北京字节跳动网络技术有限公司 | 两步交叉分量预测模式 |
CN113273203B (zh) * | 2018-12-22 | 2024-03-12 | 北京字节跳动网络技术有限公司 | 两步交叉分量预测模式 |
Also Published As
Publication number | Publication date |
---|---|
EP2693751A1 (en) | 2014-02-05 |
EP3157256B1 (en) | 2019-10-09 |
US9338454B2 (en) | 2016-05-10 |
CN102970526B (zh) | 2016-12-14 |
US20140112593A1 (en) | 2014-04-24 |
US9609363B2 (en) | 2017-03-28 |
US20160219308A1 (en) | 2016-07-28 |
EP2693751A4 (en) | 2014-06-04 |
CN102970526A (zh) | 2013-03-13 |
EP3157256A1 (en) | 2017-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2013029560A1 (zh) | 一种获得变换块尺寸的方法和模块 | |
CN102957907B (zh) | 一种变换块位置信息的获取方法和模块 | |
JP6084730B2 (ja) | 映像復号化装置 | |
WO2014005500A1 (zh) | 变换块划分方法,变换块划分参数的编码方法及解码方法 | |
KR101365570B1 (ko) | 인트라 예측 부호화, 복호화 방법 및 장치 | |
WO2012122948A1 (zh) | 图像编解码方法、图像编解码设备及网络系统 | |
KR100727970B1 (ko) | 영상의 부호화 및 복호화 장치와, 그 방법, 및 이를수행하기 위한 프로그램이 기록된 기록 매체 | |
WO2012094921A1 (zh) | 多图像块划分的编解码方法和装置 | |
TW202205861A (zh) | 圖像解碼方法、圖像編碼方法及位元流 | |
KR20110112224A (ko) | 부호화 모드에 대한 정보를 부호화, 복호화하는 방법 및 장치 | |
WO2012167670A1 (zh) | 确定变换块尺寸的方法和设备 | |
JP2023025271A (ja) | 映像コーディングにおけるマトリクスベースのイントラ予測のための変換 | |
WO2015176607A1 (zh) | 图像编解码方法和设备、系统 | |
JP7431995B2 (ja) | 変換に基づく映像コーディング方法及びその装置 | |
JP2023501529A (ja) | 変換に基づく映像コーディング方法及びその装置 | |
JP2023500297A (ja) | 変換に基づく画像コーディング方法及びその装置 | |
RU2792225C2 (ru) | Способ и устройство обработки видеосигнала | |
KR101390195B1 (ko) | 인트라 예측 부호화, 복호화 방법 및 장치 |
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: 12827243 Country of ref document: EP Kind code of ref document: A1 |
|
REEP | Request for entry into the european phase |
Ref document number: 2012827243 Country of ref document: EP |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2012827243 Country of ref document: EP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |