WO2020087324A1 - Image coding method and apparatus, and electronic device - Google Patents
Image coding method and apparatus, and electronic device Download PDFInfo
- Publication number
- WO2020087324A1 WO2020087324A1 PCT/CN2018/112906 CN2018112906W WO2020087324A1 WO 2020087324 A1 WO2020087324 A1 WO 2020087324A1 CN 2018112906 W CN2018112906 W CN 2018112906W WO 2020087324 A1 WO2020087324 A1 WO 2020087324A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- coefficients
- scanning
- discrete cosine
- transform block
- rectangular
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
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/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/13—Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
Definitions
- Embodiments of the present invention relate to the field of video image technology, and in particular, to an image coding method, device, and electronic equipment.
- video coding also called image coding
- image coding standards
- CU coding unit
- CB Coding Block
- corresponding information such as prediction information, residual coefficients, etc.
- the CB can be further divided and transformed to form one or more transform units (TU, Transform Unit) or also called transform blocks (TB, Transform Block).
- TU Transform Unit
- TB Transform Block
- the CB may be divided into one or more TBs with the same size.
- a quadtree structure is adopted, and the height and width of each TB may be the same; that is, the TB may be square, and the size of the TB may be, for example, 2N ⁇ 2N, N ⁇ N, 1 / 2N ⁇ 1 / 2N (unit is, for example, pixel ⁇ pixel, or sampling point ⁇ sampling point), and so on.
- a quadtree plus binary tree (QTBT) structure may be used to replace the quadtree structure in HEVC, so the TB may be rectangular.
- embodiments of the present invention provide an image encoding method, device, and electronic device; capable of performing coefficient scanning for a rectangular TB, and further concentrating energy to improve encoding efficiency.
- an image encoding method including:
- the one-dimensionally arranged coefficients are mapped back to the rectangular transform block to form a two-dimensional matrix coefficient for encoding.
- an image encoding device including:
- a transforming part which performs a discrete cosine transform on the residual coefficients of the rectangular transform block and obtains two-dimensional discrete cosine transform matrix coefficients;
- a scanning part which scans the coefficients of the two-dimensional discrete cosine transform matrix according to the frequency to form a one-dimensional array of coefficients
- a mapping section that maps the one-dimensionally arranged coefficients back to the rectangular transform block to form a two-dimensional matrix coefficient for encoding.
- an electronic device including:
- An encoder comprising the image encoding device as described in the second aspect.
- a decoder that receives the bitstream of the image and decodes the image.
- the beneficial effects of the embodiments of the present invention are: the rectangular TB two-dimensional discrete cosine transform (DCT, Discrete Cosine Transform) matrix coefficients are scanned according to the frequency to form a one-dimensional array of coefficients; The coefficients are mapped back to the rectangular TB to form a two-dimensional matrix coefficient for encoding.
- DCT discrete cosine transform
- the coefficients are mapped back to the rectangular TB to form a two-dimensional matrix coefficient for encoding.
- FIG. 1 is a schematic diagram of an image coding method according to an embodiment of the present invention
- FIG. 2 is an example diagram of scanning based on a composite frequency according to an embodiment of the present invention
- FIG. 3 is an example diagram of scanning based on square division according to an embodiment of the present invention.
- FIG. 4 is an example diagram of scanning each sub-block based on the square TB shown in FIG. 3;
- FIG. 5 is another exemplary diagram of scanning based on square division according to an embodiment of the present invention.
- FIG. 6 is an example diagram of scanning each sub-block based on the square TB shown in FIG. 5;
- FIG. 7 is an example diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention.
- FIG. 8 is another exemplary diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention.
- FIG. 9 is another exemplary diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention.
- FIG. 10 is a schematic diagram of an image encoding device according to an embodiment of the present invention.
- FIG. 11 is a schematic diagram of an electronic device according to an embodiment of the invention.
- the terms “first”, “second”, etc. are used to distinguish different elements in terms of titles, but do not mean the spatial arrangement or chronological order of these elements, and these elements should not be used by these terms Restricted.
- the term “and / or” includes any and all combinations of one or more of the associated listed terms.
- the terms “comprising”, “including”, “having”, etc. refer to the presence of stated features, elements, elements or components, but do not exclude the presence or addition of one or more other features, elements, elements or components.
- FIG. 1 is a schematic diagram of an image encoding method according to an embodiment of the present invention, and a rectangular TB is described from the encoding end.
- the image coding method includes:
- Step 101 Perform a discrete cosine transform on the residual coefficients of the rectangular transform block and obtain two-dimensional discrete cosine transform matrix coefficients;
- Step 102 scanning the coefficients of the two-dimensional discrete cosine transform matrix according to the frequency to form a one-dimensional array of coefficients
- Step 103 Map the one-dimensionally arranged coefficients back to the rectangular transform block to form a two-dimensional matrix coefficient for encoding.
- a block to be coded may be subjected to prediction and other processes to obtain residual coefficients.
- the block to be coded may be divided into multiple rectangular TBs, and operations such as transformation and quantization may be performed for each rectangular TB;
- operations such as transformation and quantization may be performed for each rectangular TB;
- For a rectangular TB scanning process for details on how to divide the coded image and the residual coefficients and DCT, please refer to the related technology.
- the composite frequency of each coefficient may be calculated based on the horizontal and vertical frequency components of each coefficient based on the DCT matrix of the rectangular TB; and according to the composite frequency from low to high Scan the two-dimensional DCT matrix coefficients sequentially.
- FIG. 2 is an example diagram of scanning based on a composite frequency according to an embodiment of the present invention, taking 8 ⁇ 4 TB as an example for description.
- the rectangular TB can be scanned according to the order of the composite frequency from low to high, so that the corresponding energy is sorted from high to low, and the energy can be further concentrated to improve the coding efficiency.
- the above uses the sum of the horizontal frequency component and the vertical frequency component as an example to calculate the composite frequency, but the invention is not limited to this, for example, it can also be appropriately transformed, and the horizontal frequency component and the vertical frequency component can be multiplied, Or they can be added after weighting, etc., and other calculation methods can also be included.
- the rectangular TB may be divided into the same number of sub-blocks in the horizontal direction and the vertical direction; the plurality of sub-blocks are scanned in a square TB scanning manner; and in In each of the sub-blocks, the two-dimensional DCT matrix coefficients are scanned according to the frequency.
- the scanning method of the square TB may include one of the following: diagonal scanning, horizontal scanning, and vertical scanning.
- a 2 M ⁇ 2 N rectangular transform block can be divided into 2 M ⁇ 2 M sub-blocks of 1 ⁇ 2 NM , where M ⁇ N, M and N are positive integers respectively; the 2 M ⁇ 2 M The sub-blocks are scanned according to the scanning method of the square transform block, and the two-dimensional DCT matrix coefficients are scanned vertically in each of the 1 ⁇ 2 NM sub-blocks.
- the 4 ⁇ 8 TB may be divided into 4 ⁇ 4 sub-blocks, and each sub-block is 1 ⁇ 2. Therefore, as shown in FIG. 3, for the 4 ⁇ 4 sub-blocks, for example, scanning can be performed in a diagonal scanning manner.
- FIG. 4 is an example diagram of scanning each sub-block based on the square TB shown in FIG. 3. As shown in FIG. 4, within each 1 ⁇ 2 sub-block, the coefficients can be scanned in a vertical manner . That is, scanning is still performed in order from low frequency to high frequency.
- a 2 M ⁇ 2 N rectangular transform block may be divided into 2 N ⁇ 2 N sub-blocks of 2 MN ⁇ 1, where M> N, M and N are positive integers respectively; the 2 N ⁇ 2 The N sub-blocks are scanned according to the scanning method of the square transform block, and the two-dimensional DCT matrix coefficients are scanned horizontally within each of the 2 MN ⁇ 1 sub-blocks.
- the 8 ⁇ 4 TB can be divided into 4 ⁇ 4 sub-blocks, and each sub-block is 2 ⁇ 1. Therefore, as shown in FIG. 4, the 4 ⁇ 4 sub-blocks can be scanned in a diagonal scan manner, for example.
- FIG. 6 is an example diagram of scanning each sub-block based on the square TB shown in FIG. 5. As shown in FIG. 6, within each 2 ⁇ 1 sub-block, the coefficients can be scanned in a horizontal manner . That is, scanning is still performed in order from low frequency to high frequency.
- step 103 the one-dimensionally arranged coefficients are mapped back to rectangular TB blocks.
- the encoding direction of the coefficients in the rectangular transform block can be determined; according to the encoding direction of the coefficients in the rectangular transform block, the one-dimensionally arranged coefficients are mapped back into the rectangular transform block to form a
- the two-dimensional matrix coefficients are described.
- it can be further divided into, for example, 4 ⁇ 4 transform sub-blocks (TSB, Transform Sub-Block).
- the coding direction of the coefficients in the rectangular transform block may be determined by the intra prediction mode; the coding direction includes one of the following: diagonal direction, horizontal direction, and vertical direction.
- the intra prediction mode and how to determine the encoding direction please refer to related technologies.
- FIG. 7 is an example diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention, taking 16 ⁇ 8 TB as an example for description. As shown in FIG. 7, for example, for each 4 ⁇ 4 TSB, the mapping is performed in a horizontal manner; while the TSBs are still mapped in a horizontal manner. Therefore, the one-dimensionally arranged coefficients formed in step 102 can be mapped back to the rectangular transform block in a horizontal scanning manner to form a two-dimensional matrix coefficient for encoding.
- FIG. 8 is another exemplary diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention, taking 16 ⁇ 8 TB as an example for description.
- the mapping is performed in a vertical manner; while the TSBs are still mapped in a vertical manner. Therefore, the one-dimensionally arranged coefficients formed in step 102 can be mapped back to the rectangular transform block in a vertical scan to form a two-dimensional matrix coefficient for encoding.
- FIG. 9 is another exemplary diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention, taking 16 ⁇ 8 TB as an example for description. As shown in FIG. 9, for example, for each 4 ⁇ 4 TSB, the mapping is performed diagonally; while the TSBs are still mapped diagonally. Therefore, the one-dimensionally arranged coefficients formed in step 102 can be mapped back to the rectangular transform block in a diagonal scan to form a two-dimensional matrix coefficient for encoding.
- bitstream coding of image information such as prediction information and residual coefficients in the image region to be coded can be implemented by any scheme in the related art, and the present invention does not limit this.
- the above uses only one rectangular TB as an example to illustrate the present invention.
- the above steps can be used for encoding. Only the steps or processes related to the present invention have been described above, but the present invention is not limited to this.
- the image coding method may further include other steps or processes. For the specific content of these steps or processes, reference may be made to the prior art.
- the bit stream can be received at the decoding end and decoded accordingly, which will not be repeated here.
- the two-dimensional DCT matrix coefficients of the rectangular TB are scanned according to the frequency to form a one-dimensional array of coefficients; Coefficients of the two-dimensional matrix.
- the coefficient scan be performed on the rectangular transform block, but also the energy can be further concentrated to improve the coding efficiency.
- An embodiment of the present invention provides an image encoding device.
- the apparatus may be, for example, an electronic device used for image processing or video processing, or may be one or some components or components disposed in the electronic device.
- the same content of this embodiment 2 as that of embodiment 1 will not be repeated here.
- FIG. 10 is a schematic diagram of an image encoding device according to an embodiment of the present invention. As shown in FIG. 10, the image encoding device 1000 includes:
- a transform unit 1001 which performs a discrete cosine transform on the residual coefficients of the rectangular transform block and obtains two-dimensional discrete cosine transform matrix coefficients;
- a scanning unit 1002 which scans the two-dimensional discrete cosine transform matrix coefficients according to the frequency to form a one-dimensional array of coefficients;
- the mapping section 1003 maps the one-dimensionally arranged coefficients back to the rectangular transform block to form two-dimensional matrix coefficients for encoding.
- the scanning unit 1002 is configured to: based on the discrete cosine transform matrix of the rectangular transform block, calculate the composite frequency of the coefficients according to the horizontal frequency component and the vertical frequency component of each coefficient; and according to the The two-dimensional discrete cosine transform matrix coefficients are scanned in order from low to high composite frequency.
- the scanning unit 1002 is used to: divide the rectangular transform block into a plurality of sub-blocks with the same number in the horizontal direction and the vertical direction; Block scanning; and within each of the sub-blocks, the two-dimensional discrete cosine transform matrix coefficients are scanned according to the size of the frequency.
- the scanning method of the square transform block may include one of the following: diagonal scanning, horizontal scanning, and vertical scanning.
- the image encoding device 1000 may further include:
- the direction determining section 1004 which determines the encoding direction of the coefficients in the rectangular transform block
- mapping unit 1003 may map the one-dimensionally arranged coefficients back to the rectangular transform block according to the encoding direction of the coefficients in the rectangular transform block to form the two-dimensional matrix coefficients.
- FIG. 10 only exemplarily shows the connection relationship or signal direction between the various components or modules, but those skilled in the art should understand that various related technologies such as bus connection may be used.
- the above-mentioned various components or modules may be implemented by hardware facilities such as a processor and a memory; the implementation of the present invention does not limit this.
- the image encoding device 1000 may further include other components or modules. For specific contents of these components or modules, reference may be made to related technologies.
- the two-dimensional DCT matrix coefficients of the rectangular TB are scanned according to the frequency to form a one-dimensional array of coefficients; and the one-dimensional array of coefficients is mapped back to the rectangular TB to form a code for encoding Coefficients of the two-dimensional matrix.
- the coefficient scan be performed on the rectangular transform block, but also the energy can be further concentrated to improve the coding efficiency.
- An embodiment of the present invention also provides an electronic device that performs image processing or video processing, including an encoder and a decoder.
- the encoder includes the image encoding device as described in Embodiment 2.
- the electronic device 1100 may include: a processor 1101 and a memory 1102;
- the memory 1102 can store various data; in addition, an information processing program 1103 is stored, and the program 1103 is executed under the control of the processor 1101.
- the electronic device 1100 may be used as an encoder, and the functions of the image encoding device 1000 may be integrated into the processor 1101.
- the processor 1101 may be configured to implement the image coding method described in Embodiment 1.
- the processor 1101 may be configured to perform the following control: perform discrete cosine transform on the residual coefficients of the rectangular transform block and obtain two-dimensional discrete cosine transform matrix coefficients; and convert the two-dimensional discrete cosine transform matrix coefficients according to the frequency Scanning to form one-dimensionally arranged coefficients; and mapping the one-dimensionally arranged coefficients back to the rectangular transform block to form two-dimensional matrix coefficients for encoding.
- the processor 1101 may be further configured to perform the following control: based on the discrete cosine transform matrix of the rectangular transform block, calculate the composite frequency of each coefficient according to the horizontal frequency component and the vertical frequency component of each coefficient And scanning the two-dimensional discrete cosine transform matrix coefficients in the order of the composite frequency from low to high.
- the processor 1101 may be further configured to perform the following control: divide the rectangular transform block into a plurality of sub-blocks with the same number in the horizontal direction and the vertical direction; follow the scanning method of the square transform block Scanning the plurality of sub-blocks; and within each of the sub-blocks, scanning the two-dimensional discrete cosine transform matrix coefficients according to the size of the frequency.
- the 2 M ⁇ 2 N rectangular transform block is divided into 2 M ⁇ 2 M sub-blocks of 1 ⁇ 2 NM , M ⁇ N, M and N are positive integers; the 2 M ⁇ 2 M sub-blocks Scan according to the scanning mode of the square transform block, and scan the two-dimensional discrete cosine transform matrix coefficients in a vertical manner within each of the 1 ⁇ 2 NM sub-blocks.
- the 2 M ⁇ 2 N rectangular transform block is divided into 2 N ⁇ 2 N sub-blocks of 2 MN ⁇ 1, M> N, M and N are positive integers; the 2 N ⁇ 2 N sub-blocks The block is scanned according to the scanning method of the square transform block, and the two-dimensional discrete cosine transform matrix coefficients are scanned horizontally within each of the 2 MN ⁇ 1 sub-blocks.
- the scanning method of the square transform block includes one of the following: diagonal scanning, horizontal scanning, and vertical scanning.
- the processor 1101 may be further configured to perform the following control: determine the encoding direction of the coefficients in the rectangular transform block; and arrange the one-dimensional arrangement according to the encoding direction of the coefficients in the rectangular transform block The coefficients of are mapped back into the rectangular transform block to form the two-dimensional matrix coefficients.
- the coding direction of the coefficients in the rectangular transform block is determined by the intra prediction mode; the coding direction includes one of the following: diagonal direction, horizontal direction, and vertical direction.
- the electronic device 1100 may further include: an input / output (I / O) device 1104, a display 1105, and the like; wherein, the functions of the above components are similar to those in the prior art, and will not be repeated here. It is worth noting that the electronic device 1100 does not necessarily include all the components shown in FIG. 11; in addition, the electronic device 1100 may also include components not shown in FIG. 11, and reference may be made to related technologies.
- I / O input / output
- An embodiment of the present invention provides a computer-readable program, wherein when the program is executed in an encoder or an electronic device, the program causes the encoder or the electronic device to execute the image encoding method as described in Embodiment 1.
- An embodiment of the present invention provides a storage medium storing a computer-readable program, where the computer-readable program causes an encoder or an electronic device to execute the image encoding method as described in Embodiment 1.
- the above device and method of the present invention may be implemented by hardware, or may be implemented by hardware in combination with software.
- the present invention relates to such a computer-readable program which, when executed by a logic component, enables the logic component to implement the above-described device or component, or enables the logic component to implement the various methods described above Or steps.
- the invention also relates to storage media for storing the above programs, such as hard disks, magnetic disks, optical disks, DVDs, flash memories, and so on.
- the method / device described in conjunction with the embodiments of the present invention may be directly embodied as hardware, a software module executed by a processor, or a combination of both.
- one or more of the functional block diagrams and / or one or more combinations of the functional block diagrams shown in the figures may correspond to each software module of the computer program flow or each hardware module.
- These software modules can respectively correspond to the steps shown in the figure.
- These hardware modules can be realized by solidifying these software modules using a field programmable gate array (FPGA), for example.
- FPGA field programmable gate array
- the software module may be located in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
- a storage medium may be coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium; or the storage medium may be an integral part of the processor.
- the processor and the storage medium may be located in the ASIC.
- the software module can be stored in the memory of the mobile terminal or in a memory card that can be inserted into the mobile terminal.
- the software module may be stored in the MEGA-SIM card or a larger-capacity flash memory device.
- the functional blocks described in the drawings and / or one or more combinations of the functional blocks it may be implemented as a general-purpose processor, digital signal processor (DSP) for performing the functions described in the present invention ), Application specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or any suitable combination thereof.
- DSP digital signal processor
- ASIC Application specific integrated circuit
- FPGA field programmable gate array
- One or more of the functional blocks described in the drawings and / or one or more combinations of the functional blocks can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessing Processor, one or more microprocessors in communication with the DSP, or any other such configuration.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
本发明实施例涉及视频图像技术领域,特别涉及一种图像编码方法、装置以及电子设备。Embodiments of the present invention relate to the field of video image technology, and in particular, to an image coding method, device, and electronic equipment.
在视频编码(也可称为图像编码)标准(例如MPEG 2,H.264/AVC,H.265/HEVC,等等)中,对于待编码图像区域,例如一个编码单元(CU,coding Unit)或者也可称为编码块(CB,Coding Block),可以将相应的信息(例如预测信息、残差系数等)进行比特流编码,由此可以减少编码的比特代价(bit cost)。In video coding (also called image coding) standards (such as MPEG2, H.264 / AVC, H.265 / HEVC, etc.), for the image area to be coded, such as a coding unit (CU, coding Unit) Or it may also be called a coding block (CB, Coding Block), and corresponding information (such as prediction information, residual coefficients, etc.) may be bitstream encoded, thereby reducing the bit cost of encoding.
目前为了进一步降低比特代价,可以将CB进行进一步划分并变换,形成一个或多个变换单元(TU,Transform Unit)或者也可称为变换块(TB,Transform Block)。例如,可以将CB划分为一个或多个具有相同大小的TB。At present, in order to further reduce the bit cost, the CB can be further divided and transformed to form one or more transform units (TU, Transform Unit) or also called transform blocks (TB, Transform Block). For example, the CB may be divided into one or more TBs with the same size.
在HEVC中,例如采用四叉树(quadtree)结构,每个TB的高度和宽度可以相同;即TB可以呈正方形,TB的大小(size)例如可以为:2N×2N、N×N、1/2N×1/2N(单位例如为像素×像素,或者采样点×采样点),等等。在未来的视频编码技术中,例如可能采用四叉树加二叉树(QTBT,quadtree plus binary tree)结构来代替HEVC中的四叉树结构,因此TB可以呈矩形。In HEVC, for example, a quadtree structure is adopted, and the height and width of each TB may be the same; that is, the TB may be square, and the size of the TB may be, for example, 2N × 2N, N × N, 1 / 2N × 1 / 2N (unit is, for example, pixel × pixel, or sampling point × sampling point), and so on. In the future video coding technology, for example, a quadtree plus binary tree (QTBT) structure may be used to replace the quadtree structure in HEVC, so the TB may be rectangular.
应该注意,上面对技术背景的介绍只是为了方便对本发明的技术方案进行清楚、完整的说明,并方便本领域技术人员的理解而阐述的。不能仅仅因为这些方案在本发明的背景技术部分进行了阐述而认为上述技术方案为本领域技术人员所公知。It should be noted that the above introduction to the technical background is set forth only to facilitate a clear and complete description of the technical solution of the present invention and to facilitate understanding by those skilled in the art. It cannot be considered that these technical solutions are known to those skilled in the art simply because these solutions are described in the background of the present invention.
发明内容Summary of the invention
发明人发现:目前还没有针对矩形TB进行扫描并形成用于编码的系数的方案。如果仍然采用正方形TB的扫描方式,则有可能会出现能量不够集中,而导致编码效率较低的情况。The inventor found that at present, there is no scheme for scanning a rectangular TB and forming coefficients for encoding. If the square TB scanning method is still used, there may be a situation where the energy is not concentrated enough, resulting in a low coding efficiency.
针对上述问题的至少之一,本发明实施例提供一种图像编码方法、装置以及电子设备;能够针对矩形TB进行系数扫描,并且进一步集中能量从而提升编码效率。To address at least one of the above problems, embodiments of the present invention provide an image encoding method, device, and electronic device; capable of performing coefficient scanning for a rectangular TB, and further concentrating energy to improve encoding efficiency.
根据本发明实施例的第一个方面,提供一种图像编码方法,包括:According to a first aspect of the embodiments of the present invention, an image encoding method is provided, including:
对矩形变换块的残差系数进行离散余弦变换并获得二维离散余弦变换矩阵系数;Perform a discrete cosine transform on the residual coefficients of the rectangular transform block and obtain two-dimensional discrete cosine transform matrix coefficients;
将所述二维离散余弦变换矩阵系数按照频率的大小进行扫描,以形成一维排列的系数;以及Scanning the coefficients of the two-dimensional discrete cosine transform matrix according to the frequency to form a one-dimensional array of coefficients; and
将所述一维排列的系数映射回所述矩形变换块以形成用于编码的二维矩阵系数。The one-dimensionally arranged coefficients are mapped back to the rectangular transform block to form a two-dimensional matrix coefficient for encoding.
根据本发明实施例的第二个方面,提供一种图像编码装置,包括:According to a second aspect of the embodiments of the present invention, an image encoding device is provided, including:
变换部,其对矩形变换块的残差系数进行离散余弦变换并获得二维离散余弦变换矩阵系数;A transforming part, which performs a discrete cosine transform on the residual coefficients of the rectangular transform block and obtains two-dimensional discrete cosine transform matrix coefficients;
扫描部,其将所述二维离散余弦变换矩阵系数按照频率的大小进行扫描,以形成一维排列的系数;以及A scanning part which scans the coefficients of the two-dimensional discrete cosine transform matrix according to the frequency to form a one-dimensional array of coefficients; and
映射部,其将所述一维排列的系数映射回所述矩形变换块以形成用于编码的二维矩阵系数。A mapping section that maps the one-dimensionally arranged coefficients back to the rectangular transform block to form a two-dimensional matrix coefficient for encoding.
根据本发明实施例的第三个方面,提供一种电子设备,包括:According to a third aspect of the embodiments of the present invention, an electronic device is provided, including:
编码器,其包括如第二方面所述的图像编码装置;以及An encoder comprising the image encoding device as described in the second aspect; and
解码器,其接收图像的比特流并且对所述图像进行解码。A decoder that receives the bitstream of the image and decodes the image.
本发明实施例的有益效果在于:将矩形TB的二维离散余弦变换(DCT,Discrete Cosine Transform)矩阵系数按照频率的大小进行扫描,以形成一维排列的系数;以及将所述一维排列的系数映射回所述矩形TB以形成用于编码的二维矩阵系数。由此,不仅能够针对矩形变换块进行系数扫描,而且能进一步集中能量从而提升编码效率。The beneficial effects of the embodiments of the present invention are: the rectangular TB two-dimensional discrete cosine transform (DCT, Discrete Cosine Transform) matrix coefficients are scanned according to the frequency to form a one-dimensional array of coefficients; The coefficients are mapped back to the rectangular TB to form a two-dimensional matrix coefficient for encoding. Thus, not only can the coefficient scan be performed on the rectangular transform block, but also the energy can be further concentrated to improve the coding efficiency.
参照后文的说明和附图,详细公开了本发明的特定实施方式,指明了本发明的原理可以被采用的方式。应该理解,本发明的实施方式在范围上并不因而受到限制。在所附权利要求的精神和条款的范围内,本发明的实施方式包括许多改变、修改和等同。With reference to the following description and drawings, specific embodiments of the present invention are disclosed in detail, and the manner in which the principles of the present invention can be adopted is indicated. It should be understood that the embodiments of the present invention are not thus limited in scope. Within the scope of the spirit and terms of the appended claims, the embodiments of the present invention include many changes, modifications, and equivalents.
针对一种实施方式描述和/或示出的特征可以以相同或类似的方式在一个或更多个其它实施方式中使用,与其它实施方式中的特征相组合,或替代其它实施方式中的特征。Features described and / or illustrated for one embodiment may be used in one or more other embodiments in the same or similar manner, combined with features in other embodiments, or substituted for features in other embodiments .
应该强调,术语“包括/包含”在本文使用时指特征、整件、步骤或组件的存在,但并不排除一个或更多个其它特征、整件、步骤或组件的存在或附加。It should be emphasized that the term "comprising / comprising" as used herein refers to the presence of features, whole pieces, steps or components, but does not exclude the presence or addition of one or more other features, whole pieces, steps or components.
在本发明实施例的一个附图或一种实施方式中描述的元素和特征可以与一个或更多个其它附图或实施方式中示出的元素和特征相结合。此外,在附图中,类似的标号表示几个附图中对应的部件,并可用于指示多于一种实施方式中使用的对应部件。Elements and features described in one drawing or one embodiment of the embodiments of the present invention may be combined with elements and features shown in one or more other drawings or embodiments. Furthermore, in the drawings, similar reference numerals indicate corresponding parts in several drawings, and may be used to indicate corresponding parts used in more than one embodiment.
图1是本发明实施例的图像编码方法的示意图;FIG. 1 is a schematic diagram of an image coding method according to an embodiment of the present invention;
图2是本发明实施例的基于复合频率进行扫描的一示例图;2 is an example diagram of scanning based on a composite frequency according to an embodiment of the present invention;
图3是本发明实施例的基于正方形划分进行扫描的一示例图;3 is an example diagram of scanning based on square division according to an embodiment of the present invention;
图4是基于如图3所示的正方形TB对每个子块进行扫描的一示例图;FIG. 4 is an example diagram of scanning each sub-block based on the square TB shown in FIG. 3;
图5是本发明实施例的基于正方形划分进行扫描的另一示例图;5 is another exemplary diagram of scanning based on square division according to an embodiment of the present invention;
图6是基于如图5所示的正方形TB对每个子块进行扫描的一示例图;FIG. 6 is an example diagram of scanning each sub-block based on the square TB shown in FIG. 5;
图7是本发明实施例的将一维系数映射回矩形TB的一示例图;7 is an example diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention;
图8是本发明实施例的将一维系数映射回矩形TB的另一示例图;8 is another exemplary diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention;
图9是本发明实施例的将一维系数映射回矩形TB的另一示例图;9 is another exemplary diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention;
图10是本发明实施例的图像编码装置的示意图;10 is a schematic diagram of an image encoding device according to an embodiment of the present invention;
图11是本发明实施例的电子设备的示意图。11 is a schematic diagram of an electronic device according to an embodiment of the invention.
参照附图,通过下面的说明书,本发明的前述以及其它特征将变得明显。在说明书和附图中,具体公开了本发明的特定实施方式,其表明了其中可以采用本发明的原则的部分实施方式,应了解的是,本发明不限于所描述的实施方式,相反,本发明包括落入所附权利要求的范围内的全部修改、变型以及等同物。The foregoing and other features of the present invention will become apparent from the following description with reference to the drawings. In the specification and the drawings, specific embodiments of the present invention are disclosed in detail, which show some of the embodiments in which the principles of the present invention can be adopted. It should be understood that the present invention is not limited to the described embodiments. The invention includes all modifications, variations, and equivalents falling within the scope of the appended claims.
在本发明实施例中,术语“第一”、“第二”等用于对不同元素从称谓上进行区分,但并不表示这些元素的空间排列或时间顺序等,这些元素不应被这些术语所限制。术语“和/或”包括相关联列出的术语的一种或多个中的任何一个和所有组合。术语“包含”、“包括”、“具有”等是指所陈述的特征、元素、元件或组件的存在,但并不排除存在或添加一个或多个其他特征、元素、元件或组件。In the embodiments of the present invention, the terms "first", "second", etc. are used to distinguish different elements in terms of titles, but do not mean the spatial arrangement or chronological order of these elements, and these elements should not be used by these terms Restricted. The term "and / or" includes any and all combinations of one or more of the associated listed terms. The terms "comprising", "including", "having", etc. refer to the presence of stated features, elements, elements or components, but do not exclude the presence or addition of one or more other features, elements, elements or components.
在本发明实施例中,单数形式“一”、“该”等包括复数形式,应广义地理解为“一种”或“一类”而并不是限定为“一个”的含义;此外术语“所述”应理解为既包括单数形式也包括复数形式,除非上下文另外明确指出。此外术语“根据”应理解为“至少部分根据……”,术语“基于”应理解为“至少部分基于……”,除非上下 文另外明确指出。In the embodiments of the present invention, the singular forms "a", "the", etc. include plural forms, which should be broadly understood as "a" or "a class" rather than being limited to the meaning of "a"; in addition, the term "Description" should be understood to include both singular and plural forms unless the context clearly indicates otherwise. In addition, the term "based on" should be understood as "based at least in part on ..." and the term "based on" should be understood as "based at least in part on" unless the context clearly indicates otherwise.
实施例1Example 1
本发明实施例提供一种图像编码方法。图1是本发明实施例的图像编码方法的示意图,从编码端对一个矩形TB进行说明。如图1所示,该图像编码方法包括:An embodiment of the present invention provides an image coding method. FIG. 1 is a schematic diagram of an image encoding method according to an embodiment of the present invention, and a rectangular TB is described from the encoding end. As shown in FIG. 1, the image coding method includes:
步骤101,对矩形变换块的残差系数进行离散余弦变换并获得二维离散余弦变换矩阵系数;Step 101: Perform a discrete cosine transform on the residual coefficients of the rectangular transform block and obtain two-dimensional discrete cosine transform matrix coefficients;
步骤102,将所述二维离散余弦变换矩阵系数按照频率的大小进行扫描,以形成一维排列的系数;以及
步骤103,将所述一维排列的系数映射回所述矩形变换块以形成用于编码的二维矩阵系数。Step 103: Map the one-dimensionally arranged coefficients back to the rectangular transform block to form a two-dimensional matrix coefficient for encoding.
在一个实施例中,可以对一个待编码块进行预测等处理获得残差系数,此外可以将待编码块划分为多个矩形TB,针对各矩形TB可以进行变换和量化等运算;本发明实施例针对一个矩形TB进行扫描处理,具体如何对待编码图像进行划分以及残差系数和DCT等内容,可以参考相关技术。In an embodiment, a block to be coded may be subjected to prediction and other processes to obtain residual coefficients. In addition, the block to be coded may be divided into multiple rectangular TBs, and operations such as transformation and quantization may be performed for each rectangular TB; For a rectangular TB scanning process, for details on how to divide the coded image and the residual coefficients and DCT, please refer to the related technology.
在一个实施例中,在步骤102中,可以基于矩形TB的DCT矩阵,根据每个系数的水平频率分量和垂直频率分量计算所述系数的复合频率;以及按照所述复合频率从低到高的顺序对所述二维DCT矩阵系数进行扫描。In one embodiment, in
例如,对于M×N的DCT矩阵,所述系数的水平频率分量I(u)和垂直频率分量J(v)分别为: u=0,...,M,v=0,...,N;其中,所述复合频率为所述水平频率分量和所述垂直频率分量之和;M和N分别为正整数。 For example, for an M × N DCT matrix, the horizontal frequency component I (u) and vertical frequency component J (v) of the coefficients are: u = 0, ..., M, v = 0, ..., N; where the composite frequency is the sum of the horizontal frequency component and the vertical frequency component; M and N are positive integers, respectively.
图2是本发明实施例的基于复合频率进行扫描的一示例图,以8×4的TB为例进行说明。例如,图2中的“5”所对应的复合频率为1/16+1/8=3/16,“6”所对应的复合频率为3/16+0=3/16,“7”所对应的复合频率为0+1/4=4/16,“8”所对应的复合频率为1/8+1/8=4/16,“9”所对应的复合频率为1/4+0=4/16,“10”所对应的复合频率为1/16+1/4=5/16,……。FIG. 2 is an example diagram of scanning based on a composite frequency according to an embodiment of the present invention, taking 8 × 4 TB as an example for description. For example, the composite frequency corresponding to "5" in Figure 2 is 1/16 + 1/8 = 3/16, the composite frequency corresponding to "6" is 3/16 + 0 = 3/16, and the composite frequency corresponding to "7" The corresponding composite frequency is 0 + 1/4 = 4/16, the composite frequency corresponding to "8" is 1/8 + 1/8 = 4/16, and the composite frequency corresponding to "9" is 1/4 + 0 = 4/16, the composite frequency corresponding to "10" is 1/16 + 1/4 = 5/16, ...
如果计算出的复合频率相同,则可以按照由左下到右上的顺序进行扫描。如图2所示,“5”所对应的复合频率和“6”所对应的复合频率均为3/16,则先扫描“5”再扫描“6”;“7”所对应的复合频率、“8”所对应的复合频率和“9”所对应的复合频 率均为4/16,则先扫描“7”再扫描“8”后扫描“9”;……,以此类推;因此扫描方式可以如图2所示。If the calculated composite frequencies are the same, you can scan in the order from lower left to upper right. As shown in Figure 2, the composite frequency corresponding to "5" and the composite frequency corresponding to "6" are both 3/16, then scan "5" before scanning "6"; the composite frequency corresponding to "7", Both the composite frequency corresponding to "8" and the composite frequency corresponding to "9" are 4/16, then scan "7" and then "8" and then "9"; ..., and so on; therefore the scanning method Can be shown in Figure 2.
由此,能够根据复合频率从低到高的顺序对矩形TB进行扫描,从而对应的能量从高到低被排序,能够进一步集中能量从而提升编码效率。Thus, the rectangular TB can be scanned according to the order of the composite frequency from low to high, so that the corresponding energy is sorted from high to low, and the energy can be further concentrated to improve the coding efficiency.
值得注意的是,以上以水平频率分量和垂直频率分量之和为例计算复合频率,但本发明不限于此,例如也可以适当地进行变换,可以将水平频率分量和垂直频率分量进行相乘,或者加权后再相加,等等,还可以包括其他的运算方式。It is worth noting that the above uses the sum of the horizontal frequency component and the vertical frequency component as an example to calculate the composite frequency, but the invention is not limited to this, for example, it can also be appropriately transformed, and the horizontal frequency component and the vertical frequency component can be multiplied, Or they can be added after weighting, etc., and other calculation methods can also be included.
在一个实施例中,在步骤102中,可以将矩形TB划分为在水平方向上和垂直方向上的数量相同的多个子块;按照正方形TB的扫描方式对所述多个子块进行扫描;以及在每个所述子块内,将所述二维DCT矩阵系数按照频率的大小进行扫描。其中,所述正方形TB的扫描方式可以包括如下之一:对角扫描、水平扫描、垂直扫描。In one embodiment, in
例如,可以将2 M×2 N的矩形变换块划分为2 M×2 M个1×2 N-M的子块,其中M<N,M和N分别为正整数;将所述2 M×2 M个子块按照正方形变换块的扫描方式进行扫描,并且在每个所述1×2 N-M子块内按照垂直方式对所述二维DCT矩阵系数进行扫描。 For example, a 2 M × 2 N rectangular transform block can be divided into 2 M × 2 M sub-blocks of 1 × 2 NM , where M <N, M and N are positive integers respectively; the 2 M × 2 M The sub-blocks are scanned according to the scanning method of the square transform block, and the two-dimensional DCT matrix coefficients are scanned vertically in each of the 1 × 2 NM sub-blocks.
图3是本发明实施例的基于正方形划分进行扫描的一示例图,以4×8(即M=2,N=3)的TB为例进行说明。如图3所示,可以将该4×8的TB划分为4×4个子块,每个子块为1×2。因此,如图3所示,对于该4×4个子块,例如可以按照对角扫描的方式进行扫描。FIG. 3 is an example diagram of scanning based on square division according to an embodiment of the present invention, taking 4 × 8 (ie, M = 2, N = 3) TB as an example for description. As shown in FIG. 3, the 4 × 8 TB may be divided into 4 × 4 sub-blocks, and each sub-block is 1 × 2. Therefore, as shown in FIG. 3, for the 4 × 4 sub-blocks, for example, scanning can be performed in a diagonal scanning manner.
图4是基于如图3所示的正方形TB对每个子块进行扫描的一示例图,如图4所示,在每个1×2的子块内,可以按照垂直方式对所述系数进行扫描。即,仍然是按照从低频到高频的顺序进行扫描。FIG. 4 is an example diagram of scanning each sub-block based on the square TB shown in FIG. 3. As shown in FIG. 4, within each 1 × 2 sub-block, the coefficients can be scanned in a vertical manner . That is, scanning is still performed in order from low frequency to high frequency.
由此,能够基于正方形TB划分进行扫描,无需计算复合频率就能够以频率从低到高的顺序对矩形TB进行扫描,从而对应的能量从高到低被排序,能够进一步集中能量从而提升编码效率。As a result, it is possible to scan based on the square TB division, and the rectangular TB can be scanned from low to high frequency without calculating the composite frequency, so that the corresponding energy is sorted from high to low, and the energy can be further concentrated to improve coding efficiency. .
再例如,可以将2 M×2 N的矩形变换块划分为2 N×2 N个2 M-N×1的子块,其中M>N,M和N分别为正整数;将所述2 N×2 N个子块按照正方形变换块的扫描方式进行扫描,并且在每个所述2 M-N×1子块内按照水平方式对所述二维DCT矩阵系数进行扫描。 For another example, a 2 M × 2 N rectangular transform block may be divided into 2 N × 2 N sub-blocks of 2 MN × 1, where M> N, M and N are positive integers respectively; the 2 N × 2 The N sub-blocks are scanned according to the scanning method of the square transform block, and the two-dimensional DCT matrix coefficients are scanned horizontally within each of the 2 MN × 1 sub-blocks.
图5是本发明实施例的基于正方形划分进行扫描的另一示例图,以8×4(即M= 3,N=2)的TB为例进行说明。如图5所示,可以将该8×4的TB划分为4×4个子块,每个子块为2×1。因此,如图4所示,对于该4×4个子块,例如可以按照对角扫描的方式进行扫描。FIG. 5 is another exemplary diagram of scanning based on square division according to an embodiment of the present invention, taking 8 × 4 (ie, M = 3, N = 2) TB as an example for description. As shown in FIG. 5, the 8 × 4 TB can be divided into 4 × 4 sub-blocks, and each sub-block is 2 × 1. Therefore, as shown in FIG. 4, the 4 × 4 sub-blocks can be scanned in a diagonal scan manner, for example.
图6是基于如图5所示的正方形TB对每个子块进行扫描的一示例图,如图6所示,在每个2×1的子块内,可以按照水平方式对所述系数进行扫描。即,仍然是按照从低频到高频的顺序进行扫描。FIG. 6 is an example diagram of scanning each sub-block based on the square TB shown in FIG. 5. As shown in FIG. 6, within each 2 × 1 sub-block, the coefficients can be scanned in a horizontal manner . That is, scanning is still performed in order from low frequency to high frequency.
由此,能够基于正方形TB划分进行扫描,无需计算复合频率就能够以频率从低到高的顺序对矩形TB进行扫描,从而对应的能量从高到低被排序,能够进一步集中能量从而提升编码效率。As a result, it is possible to scan based on the square TB division, and the rectangular TB can be scanned from low to high frequency without calculating the composite frequency, so that the corresponding energy is sorted from high to low, and the energy can be further concentrated to improve coding efficiency. .
以上对如何将二维DCT矩阵系数扫描为一维排列的系数进行了示意性说明,以下对步骤103中将一维排列的系数映射回矩形TB块进行说明。The above has illustrated how to scan the two-dimensional DCT matrix coefficients into one-dimensionally arranged coefficients. In the following, in
在一个实施例中,可以确定所述矩形变换块中系数的编码方向;按照所述矩形变换块中系数的编码方向,将所述一维排列的系数映射回所述矩形变换块中以形成所述二维矩阵系数。由此,可以进一步划分为例如4×4的变换子块(TSB,Transform Sub-Block)。In one embodiment, the encoding direction of the coefficients in the rectangular transform block can be determined; according to the encoding direction of the coefficients in the rectangular transform block, the one-dimensionally arranged coefficients are mapped back into the rectangular transform block to form a The two-dimensional matrix coefficients are described. Thus, it can be further divided into, for example, 4 × 4 transform sub-blocks (TSB, Transform Sub-Block).
例如,所述矩形变换块中系数的编码方向可以由帧内预测模式确定;所述编码方向包括如下之一:对角方向、水平方向、垂直方向。关于帧内预测模式以及如何确定编码方向等内容,可以参考相关技术。For example, the coding direction of the coefficients in the rectangular transform block may be determined by the intra prediction mode; the coding direction includes one of the following: diagonal direction, horizontal direction, and vertical direction. For the intra prediction mode and how to determine the encoding direction, please refer to related technologies.
图7是本发明实施例的将一维系数映射回矩形TB的一示例图,以16×8的TB为例进行说明。如图7所示,例如对于每个4×4的TSB内,以水平方式进行映射;而在TSB之间仍以水平方式进行映射。因此,可以以水平扫描的方式,将步骤102中形成的所述一维排列的系数映射回所述矩形变换块,以形成用于编码的二维矩阵系数。FIG. 7 is an example diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention, taking 16 × 8 TB as an example for description. As shown in FIG. 7, for example, for each 4 × 4 TSB, the mapping is performed in a horizontal manner; while the TSBs are still mapped in a horizontal manner. Therefore, the one-dimensionally arranged coefficients formed in
图8是本发明实施例的将一维系数映射回矩形TB的另一示例图,以16×8的TB为例进行说明。如图8所示,例如对于每个4×4的TSB内,以垂直方式进行映射;而在TSB之间仍以垂直方式进行映射。因此,可以以垂直扫描的方式,将步骤102中形成的所述一维排列的系数映射回所述矩形变换块,以形成用于编码的二维矩阵系数。FIG. 8 is another exemplary diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention, taking 16 × 8 TB as an example for description. As shown in FIG. 8, for example, for each 4 × 4 TSB, the mapping is performed in a vertical manner; while the TSBs are still mapped in a vertical manner. Therefore, the one-dimensionally arranged coefficients formed in
图9是本发明实施例的将一维系数映射回矩形TB的另一示例图,以16×8的 TB为例进行说明。如图9所示,例如对于每个4×4的TSB内,以对角方式进行映射;而在TSB之间仍以对角方式进行映射。因此,可以以对角扫描的方式,将步骤102中形成的所述一维排列的系数映射回所述矩形变换块,以形成用于编码的二维矩阵系数。FIG. 9 is another exemplary diagram of mapping one-dimensional coefficients back to a rectangular TB according to an embodiment of the present invention, taking 16 × 8 TB as an example for description. As shown in FIG. 9, for example, for each 4 × 4 TSB, the mapping is performed diagonally; while the TSBs are still mapped diagonally. Therefore, the one-dimensionally arranged coefficients formed in
值得注意的是,在步骤103中形成用于编码的二维矩阵系数之后,可以将这些系数进行处理(例如量化、映射等)并进行编码,将相关信息编入比特流中,从而发送至解码端。此外,对于待编码图像区域中的预测信息、残差系数等图像信息的比特流编码,可以采用相关技术中的任意方案实现,本发明并不对此进行限制。It is worth noting that after the two-dimensional matrix coefficients for encoding are formed in
值得注意的是,以上仅以一个矩形TB为例对本发明进行了示意性说明,对于多个TB可以分别使用上述步骤进行编码。以上仅对与本发明相关的各步骤或过程进行了说明,但本发明不限于此。图像编码方法还可以包括其他步骤或者过程,关于这些步骤或者过程的具体内容,可以参考现有技术。此外,在解码端可以相应地接收比特流并且相应地进行解码,在此不再赘述。It is worth noting that the above uses only one rectangular TB as an example to illustrate the present invention. For multiple TBs, the above steps can be used for encoding. Only the steps or processes related to the present invention have been described above, but the present invention is not limited to this. The image coding method may further include other steps or processes. For the specific content of these steps or processes, reference may be made to the prior art. In addition, the bit stream can be received at the decoding end and decoded accordingly, which will not be repeated here.
由上述实施例可知,将矩形TB的二维DCT矩阵系数按照频率的大小进行扫描,以形成一维排列的系数;以及将所述一维排列的系数映射回所述矩形TB以形成用于编码的二维矩阵系数。由此,不仅能够针对矩形变换块进行系数扫描,而且能进一步集中能量从而提升编码效率。It can be known from the above embodiments that the two-dimensional DCT matrix coefficients of the rectangular TB are scanned according to the frequency to form a one-dimensional array of coefficients; Coefficients of the two-dimensional matrix. Thus, not only can the coefficient scan be performed on the rectangular transform block, but also the energy can be further concentrated to improve the coding efficiency.
实施例2Example 2
本发明实施例提供一种图像编码装置。该装置例如可以是用于图像处理或视频处理的电子设备,也可以是配置于电子设备的某个或某些部件或者组件。本实施例2与实施例1相同的内容不再赘述。An embodiment of the present invention provides an image encoding device. The apparatus may be, for example, an electronic device used for image processing or video processing, or may be one or some components or components disposed in the electronic device. The same content of this
图10是本发明实施例的图像编码装置的示意图,如图10所示,图像编码装置1000包括:FIG. 10 is a schematic diagram of an image encoding device according to an embodiment of the present invention. As shown in FIG. 10, the
变换部1001,其对矩形变换块的残差系数进行离散余弦变换并获得二维离散余弦变换矩阵系数;A
扫描部1002,其将所述二维离散余弦变换矩阵系数按照频率的大小进行扫描,以形成一维排列的系数;以及A
映射部1003,其将所述一维排列的系数映射回所述矩形变换块以形成用于编码 的二维矩阵系数。The
在一个实施例中,所述扫描部1002用于:基于所述矩形变换块的离散余弦变换矩阵,根据每个系数的水平频率分量和垂直频率分量计算所述系数的复合频率;以及按照所述复合频率从低到高的顺序对所述二维离散余弦变换矩阵系数进行扫描。In one embodiment, the
在一个实施例中,所述扫描部1002用于:将所述矩形变换块划分为在水平方向上和垂直方向上的数量相同的多个子块;按照正方形变换块的扫描方式对所述多个子块进行扫描;以及在每个所述子块内,将所述二维离散余弦变换矩阵系数按照频率的大小进行扫描。其中,所述正方形变换块的扫描方式可以包括如下之一:对角扫描、水平扫描、垂直扫描。In one embodiment, the
在一个实施例中,如图10所示,图像编码装置1000还可以包括:In one embodiment, as shown in FIG. 10, the
方向确定部1004,其确定所述矩形变换块中系数的编码方向;The
并且,所述映射部1003可以按照所述矩形变换块中系数的编码方向,将所述一维排列的系数映射回所述矩形变换块中以形成所述二维矩阵系数。In addition, the
此外,为了简单起见,图10中仅示例性示出了各个部件或模块之间的连接关系或信号走向,但是本领域技术人员应该清楚的是,例如可以采用总线连接等各种相关技术。上述各个部件或模块可以通过例如处理器、存储器等硬件设施来实现;本发明实施并不对此进行限制。In addition, for the sake of simplicity, FIG. 10 only exemplarily shows the connection relationship or signal direction between the various components or modules, but those skilled in the art should understand that various related technologies such as bus connection may be used. The above-mentioned various components or modules may be implemented by hardware facilities such as a processor and a memory; the implementation of the present invention does not limit this.
值得注意的是,以上仅对与本发明相关的各部件或模块进行了说明,但本发明不限于此。图像编码装置1000还可以包括其他部件或者模块,关于这些部件或者模块的具体内容,可以参考相关技术。It is worth noting that the above only describes the components or modules related to the present invention, but the present invention is not limited thereto. The
由上述实施例可知,将矩形TB的二维DCT矩阵系数按照频率的大小进行扫描,以形成一维排列的系数;以及将所述一维排列的系数映射回所述矩形TB以形成用于编码的二维矩阵系数。由此,不仅能够针对矩形变换块进行系数扫描,而且能进一步集中能量从而提升编码效率。It can be known from the above embodiments that the two-dimensional DCT matrix coefficients of the rectangular TB are scanned according to the frequency to form a one-dimensional array of coefficients; and the one-dimensional array of coefficients is mapped back to the rectangular TB to form a code for encoding Coefficients of the two-dimensional matrix. Thus, not only can the coefficient scan be performed on the rectangular transform block, but also the energy can be further concentrated to improve the coding efficiency.
实施例3Example 3
本发明实施例还提供一种电子设备,该电子设备进行图像处理或视频处理,包括编码器以及解码器。其中编码器包括如实施例2所述的图像编码装置。An embodiment of the present invention also provides an electronic device that performs image processing or video processing, including an encoder and a decoder. The encoder includes the image encoding device as described in
图11是本发明实施例的电子设备的示意图。如图11所示,电子设备1100可以 包括:处理器1101和存储器1102;存储器1102耦合到处理器1101。其中该存储器1102可存储各种数据;此外还存储信息处理的程序1103,并且在处理器1101的控制下执行该程序1103。11 is a schematic diagram of an electronic device according to an embodiment of the invention. As shown in FIG. 11, the
在一个实施例中,电子设备1100可以作为编码器使用,图像编码装置1000的功能可以被集成到处理器1101中。其中,处理器1101可以被配置为实现如实施例1所述的图像编码方法。In one embodiment, the
例如,处理器1101可以被配置为进行如下的控制:对矩形变换块的残差系数进行离散余弦变换并获得二维离散余弦变换矩阵系数;将所述二维离散余弦变换矩阵系数按照频率的大小进行扫描,以形成一维排列的系数;以及将所述一维排列的系数映射回所述矩形变换块以形成用于编码的二维矩阵系数。For example, the
在一个实施例中,处理器1101还可以被配置为进行如下的控制:基于所述矩形变换块的离散余弦变换矩阵,根据每个系数的水平频率分量和垂直频率分量计算所述系数的复合频率;以及按照所述复合频率从低到高的顺序对所述二维离散余弦变换矩阵系数进行扫描。In one embodiment, the
例如,对于M×N的离散余弦变换矩阵,所述系数的水平频率分量I(u)和垂直频率分量J(v)分别为: u=0,...,M,v=0,...,N;其中,所述复合频率为所述水平频率分量和所述垂直频率分量之和;M和N分别为正整数。 For example, for the M × N discrete cosine transform matrix, the horizontal frequency component I (u) and the vertical frequency component J (v) of the coefficients are: u = 0, ..., M, v = 0, ..., N; where the composite frequency is the sum of the horizontal frequency component and the vertical frequency component; M and N are positive integers, respectively.
在一个实施例中,处理器1101还可以被配置为进行如下的控制:将所述矩形变换块划分为在水平方向上和垂直方向上的数量相同的多个子块;按照正方形变换块的扫描方式对所述多个子块进行扫描;以及在每个所述子块内,将所述二维离散余弦变换矩阵系数按照频率的大小进行扫描。In one embodiment, the
例如,将2 M×2 N的矩形变换块划分为2 M×2 M个1×2 N-M的子块,M<N,M和N分别为正整数;将所述2 M×2 M个子块按照正方形变换块的扫描方式进行扫描,并且在每个所述1×2 N-M子块内按照垂直方式对所述二维离散余弦变换矩阵系数进行扫描。 For example, the 2 M × 2 N rectangular transform block is divided into 2 M × 2 M sub-blocks of 1 × 2 NM , M <N, M and N are positive integers; the 2 M × 2 M sub-blocks Scan according to the scanning mode of the square transform block, and scan the two-dimensional discrete cosine transform matrix coefficients in a vertical manner within each of the 1 × 2 NM sub-blocks.
再例如,将2 M×2 N的矩形变换块划分为2 N×2 N个2 M-N×1的子块,M>N,M和N分别为正整数;将所述2 N×2 N个子块按照正方形变换块的扫描方式进行扫描,并且在每个所述2 M-N×1子块内按照水平方式对所述二维离散余弦变换矩阵系数进行扫描。 For another example, the 2 M × 2 N rectangular transform block is divided into 2 N × 2 N sub-blocks of 2 MN × 1, M> N, M and N are positive integers; the 2 N × 2 N sub-blocks The block is scanned according to the scanning method of the square transform block, and the two-dimensional discrete cosine transform matrix coefficients are scanned horizontally within each of the 2 MN × 1 sub-blocks.
在一个实施例中,所述正方形变换块的扫描方式包括如下之一:对角扫描、水平扫描、垂直扫描。In one embodiment, the scanning method of the square transform block includes one of the following: diagonal scanning, horizontal scanning, and vertical scanning.
在一个实施例中,处理器1101还可以被配置为进行如下的控制:确定所述矩形变换块中系数的编码方向;以及按照所述矩形变换块中系数的编码方向,将所述一维排列的系数映射回所述矩形变换块中以形成所述二维矩阵系数。In one embodiment, the
在一个实施例中,所述矩形变换块中系数的编码方向由帧内预测模式确定;所述编码方向包括如下之一:对角方向、水平方向、垂直方向。In one embodiment, the coding direction of the coefficients in the rectangular transform block is determined by the intra prediction mode; the coding direction includes one of the following: diagonal direction, horizontal direction, and vertical direction.
此外,如图11所示,电子设备1100还可以包括:输入输出(I/O)设备1104和显示器1105等;其中,上述部件的功能与现有技术类似,此处不再赘述。值得注意的是,电子设备1100也并不是必须要包括图11中所示的所有部件;此外,电子设备1100还可以包括图11中没有示出的部件,可以参考相关技术。In addition, as shown in FIG. 11, the
本发明实施例提供一种计算机可读程序,其中当在编码器或电子设备中执行所述程序时,所述程序使得所述编码器或电子设备执行如实施例1所述的图像编码方法。An embodiment of the present invention provides a computer-readable program, wherein when the program is executed in an encoder or an electronic device, the program causes the encoder or the electronic device to execute the image encoding method as described in
本发明实施例提供一种存储有计算机可读程序的存储介质,其中所述计算机可读程序使得编码器或电子设备执行如实施例1所述的图像编码方法。An embodiment of the present invention provides a storage medium storing a computer-readable program, where the computer-readable program causes an encoder or an electronic device to execute the image encoding method as described in
本发明以上的装置和方法可以由硬件实现,也可以由硬件结合软件实现。本发明涉及这样的计算机可读程序,当该程序被逻辑部件所执行时,能够使该逻辑部件实现上文所述的装置或构成部件,或使该逻辑部件实现上文所述的各种方法或步骤。本发明还涉及用于存储以上程序的存储介质,如硬盘、磁盘、光盘、DVD、flash存储器等。The above device and method of the present invention may be implemented by hardware, or may be implemented by hardware in combination with software. The present invention relates to such a computer-readable program which, when executed by a logic component, enables the logic component to implement the above-described device or component, or enables the logic component to implement the various methods described above Or steps. The invention also relates to storage media for storing the above programs, such as hard disks, magnetic disks, optical disks, DVDs, flash memories, and so on.
结合本发明实施例描述的方法/装置可直接体现为硬件、由处理器执行的软件模块或二者组合。例如,图中所示的功能框图中的一个或多个和/或功能框图的一个或多个组合,既可以对应于计算机程序流程的各个软件模块,亦可以对应于各个硬件模块。这些软件模块,可以分别对应于图中所示的各个步骤。这些硬件模块例如可利用现场可编程门阵列(FPGA)将这些软件模块固化而实现。The method / device described in conjunction with the embodiments of the present invention may be directly embodied as hardware, a software module executed by a processor, or a combination of both. For example, one or more of the functional block diagrams and / or one or more combinations of the functional block diagrams shown in the figures may correspond to each software module of the computer program flow or each hardware module. These software modules can respectively correspond to the steps shown in the figure. These hardware modules can be realized by solidifying these software modules using a field programmable gate array (FPGA), for example.
软件模块可以位于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动磁盘、CD-ROM或者本领域已知的任何其它形式的存储介质。可以将一种存储介质耦接至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息;或者该存储介质可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。该软件模块可以存储在移动终端的存储器中,也可以 存储在可插入移动终端的存储卡中。例如,若设备(如移动终端)采用的是较大容量的MEGA-SIM卡或者大容量的闪存装置,则该软件模块可存储在该MEGA-SIM卡或者大容量的闪存装置中。The software module may be located in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art. A storage medium may be coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium; or the storage medium may be an integral part of the processor. The processor and the storage medium may be located in the ASIC. The software module can be stored in the memory of the mobile terminal or in a memory card that can be inserted into the mobile terminal. For example, if the device (such as a mobile terminal) uses a larger-capacity MEGA-SIM card or a larger-capacity flash memory device, the software module may be stored in the MEGA-SIM card or a larger-capacity flash memory device.
针对附图中描述的功能方框中的一个或多个和/或功能方框的一个或多个组合,可以实现为用于执行本发明所描述功能的通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件或者其任意适当组合。针对附图描述的功能方框中的一个或多个和/或功能方框的一个或多个组合,还可以实现为计算设备的组合,例如,DSP和微处理器的组合、多个微处理器、与DSP通信结合的一个或多个微处理器或者任何其它这种配置。For one or more of the functional blocks described in the drawings and / or one or more combinations of the functional blocks, it may be implemented as a general-purpose processor, digital signal processor (DSP) for performing the functions described in the present invention ), Application specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or any suitable combination thereof. One or more of the functional blocks described in the drawings and / or one or more combinations of the functional blocks can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessing Processor, one or more microprocessors in communication with the DSP, or any other such configuration.
以上结合具体的实施方式对本发明进行了描述,但本领域技术人员应该清楚,这些描述都是示例性的,并不是对本发明保护范围的限制。本领域技术人员可以根据本发明的精神和原理对本发明做出各种变型和修改,这些变型和修改也在本发明的范围内。The present invention has been described above in conjunction with specific embodiments, but it should be clear to those skilled in the art that these descriptions are exemplary and do not limit the protection scope of the present invention. Those skilled in the art can make various variations and modifications to the present invention according to the spirit and principle of the present invention, and these variations and modifications are also within the scope of the present invention.
Claims (15)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2018/112906 WO2020087324A1 (en) | 2018-10-31 | 2018-10-31 | Image coding method and apparatus, and electronic device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2018/112906 WO2020087324A1 (en) | 2018-10-31 | 2018-10-31 | Image coding method and apparatus, and electronic device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020087324A1 true WO2020087324A1 (en) | 2020-05-07 |
Family
ID=70463395
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/112906 Ceased WO2020087324A1 (en) | 2018-10-31 | 2018-10-31 | Image coding method and apparatus, and electronic device |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2020087324A1 (en) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101743751A (en) * | 2007-06-15 | 2010-06-16 | 高通股份有限公司 | Adaptive transformation of residual blocks depending on the intra prediction mode |
| CN103024392A (en) * | 2012-12-26 | 2013-04-03 | 清华大学 | Method and device for intra-frame mode prediction based on two-dimensional Hadamard transformation |
| CN103391433A (en) * | 2012-05-09 | 2013-11-13 | 腾讯科技(深圳)有限公司 | Video coding intra-frame predicting and scanning method and video coding method |
| US20170357616A1 (en) * | 2011-05-13 | 2017-12-14 | Texas Instruments Incorporated | Inverse transformation using pruning for video coding |
| CN108259919A (en) * | 2018-03-28 | 2018-07-06 | 福州大学 | A kind of hardware system of quick realization 8x8DCT transformation |
-
2018
- 2018-10-31 WO PCT/CN2018/112906 patent/WO2020087324A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101743751A (en) * | 2007-06-15 | 2010-06-16 | 高通股份有限公司 | Adaptive transformation of residual blocks depending on the intra prediction mode |
| US20170357616A1 (en) * | 2011-05-13 | 2017-12-14 | Texas Instruments Incorporated | Inverse transformation using pruning for video coding |
| CN103391433A (en) * | 2012-05-09 | 2013-11-13 | 腾讯科技(深圳)有限公司 | Video coding intra-frame predicting and scanning method and video coding method |
| CN103024392A (en) * | 2012-12-26 | 2013-04-03 | 清华大学 | Method and device for intra-frame mode prediction based on two-dimensional Hadamard transformation |
| CN108259919A (en) * | 2018-03-28 | 2018-07-06 | 福州大学 | A kind of hardware system of quick realization 8x8DCT transformation |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104853196B (en) | Decoding method and device | |
| CN102640498B (en) | Method and device for image encoding and decoding by texture-pattern-adaptive partitioned block transform | |
| CN106454351B (en) | Decoding apparatus and coding/decoding method | |
| CN110800299B (en) | Scan order adaptation for entropy coding blocks of image data | |
| CN103813167B (en) | Method and device for processing quantization conversion parameters | |
| EP3817385A1 (en) | Method and apparatus for encoding image, method and apparatus for decoding image, electronic device, and system | |
| WO2022078163A1 (en) | Video decoding method, video encoding method, and related device | |
| CN111669582A (en) | Method, encoding end, decoding end and system for encoding and decoding | |
| US12022078B2 (en) | Picture processing method and apparatus | |
| WO2022062880A1 (en) | Video decoding method and apparatus, computer readable medium, and electronic device | |
| WO2008151560A1 (en) | Coding and decoding method, coder and decoder, and method and device for generating the sequences to be coded | |
| JP6553920B2 (en) | Method and corresponding device for encoding and decoding pictures | |
| CN107682699A (en) | A kind of nearly Lossless Image Compression method | |
| CN104093018B (en) | The coding method of conversion coefficient, the coding/decoding method of conversion coefficient, and device | |
| WO2020087324A1 (en) | Image coding method and apparatus, and electronic device | |
| CN1230000C (en) | Scanning method and device for transform coefficient block in video codec | |
| CN114513663B (en) | Video decoding method, device and electronic equipment | |
| WO2019127003A1 (en) | Image coding method, apparatus, and electronic device | |
| WO2020062125A1 (en) | Image coding method and apparatus, and electronic device | |
| WO2022063040A1 (en) | Video coding/decoding method, apparatus, and device | |
| CN115834910A (en) | Video encoding and decoding method and device, electronic equipment and storage medium | |
| HK1229103B (en) | Encoding device and encoding method | |
| WO2020073228A1 (en) | Method and apparatus for encoding or decoding code unit, and electronic device | |
| HK1229107B (en) | Decoding device and decoding method | |
| HK1229102B (en) | Coefficient coding harmonization in hevc |
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: 18938766 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18938766 Country of ref document: EP Kind code of ref document: A1 |