CN101321283A - Codec methods and codecs compatible with different size block transformations - Google Patents

Codec methods and codecs compatible with different size block transformations Download PDF

Info

Publication number
CN101321283A
CN101321283A CN 200710111685 CN200710111685A CN101321283A CN 101321283 A CN101321283 A CN 101321283A CN 200710111685 CN200710111685 CN 200710111685 CN 200710111685 A CN200710111685 A CN 200710111685A CN 101321283 A CN101321283 A CN 101321283A
Authority
CN
China
Prior art keywords
sequence
coefficients
sub
coded
transform coefficient
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.)
Granted
Application number
CN 200710111685
Other languages
Chinese (zh)
Other versions
CN101321283B (en
Inventor
胡昌启
周建同
林四新
高山
熊联欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN 200710111685 priority Critical patent/CN101321283B/en
Priority to PCT/CN2008/071233 priority patent/WO2008151560A1/en
Publication of CN101321283A publication Critical patent/CN101321283A/en
Application granted granted Critical
Publication of CN101321283B publication Critical patent/CN101321283B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

本发明实施例公开了的兼容不同大小块变换的编解码方案,通过将多个小尺寸的子变换系数块中所提取出的系数进行交织处理,得出适用于大尺寸的变换系数块的熵编码方式所能够处理的编码序列,使适用于大尺寸的变换系数块的熵编码方式也能够适用于小尺寸的变换系数块,从而,使基于不同大小的块编码的编码系统中,在拥有适用于大尺寸的变换系数块的熵编码方式的情况下,能够不需要重新设计适用于小尺寸的变换系数块的熵编码方式,因此,能够减少编码的设计成本,降低设计复杂度。

The embodiment of the present invention discloses an encoding and decoding scheme compatible with the transformation of blocks of different sizes. By interleaving the coefficients extracted from multiple small-sized sub-transform coefficient blocks, the entropy suitable for large-sized transform coefficient blocks is obtained. The coding sequence that the coding method can handle makes the entropy coding method suitable for large-sized transform coefficient blocks also applicable to small-sized transform coefficient blocks, so that in the coding system based on coding of blocks of different sizes, the applicable In the case of an entropy coding method for a large-sized transform coefficient block, there is no need to redesign the entropy coding method suitable for a small-sized transform coefficient block, thus reducing coding design cost and design complexity.

Description

兼容不同大小块变换的编解码方法及编解码器 Codec methods and codecs compatible with different size block transformations

技术领域 technical field

本发明涉及视频图像编码技术,尤其涉及一种兼容不同大小块变换的编解码方法及编解码器。The invention relates to video image coding technology, in particular to a codec method and a codec compatible with block transformation of different sizes.

背景技术 Background technique

原始视频图象数据所含信息量通常较大,因此直接将整个原始视频图像数据所含信息量作为传输或存储视频内容的对象,因需要耗费庞大的存储或传输资源,而不具有现实意义。The amount of information contained in the original video image data is usually large, so directly using the information amount contained in the entire original video image data as the object of transmitting or storing video content has no practical significance because it needs to consume huge storage or transmission resources.

原始视频图象数据中包含一系列的静止图像信息,通常将一片静止图像称为一帧。一段视频中包含多帧,并通过帧的连续播放来产生动态的视觉效果,因而连续帧中的数据内容是非常相似的,也就是说后一帧相对于前一帧包含很多冗余信息。视频编码技术作为一种信息压缩技术,就是通过尽量消除冗余信息,保留图像的特征信息,来实现视频图像数据信息量的压缩,从而极大程度地降低信息存储量,并方便视频图像的传输。The original video image data contains a series of still image information, and a piece of still image is usually called a frame. A video contains multiple frames, and the continuous playback of frames produces dynamic visual effects, so the data content in consecutive frames is very similar, that is to say, the latter frame contains a lot of redundant information compared to the previous frame. As a kind of information compression technology, video coding technology is to realize the compression of video image data information by eliminating redundant information as much as possible and retaining the characteristic information of images, thereby greatly reducing the amount of information storage and facilitating the transmission of video images. .

典型的视频编码,如国际电信联盟(ITU)制定的H.261、H.263、H.264等标准,国际标准化组织(ISO)的数字音频压缩技术(MPEG)组织制定的MEPG-1,MPEG-2,MPEG-4,以及中国数字音视频编解码技术标准(AVS)工作组制定的AVS标准,都基于混合编码框架进行。参见图1,图1是现有的混合编码框架示意图。如图1所示,在混合编码框架中,对视频图像数据编码的过程通常包括:Typical video coding, such as H.261, H.263, H.264 and other standards developed by the International Telecommunication Union (ITU), MEPG-1 and MPEG developed by the International Organization for Standardization (ISO) Digital Audio Compression Technology (MPEG) Organization -2, MPEG-4, and the AVS standard formulated by the China Digital Audio and Video Codec Technology Standard (AVS) working group are all based on the hybrid coding framework. Referring to FIG. 1, FIG. 1 is a schematic diagram of an existing hybrid coding framework. As shown in Figure 1, in the hybrid coding framework, the process of coding video image data usually includes:

利用预测去除时间/空间域的冗余性:基于帧内(I)或帧间(P)等模式编码,对原始图像数据进行预测和估计,得到预测块,然后得出待压缩的原始图像数据与预测块之差,即得到残差块;Use prediction to remove redundancy in the time/space domain: Based on intra (I) or inter (P) mode coding, predict and estimate the original image data, obtain the prediction block, and then obtain the original image data to be compressed The difference with the prediction block is to get the residual block;

利用变换去除空间域的冗余性:对此残差块作基于块的变换编码,如离散余弦变换(DCT)、整数变换等,得到变换系数块,再对该变换系数块中的系数进行量化处理,得到量化后的变换系数块;Use transformation to remove redundancy in the spatial domain: perform block-based transformation coding on this residual block, such as discrete cosine transformation (DCT), integer transformation, etc., to obtain a transformation coefficient block, and then quantize the coefficients in the transformation coefficient block processing to obtain a quantized transform coefficient block;

利用熵编码去除统计上的冗余性:对变换系数块进行熵编码。其中,熵编码的类型可包括:上下文自适应可变长编码(CAVLC)、上下文自适应二进制算术编码(CABAC)、逆向游程扫描结合二维可变长编码(2D-VLC)等等熵编码。Removing statistical redundancy with entropy coding: Entropy coding a block of transform coefficients. Among them, the types of entropy coding may include: context-adaptive variable-length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), inverse run-length scan combined with two-dimensional variable-length coding (2D-VLC) and other entropy coding.

对于上述基于块的变换编码,其中,所谓“块”是指将帧划分为多个矩形区域,每个矩形区域称为一个“块”。常用块的尺寸可包括:4×4块、8×8块、16×16块、8×4块等。由于基于不同的块进行编码所能够获得的效果不同,因此,为取得更好的编码效果,在一些标准中,引入自适应块变换(ABT)技术,即在一个视频编码系统中,可针对不同的需要,采用不同的块的变换编码方式进行编码。上述变换系数块(或量化后的变换系数块)是基于块的变换编码的结果,且变换系数块具有与ABT变换中不同频率相对应的系数。For the above-mentioned block-based transform coding, the so-called "block" refers to dividing a frame into multiple rectangular areas, and each rectangular area is called a "block". Common block sizes may include: 4×4 blocks, 8×8 blocks, 16×16 blocks, 8×4 blocks, etc. Since the effects obtained by coding based on different blocks are different, in order to achieve better coding effects, in some standards, Adaptive Block Transform (ABT) technology is introduced, that is, in a video coding system, it can be used for different According to the needs, different block transform coding methods are used for coding. The aforementioned transform coefficient block (or quantized transform coefficient block) is a result of block-based transform encoding, and the transform coefficient block has coefficients corresponding to different frequencies in the ABT transform.

熵编码方式(或算法)通常是针对基于块的变换编码所设计的,或者说熵编码方式与进行变换编码时所选块的尺寸是相匹配的,如8×8块的变换编码对应一种CAVLC,4×4块的变换编码对应另一种CAVLC。而由于熵编码算法的设计具有一定的复杂度,且其硬件实现的复杂度也较高,因此,为避免遇到软件与硬件设计上的复杂度问题,在一个视频编码系统中,通常设计一套熵编码算法,即采用一种熵编码方式进行编码。而对于引入了ABT技术的编码系统中,由于基于块的变换编码中采用了不同大小的块进行变换编码,因此在进行熵编码之前,需要采用措施,以使编码系统中适用于一种块的熵编码方式也能够对其他尺寸的块进行编码。The entropy coding method (or algorithm) is usually designed for block-based transform coding, or the entropy coding method matches the size of the block selected for transform coding, such as 8×8 block transform coding corresponds to a CAVLC, the transformation coding of 4*4 block corresponds to another kind of CAVLC. And because the design of entropy coding algorithm has certain complexity, and the complexity of its hardware implementation is also high, therefore, in order to avoid encountering the complexity problem of software and hardware design, in a video coding system, usually design a A set of entropy coding algorithms, that is, an entropy coding method is used for coding. For the coding system that introduces ABT technology, since blocks of different sizes are used in the block-based transform coding for transform coding, measures need to be taken before entropy coding to make the coding system suitable for a block. Entropy coding can also encode blocks of other sizes.

如,在H.264高级视频编码(AVC)标准中,基于块的变换编码存在4×4和8×8两种,而该标准中的熵编码方式所能够适用的是4×4块,则8×8变换系数块可按照如下方式使用4×4变换系数块所适用的熵编码方式:For example, in the H.264 Advanced Video Coding (AVC) standard, there are two types of block-based transform coding, 4×4 and 8×8, and the entropy coding method in this standard is applicable to 4×4 blocks, then An 8×8 transform coefficient block may use the entropy coding method applicable to a 4×4 transform coefficient block as follows:

先将8×8变换系数块的64个变换系数按照图2扫描方式序列化为:First, serialize the 64 transform coefficients of the 8×8 transform coefficient block according to the scanning method in Figure 2 as follows:

a0,a1,a2,a3,a4,a5,a6,a7,a8,...,a63;a0, a1, a2, a3, a4, a5, a6, a7, a8, ..., a63;

然后,从上述64个系数中通过子采样,得出四个分别含16个系数的序列Si,i=1、2、3、4,该子采样方式是:每个序列中系数编号之间满足关系:a[j×4+i-1],j=0,1,...,15;得到:Then, through sub-sampling from the above-mentioned 64 coefficients, four sequences Si containing 16 coefficients are obtained, i=1, 2, 3, 4, and the sub-sampling method is: the number of coefficients in each sequence satisfies Relation: a[j×4+i-1], j=0, 1, ..., 15; get:

S1:a0,a4,a8,...,a60;S1: a0, a4, a8, ..., a60;

S2:a1,a5,a9,...,a61;S2: a1, a5, a9, ..., a61;

S3:a2,a6,a10,...,a62;S3: a2, a6, a10, ..., a62;

S4:a3,a7,a11,...,a63;S4: a3, a7, a11, ..., a63;

之后,将上述四个序列按照4×4变换系数块所适用的熵编码方式进行编码。这样,在一个编码系统中,即使基于不同尺寸的块进行能够变换编码,也可以采用同一套熵编码算法,对该算法所不适用的变换系数块进行编码。Afterwards, the above four sequences are coded according to the entropy coding method applicable to the 4×4 transform coefficient block. In this way, in a coding system, even if transform coding is performed based on blocks of different sizes, the same set of entropy coding algorithms can be used to code the transform coefficient blocks to which the algorithm is not applicable.

现有技术所适用的是利用小尺寸的变换系数块所适用的熵编码方式,对大尺寸的变换系数块进行编码的情形。但是,上述使用4×4变换系数块所适用的熵编码方式对大尺寸变换系数块进行编码的做法,只适用于大于4×4尺寸的块变换,而并不适用于更小尺寸的块变换。在遇到更小尺寸的块变换的情况时,仍可能需要针对更小块变换,设计能够匹配的熵编码算法,从而带来设计复杂度问题。What the prior art is applicable to is the case of encoding a large-sized transform coefficient block by using an entropy coding method applicable to a small-sized transform coefficient block. However, the above method of encoding large-size transform coefficient blocks using the entropy coding method applicable to 4×4 transform coefficient blocks is only applicable to block transformations larger than 4×4 size, and not applicable to smaller-size block transformations. . In the case of smaller-sized block transformations, it may still be necessary to design a matching entropy coding algorithm for smaller-sized block transformations, which brings design complexity problems.

发明内容 Contents of the invention

本发明实施例提供了可对小尺寸的变换系数块采用大尺寸的变换系数块所适用的熵编码方式进行编码的技术方案。本发明实施例的技术方案如下:Embodiments of the present invention provide a technical solution for encoding a small-sized transform coefficient block using an entropy encoding method suitable for a large-sized transform coefficient block. The technical scheme of the embodiment of the present invention is as follows:

一种兼容不同大小块变换的编码方法,包括:An encoding method compatible with block transformations of different sizes, including:

对根据视频图像数据得到的N个子变换系数块中的每个子变换系数块进行扫描,生成由该子变换系数块中的系数组成的子序列;Scan each sub-transform coefficient block in the N sub-transform coefficient blocks obtained according to the video image data, and generate a subsequence composed of coefficients in the sub-transform coefficient block;

其中,N是大于或等于2的正整数,且所述N个子变换系数块中的第i个子变换系数块包含

Figure A20071011168500091
个系数,i=1,2,......,N,ni和mi是大于或等于1的正整数;Wherein, N is a positive integer greater than or equal to 2, and the ith sub-transform coefficient block among the N sub-transform coefficient blocks contains
Figure A20071011168500091
coefficients, i=1, 2,..., N, n i and m i are positive integers greater than or equal to 1;

提取各子序列中的系数,对提取出来的系数进行交织处理,生成待编码序列;Extracting coefficients in each subsequence, performing interleaving processing on the extracted coefficients, and generating a sequence to be encoded;

利用包含2x×2y个系数的变换块所适用的熵编码方式对所述待编码序列进行编码;Encoding the sequence to be encoded using an entropy encoding method applicable to a transform block containing 2 x × 2 y coefficients;

其中,x和y是大于或等于2的正整数,且所述变换系数块所含系数个数2x×2y大于或等于N个子变换系数块所含系数个数之和。Wherein, x and y are positive integers greater than or equal to 2, and the number of coefficients 2 x × 2 y contained in the transform coefficient block is greater than or equal to the sum of the coefficients contained in N sub-transform coefficient blocks.

一种用于生成待进行编码的待编码序列的方法,包括:A method for generating a to-be-encoded sequence to be encoded, comprising:

对根据视频图像数据得到的N个子变换系数块中的每个子变换系数块进行扫描,生成由该子变换系数块中的系数组成的子序列;Scan each sub-transform coefficient block in the N sub-transform coefficient blocks obtained according to the video image data, and generate a subsequence composed of coefficients in the sub-transform coefficient block;

其中,N是大于或等于2的正整数,且所述N个子变换系数块中的第i个子变换系数块包含

Figure A20071011168500092
个系数,i=1,2,......,N,ni和mi是大于或等于1的正整数;Wherein, N is a positive integer greater than or equal to 2, and the ith sub-transform coefficient block among the N sub-transform coefficient blocks contains
Figure A20071011168500092
coefficients, i=1, 2,..., N, n i and m i are positive integers greater than or equal to 1;

提取各子序列中的系数,对提取出来的系数进行交织处理,生成能够利用包含2x×2y个系数的变换块所适用的熵编码方式进行编码的待编码序列;Extracting the coefficients in each subsequence, performing interleaving processing on the extracted coefficients, and generating a sequence to be encoded that can be encoded using an entropy encoding method applicable to a transform block containing 2 x × 2 y coefficients;

其中,x和y是大于或等于2的正整数,且所述变换系数块所含系数个数2x×2y大于或等于N个子变换系数块所含系数个数之和。Wherein, x and y are positive integers greater than or equal to 2, and the number of coefficients 2 x × 2 y contained in the transform coefficient block is greater than or equal to the sum of the coefficients contained in N sub-transform coefficient blocks.

一种用于生成待进行编码的待编码序列的装置,包括:A device for generating a sequence to be encoded comprising:

子序列生成单元、待编码序列生成单元、输出单元;其中,A subsequence generation unit, a sequence generation unit to be encoded, and an output unit; wherein,

子序列生成单元,用于对根据视频图像数据得到的N个子变换系数块中的每个子变换系数块进行扫描,生成由该子变换系数块中的系数组成的子序列,将所生成的子序列信息传送给待编码序列生成单元;其中,N是大于或等于2的正整数,且第i个变换系数块包含

Figure A20071011168500093
个系数,i=1,2,......,N,ni和mi是大于或等于1的正整数;A sub-sequence generating unit, configured to scan each sub-transform coefficient block in the N sub-transform coefficient blocks obtained according to the video image data, generate a sub-sequence composed of coefficients in the sub-transform coefficient block, and convert the generated sub-sequence The information is sent to the sequence generation unit to be encoded; wherein, N is a positive integer greater than or equal to 2, and the i-th transform coefficient block contains
Figure A20071011168500093
coefficients, i=1, 2,..., N, n i and m i are positive integers greater than or equal to 1;

待编码序列生成单元,用于接收来自子序列生成单元的子序列信息,提取各子序列中的系数,对提取出来的系数进行交织处理,生成能够利用包含2x×2y个系数的变换块所适用的熵编码方式进行编码的待编码序列,将所述待编码序列信息传送给输出单元;The sequence generation unit to be encoded is used to receive the subsequence information from the subsequence generation unit, extract the coefficients in each subsequence, interleave the extracted coefficients, and generate a transformation block that can use 2 x × 2 y coefficients The to-be-encoded sequence encoded by the applicable entropy coding method, and the information of the to-be-encoded sequence is transmitted to the output unit;

输出单元,用于接收来自待编码序列生成单元的所述待编码序列信息,将该信息输出;an output unit, configured to receive the sequence information to be encoded from the sequence generation unit to be encoded, and output the information;

其中,x和y是大于或等于2的正整数,且所述变换系数块所含系数个数2x×2y大于或等于N个子变换系数块所含系数个数之和。Wherein, x and y are positive integers greater than or equal to 2, and the number of coefficients 2 x × 2 y contained in the transform coefficient block is greater than or equal to the sum of the coefficients contained in N sub-transform coefficient blocks.

一种兼容不同大小块变换的编码器,包括:用于生成待进行熵编码的待编码序列的装置和熵编码单元;An encoder compatible with block transformations of different sizes, comprising: a device for generating a sequence to be encoded for entropy encoding and an entropy encoding unit;

所述用于生成待进行熵编码的待编码序列的装置包括:子序列生成单元、待编码序列生成单元;其中,The device for generating the sequence to be coded to be entropy coded includes: a subsequence generating unit and a sequence to be coded generating unit; wherein,

子序列生成单元,用于对根据视频图像数据得到的N个子变换系数块中的每个子变换系数块进行扫描,生成由该子变换系数块中的系数组成的子序列,将所生成的子序列信息传送给待编码序列生成单元;其中,N是大于或等于2的正整数,且第i个变换系数块包含

Figure A20071011168500101
个系数,i=1,2,......,N,ni和mi是大于或等于1的正整数;A sub-sequence generating unit, configured to scan each sub-transform coefficient block in the N sub-transform coefficient blocks obtained according to the video image data, generate a sub-sequence composed of coefficients in the sub-transform coefficient block, and convert the generated sub-sequence The information is sent to the sequence generation unit to be encoded; wherein, N is a positive integer greater than or equal to 2, and the i-th transform coefficient block contains
Figure A20071011168500101
coefficients, i=1, 2,..., N, n i and m i are positive integers greater than or equal to 1;

待编码序列生成单元,用于接收来自子序列生成单元的子序列信息,提取各子序列中的系数,对提取出来的系数进行交织处理,生成能够利用包含2x×2y个系数的变换块所适用的熵编码方式进行编码的待编码序列,将所述待编码序列信息传送给输出单元;The sequence generation unit to be encoded is used to receive the subsequence information from the subsequence generation unit, extract the coefficients in each subsequence, interleave the extracted coefficients, and generate a transformation block that can use 2 x × 2 y coefficients The to-be-encoded sequence encoded by the applicable entropy coding method, and the information of the to-be-encoded sequence is transmitted to the output unit;

输出单元,用于接收来自待编码序列生成单元的所述待编码序列信息,将该信息输出;an output unit, configured to receive the sequence information to be encoded from the sequence generation unit to be encoded, and output the information;

熵编码单元,用于接收来自输出单元的所述待编码序列信息,利用包含2x×2y个系数的变换块所适用的熵编码方式对所述待编码序列进行编码;An entropy encoding unit, configured to receive the sequence information to be encoded from the output unit, and encode the sequence to be encoded using an entropy encoding method applicable to a transform block containing 2 x × 2 y coefficients;

其中,x和y是大于或等于2的正整数,且所述变换系数块所含系数个数2x×2y大于或等于N个子变换系数块所含系数个数之和。Wherein, x and y are positive integers greater than or equal to 2, and the number of coefficients 2 x × 2 y contained in the transform coefficient block is greater than or equal to the sum of the coefficients contained in N sub-transform coefficient blocks.

一种与兼容不同大小块变换的编码相对应的解码方法,对编码结果按照与所述编码相逆的过程进行解码处理,包括:A decoding method corresponding to coding compatible with different size block transformations, decoding the coding result according to the reverse process of the coding, including:

对编码结果进行熵解码处理,得到待解码序列;Perform entropy decoding processing on the encoding result to obtain the sequence to be decoded;

对所述待解码序列进行反交织处理,得到N个子序列;performing deinterleaving processing on the sequence to be decoded to obtain N subsequences;

对所述N个子序列分别进行反扫描处理,得到N个子变换系数块。Perform inverse scanning processing on the N sub-sequences respectively to obtain N sub-transform coefficient blocks.

一种与兼容不同大小块变换的编码器相对应的解码器,包括:熵解码单元、反交织处理单元、反扫描处理单元;其中,A decoder corresponding to an encoder compatible with different size block transformations, comprising: an entropy decoding unit, an anti-interleaving processing unit, and an anti-scanning processing unit; wherein,

熵解码单元,对编码结果进行熵解码处理,得到待解码序列,将所述待解码系列的信息传送给反交织处理单元;The entropy decoding unit performs entropy decoding processing on the encoding result to obtain the sequence to be decoded, and transmits the information of the sequence to be decoded to the deinterleaving processing unit;

反交织处理单元,用于接收来自熵解码单元的待解码序列的信息,对所述待解码序列进行反交织处理,得到N个子序列,将该N个子序列的信息传送给反扫描单元;The deinterleaving processing unit is used to receive the information of the sequence to be decoded from the entropy decoding unit, perform deinterleaving processing on the sequence to be decoded, obtain N subsequences, and transmit the information of the N subsequences to the descanning unit;

反扫描处理单元,用于接收来自反交织处理单元的N个子序列的信息,对所述N个子序列分别进行反扫描处理,得到N个子变换系数块。The inverse scanning processing unit is configured to receive the information of the N subsequences from the deinterleaving processing unit, and respectively perform inverse scanning processing on the N subsequences to obtain N sub-transform coefficient blocks.

综上所述,本发明实施例提供的兼容不同大小块变换的编解码方案,通过将多个小尺寸的子变换系数块中所提取出的系数进行交织处理,得出适用于大尺寸的变换系数块的熵编码方式所能够处理的编码序列,使适用于大尺寸的变换系数块的熵编码方式也能够适用于小尺寸的变换系数块,从而,使基于不同大小的块编码的编码系统中,在拥有适用于大尺寸的变换系数块的熵编码方式的情况下,能够不需要重新设计适用于小尺寸的变换系数块的熵编码方式,因此,能够减少编码的设计成本,降低设计复杂度。In summary, the embodiment of the present invention provides a codec scheme compatible with block transformations of different sizes. By interleaving the coefficients extracted from multiple small-sized sub-transform coefficient blocks, a transformation suitable for large sizes is obtained. The coding sequence that can be processed by the entropy coding method of the coefficient block makes the entropy coding method suitable for the large-sized transform coefficient block also applicable to the small-sized transform coefficient block, so that in the coding system based on block coding of different sizes , in the case of having an entropy coding method suitable for a large-sized transform coefficient block, there is no need to redesign the entropy coding method suitable for a small-sized transform coefficient block, so the design cost of coding can be reduced, and the design complexity can be reduced .

附图说明 Description of drawings

图1是现有的混合编码框架示意图Figure 1 is a schematic diagram of the existing hybrid coding framework

图2a是公知的一个8×8块的之字扫描方式示意图;Fig. 2a is a schematic diagram of a known zigzag scanning method of 8*8 blocks;

图2b是公知的一个8×8块的场扫描方式示意图;Fig. 2b is a schematic diagram of a known field scanning method of an 8×8 block;

图3是本发明实施例中兼容不同大小块变换的编码方法的流程图;Fig. 3 is a flowchart of an encoding method compatible with different size block transformations in an embodiment of the present invention;

图4是本发明实施例中用于生成待进行编码的待编码序列的方法流程图;FIG. 4 is a flowchart of a method for generating a sequence to be encoded to be encoded in an embodiment of the present invention;

图5是本发明实施例中用于生成待进行编码的待编码序列的装置的结构示意图;5 is a schematic structural diagram of a device for generating a sequence to be encoded to be encoded in an embodiment of the present invention;

图6是图5中待编码序列生成单元的结构示意图;Fig. 6 is a schematic structural diagram of the sequence generation unit to be encoded in Fig. 5;

图7是本发明实施例中兼容不同大小块变换的编码器的结构示意图;FIG. 7 is a schematic structural diagram of an encoder compatible with different size block transformations in an embodiment of the present invention;

图8是本发明实施例一中4个4×4的子变换系数块的组合示意图;FIG. 8 is a schematic diagram of the combination of four 4×4 sub-transform coefficient blocks in Embodiment 1 of the present invention;

图9a是公知的一个4×4块的之字扫描方式示意图;FIG. 9a is a schematic diagram of a known zigzag scanning method of a 4×4 block;

图9b是公知的一个4×4块的场扫描方式示意图Figure 9b is a schematic diagram of a known field scanning method of a 4×4 block

图10是本发明实施例一中对四个4×4的子变换系数块进行编码的流程图Fig. 10 is a flow chart of encoding four 4×4 sub-transform coefficient blocks in Embodiment 1 of the present invention

图11是本发明实施例二中以一个4×4的子变换系数块为单位的16个子变换系数块的排列示意图;Fig. 11 is a schematic diagram of the arrangement of 16 sub-transform coefficient blocks with a 4×4 sub-transform coefficient block as a unit in Embodiment 2 of the present invention;

图12是本发明实施例二中16个4×4的子变换系数块的编码组合方案示意图;FIG. 12 is a schematic diagram of a coding combination scheme for 16 4×4 sub-transform coefficient blocks in Embodiment 2 of the present invention;

图13是本发明实施例三中16个4×4的子变换系数块的编码组合方案示意图;FIG. 13 is a schematic diagram of a coding combination scheme for 16 4×4 sub-transform coefficient blocks in Embodiment 3 of the present invention;

图14是本发明实施例四中不同尺寸的子变换系数块的组合示意图;Fig. 14 is a schematic diagram of combinations of sub-transform coefficient blocks of different sizes in Embodiment 4 of the present invention;

图15是本发明实施例四中得出图16所示组合的待编码序列的流程图;Fig. 15 is a flow chart of obtaining the sequence to be coded in combination shown in Fig. 16 in Embodiment 4 of the present invention;

图16本发明实施例五中两个8×4的子变换系数块的组合示意图;FIG. 16 is a schematic diagram of the combination of two 8×4 sub-transform coefficient blocks in Embodiment 5 of the present invention;

图17是本发明实施例五中得出图18所示组合的待编码序列的流程图;FIG. 17 is a flow chart of obtaining the sequence to be encoded in the combination shown in FIG. 18 in Embodiment 5 of the present invention;

图18是本发明实施例中与兼容不同大小块变换的编码相对应的解码方法的流程图;Fig. 18 is a flowchart of a decoding method corresponding to encoding compatible with different size block transformations in an embodiment of the present invention;

图19是本发明实施例中与兼容不同大小块变换的编码器相对应的解码器的结构示意图。Fig. 19 is a schematic structural diagram of a decoder corresponding to an encoder compatible with block transformations of different sizes in an embodiment of the present invention.

具体实施方式 Detailed ways

下面将结合附图对本发明实施例的技术方案作进一步详细描述。The technical solutions of the embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings.

本发明实施例提供了可对小尺寸的变换系数块采用大尺寸的变换系数块所适用的熵编码方式进行编码的技术方案。Embodiments of the present invention provide a technical solution for encoding a small-sized transform coefficient block using an entropy encoding method suitable for a large-sized transform coefficient block.

本发明实施例首先提供一种兼容不同大小块变换的编码方法。参见图3,图3是该方法的流程图。该流程可包括以下步骤:Embodiments of the present invention firstly provide a coding method compatible with block transformations of different sizes. Referring to Fig. 3, Fig. 3 is a flowchart of the method. The process may include the following steps:

步骤301、对根据视频图像数据得到的N个子变换系数块中的每个子变换系数块进行扫描,生成由该子变换系数块中的系数组成的子序列;Step 301. Scan each of the N sub-transform coefficient blocks obtained from the video image data to generate a subsequence composed of coefficients in the sub-transform coefficient block;

其中,N是大于或等于2的正整数,且所述N个子变换系数块中的第i个子变换系数块包含

Figure A20071011168500131
个系数,i=1,2,......,N,ni和mi是大于或等于1的正整数。Wherein, N is a positive integer greater than or equal to 2, and the ith sub-transform coefficient block among the N sub-transform coefficient blocks contains
Figure A20071011168500131
coefficients, i=1, 2,..., N, n i and m i are positive integers greater than or equal to 1.

步骤302、提取各子序列中的系数,对提取出来的系数进行交织处理,生成待编码序列。Step 302, extract coefficients in each subsequence, perform interleaving processing on the extracted coefficients, and generate a sequence to be encoded.

步骤303、利用包含2x×2y个系数的变换系数块所适用的熵编码方式对所述待编码序列进行编码;Step 303: Encoding the sequence to be encoded using an entropy encoding method applicable to a transform coefficient block containing 2 x × 2 y coefficients;

其中,x和y是大于或等于2的正整数,且所述变换系数块所含系数个数2x×2y大于或等于N个子变换系数块所含系数个数之和,即:Wherein, x and y are positive integers greater than or equal to 2, and the number of coefficients contained in the transform coefficient block 2 x × 2 y is greater than or equal to the sum of the coefficients contained in N sub-transform coefficient blocks, namely:

22 xx ×× 22 ythe y ≥&Greater Equal; ΣΣ ii == 11 NN 22 nno ii ×× 22 mm ii ..

上述包含2x×2y个系数的变换系数块相对于包含

Figure A20071011168500133
个系数的变换系数块而言,前者可以是大尺寸的块,后者可以是小尺寸的块。如前者是8×8大小的块,则后者的大小可为:4×4、2×2、4×8、8×4等等;如前者是16×8大小的块,则后者的大小可为:8×16、8×8、4×8、4×4、2×2等等。The above transform coefficient block containing 2 x × 2 y coefficients is relative to the block containing
Figure A20071011168500133
As far as the transform coefficient block of coefficients is concerned, the former can be a large-sized block, and the latter can be a small-sized block. If the former is a block of 8×8 size, the size of the latter can be: 4×4, 2×2, 4×8, 8×4, etc.; if the former is a block of 16×8 size, then the size of the latter Available in sizes: 8×16, 8×8, 4×8, 4×4, 2×2 and more.

参见图4,图4是本发明实施例中用于生成待进行编码的待编码序列的方法流程图,该流程可包括以下步骤:Referring to FIG. 4, FIG. 4 is a flow chart of a method for generating a sequence to be encoded to be encoded in an embodiment of the present invention, and the process may include the following steps:

步骤401、对根据视频图像数据得到的N个子变换系数块中的每个子变换系数块进行扫描,生成由该子变换系数块中的系数组成的子序列;Step 401: Scan each of the N sub-transform coefficient blocks obtained from the video image data to generate a subsequence composed of coefficients in the sub-transform coefficient block;

其中,N是大于或等于2的正整数,且所述N个子变换系数块中的第i个子变换系数块包含

Figure A20071011168500141
个系数,i=1,2,......,N,ni和mi是大于或等于1的正整数。Wherein, N is a positive integer greater than or equal to 2, and the ith sub-transform coefficient block among the N sub-transform coefficient blocks contains
Figure A20071011168500141
coefficients, i=1, 2,..., N, n i and m i are positive integers greater than or equal to 1.

步骤402、提取各子序列中的系数,对提取出来的系数进行交织处理,生成能够利用包含2x×2y个系数的变换块所适用的熵编码方式进行编码的待编码序列;Step 402, extracting the coefficients in each subsequence, performing interleaving processing on the extracted coefficients, and generating a sequence to be encoded that can be encoded using the entropy encoding method applicable to the transform block containing 2 x × 2 y coefficients;

其中,x和y是大于或等于2的正整数,且所述变换系数块所含系数个数2x×2y大于N个子变换系数块所含系数个数之和。Wherein, x and y are positive integers greater than or equal to 2, and the number of coefficients 2 x × 2 y contained in the transform coefficient block is greater than the sum of the coefficients contained in the N sub-transform coefficient blocks.

所需要说明的是,本发明实施例中,变换系数块或子变换系数块可能是经过量化处理的,也可能未经过量化处理。It should be noted that, in the embodiment of the present invention, the transform coefficient block or the sub-transform coefficient block may or may not be quantized.

参见图5,图5是本发明实施例中用于生成待进行编码的待编码序列的装置的结构示意图。该装置可包括:子序列生成单元、待编码序列生成单元、输出单元;其中,Referring to FIG. 5 , FIG. 5 is a schematic structural diagram of an apparatus for generating a sequence to be encoded to be encoded in an embodiment of the present invention. The device may include: a subsequence generating unit, a sequence to be encoded generating unit, and an output unit; wherein,

子序列生成单元,用于对根据视频图像数据得到的N个子变换系数块中的每个子变换系数块进行扫描,生成由该子变换系数块中的系数组成的子序列,将所生成的子序列信息传送给待编码序列生成单元;其中,N是大于或等于2的正整数,且第i个变换系数块包含

Figure A20071011168500142
个系数,i=1,2,......,N,ni和mi是大于或等于1的正整数;A sub-sequence generating unit, configured to scan each sub-transform coefficient block in the N sub-transform coefficient blocks obtained according to the video image data, generate a sub-sequence composed of coefficients in the sub-transform coefficient block, and convert the generated sub-sequence The information is sent to the sequence generation unit to be encoded; wherein, N is a positive integer greater than or equal to 2, and the i-th transform coefficient block contains
Figure A20071011168500142
coefficients, i=1, 2,..., N, n i and m i are positive integers greater than or equal to 1;

待编码序列生成单元,用于接收来自子序列生成单元的子序列信息,提取各子序列中的系数,对提取出来的系数进行交织处理,生成能够利用包含2x×2y个系数的变换块所适用的熵编码方式进行编码的待编码序列,将所述待编码序列信息传送给输出单元;The sequence generation unit to be encoded is used to receive the subsequence information from the subsequence generation unit, extract the coefficients in each subsequence, interleave the extracted coefficients, and generate a transformation block that can use 2 x × 2 y coefficients The to-be-encoded sequence encoded by the applicable entropy coding method, and the information of the to-be-encoded sequence is transmitted to the output unit;

输出单元,用于接收来自待编码序列生成单元的所述待编码序列信息,将该信息输出;an output unit, configured to receive the sequence information to be encoded from the sequence generation unit to be encoded, and output the information;

其中,x和y是大于或等于2的正整数,且所述变换系数块所含系数个数2x×2y大于N个子变换系数块所含系数个数之和。Wherein, x and y are positive integers greater than or equal to 2, and the number of coefficients 2 x × 2 y contained in the transform coefficient block is greater than the sum of the coefficients contained in the N sub-transform coefficient blocks.

参见图6,图6是图5中待编码序列生成单元的结构示意图。待编码序列生成单元可包括:系数提取模块、交织处理模块、待编码序列生成模块;其中,Referring to FIG. 6 , FIG. 6 is a schematic structural diagram of the to-be-encoded sequence generation unit in FIG. 5 . The unit to generate the sequence to be encoded may include: a coefficient extraction module, an interleaving processing module, and a sequence to be encoded generation module; wherein,

系数提取模块,用于从各子序列中提取出需要进行交织处理的系数,将所提取的系数信息传送给交织处理单元;The coefficient extraction module is used to extract coefficients that need to be interleaved from each subsequence, and transmit the extracted coefficient information to the interleaving processing unit;

交织处理单元,用于接收来自系数提取模块的系数信息将各个系数排列成一个序列,且保持原属于各个子序列中的系数在所述序列中的排列顺序,与在原子序列中的排列顺序相同,将该序列信息传送给待编码序列生成模块;an interleaving processing unit, configured to receive the coefficient information from the coefficient extraction module, arrange each coefficient into a sequence, and maintain the arrangement order of the coefficients originally belonging to each subsequence in the sequence, which is the same as the arrangement order in the atomic sequence , sending the sequence information to the sequence generation module to be encoded;

待编码序列生成模块,用于接收来自交织处理单元的所述序列信息,将所述序列作为待编码序列;或者对所述序列进行变换处理后,得到所述待编码序列。The to-be-encoded sequence generating module is configured to receive the sequence information from the interleaving processing unit, and use the sequence as the to-be-encoded sequence; or transform the sequence to obtain the to-be-encoded sequence.

参见图7,图7是本发明实施例中兼容不同大小块变换的编码器的结构示意图,可包括:用于生成待进行熵编码的待编码序列的装置、熵编码单元和发送单元;Referring to FIG. 7, FIG. 7 is a schematic structural diagram of an encoder compatible with block transformation of different sizes in an embodiment of the present invention, which may include: a device for generating a sequence to be encoded to be entropy encoded, an entropy encoding unit, and a sending unit;

用于生成待进行熵编码的待编码序列的装置可包括上述图5及图6所示单元或模块;The device for generating the sequence to be encoded to be entropy encoded may include the above-mentioned units or modules shown in FIG. 5 and FIG. 6;

熵编码单元,用于接收来自输出单元的所述待编码序列信息,利用包含2x×2y个系数的变换块所适用的熵编码方式对所述待编码序列进行编码,将编码结果信息传送给发送单元;An entropy encoding unit, configured to receive the sequence information to be encoded from the output unit, encode the sequence to be encoded using an entropy encoding method applicable to a transformation block containing 2 x × 2 y coefficients, and transmit the encoding result information to the sending unit;

发送单元,用于接收来自熵编码单元的编码结果信息,将该信息发送出去;a sending unit, configured to receive the encoding result information from the entropy encoding unit, and send the information;

其中,x和y是大于或等于2的正整数,且所述变换系数块所含系数个数2x×2y大于N个子变换系数块所含系数个数之和。Wherein, x and y are positive integers greater than or equal to 2, and the number of coefficients 2 x × 2 y contained in the transform coefficient block is greater than the sum of the coefficients contained in the N sub-transform coefficient blocks.

下面给出本发明实施例提供的上述技术方案的具体实施例。Specific examples of the above technical solutions provided by the embodiments of the present invention are given below.

实施例一:Embodiment one:

本实施例一中,设需要采用大小为8×8的变换系数块所适用的熵编码方式对四个4×4的子变换系数块进行编码。In the first embodiment, it is assumed that four 4×4 sub-transform coefficient blocks need to be encoded using an entropy coding method applicable to a size of 8×8 transform coefficient blocks.

本实施例一中,设可用SBi表示该四个子变换系数块中的一个,i可取1、2、3或4。参见图8、图9a和图9b,其中,图8是4个4×4的子变换系数块的组合示意图;图9a是公知的一个4×4块的之字扫描方式示意图;图9b是公知的一个4×4块的场扫描方式示意图。通常,一个二维的变换系数块中,低频高幅的系数会排在块的左上角,通过扫描,可将二维的变换系数块得到一个一维序列,并且,该一维序列中系数从左至右的排列规则通常是按幅值递减的方式排列,序列中系数按照该方式排列,可提高后续熵编码效率。由于系数幅值是统计得出的,因此,也并不排除其中可能出现幅值较小的系数,排列在幅值较大的系数之前的情形,但总的来说,一维序列排序的整体趋势是按系数所对应的频率从低到高的排列趋势排列的。并且,序列中,通常开始部分的一些系数幅值非零,之后多数系数幅值为零。In the first embodiment, it is assumed that SBi can be used to represent one of the four sub-transform coefficient blocks, and i can be 1, 2, 3 or 4. Referring to Fig. 8, Fig. 9a and Fig. 9b, Fig. 8 is a schematic diagram of the combination of four 4×4 sub-transform coefficient blocks; Fig. 9a is a schematic diagram of a known zigzag scanning method of a 4×4 block; Fig. 9b is a schematic diagram of a known A schematic diagram of the field scanning method of a 4×4 block. Usually, in a two-dimensional transform coefficient block, low-frequency and high-amplitude coefficients are arranged in the upper left corner of the block. By scanning, a one-dimensional sequence can be obtained from the two-dimensional transform coefficient block, and the coefficients in the one-dimensional sequence are from The arrangement rule from left to right is usually arranged in a manner of decreasing amplitude, and the coefficients in the sequence are arranged in this manner, which can improve the efficiency of subsequent entropy coding. Since the magnitude of the coefficients is obtained statistically, it does not rule out that the coefficients with smaller magnitudes may appear before the coefficients with larger magnitudes, but in general, the overall order of the one-dimensional sequence The trends are arranged in order of the frequency corresponding to the coefficients, from low to high. Also, in the sequence, usually some coefficients have non-zero magnitudes at the beginning, and most coefficients have zero magnitudes thereafter.

参见图10,图10是本发明实施例一中对四个4×4的子变换系数块进行编码的流程图,该流程包括以下步骤:Referring to FIG. 10, FIG. 10 is a flow chart of encoding four 4×4 sub-transform coefficient blocks in Embodiment 1 of the present invention. The process includes the following steps:

步骤1001、对四个子变换系数块SBi按照图9a扫描方式分别进行扫描,得到四个子序列Si,每个子序列都包含16个系数,即,Step 1001, scan the four sub-transform coefficient blocks SBi respectively according to the scanning method in Fig. 9a to obtain four sub-sequences Si, each sub-sequence contains 16 coefficients, that is,

S1:a0,a1,a2,...,a15;S1: a0, a1, a2, ..., a15;

S2:b0,b1,b2,...,b15;S2: b0, b1, b2, ..., b15;

S3:c0,c1,c2,...,c15;S3: c0, c1, c2, ..., c15;

S4:d0,d1,d2,...,d15。S4: d0, d1, d2, ..., d15.

本实施例中,所采用的扫描方式也可采用图9b的扫描方式或适用于熵编码方式的其他扫描方式。In this embodiment, the scanning manner used may also be the scanning manner shown in FIG. 9b or other scanning manners suitable for the entropy coding manner.

步骤1002、查看各子序列中的系数,如果S1至S4子序列中的系数全部为零,则执行步骤1003;否则,执行步骤1004。Step 1002 , check the coefficients in each subsequence, if the coefficients in the S1 to S4 subsequences are all zero, execute step 1003 ; otherwise, execute step 1004 .

步骤1003、可得到表示上述四个子序列中的全部系数均为零的编码结果,且可设置标记标示该编码结果,结束本次编码流程。In step 1003, an encoding result indicating that all the coefficients in the above four subsequences are zero can be obtained, and a flag can be set to mark the encoding result, and this encoding process ends.

本实施例中,可设置变量cbp,根据该变量值,可判断是否需要继续编码流程,如设定若四个子序列中的全部系数均为零,则cbp=0;否则,cbp=1;即若cbp=0,则可结束本次编码流程,将cbp=0写入编码结果,若cbp=1,则需要继续执行后续步骤。In this embodiment, the variable cbp can be set, and according to the value of the variable, it can be judged whether the encoding process needs to be continued. For example, if all the coefficients in the four subsequences are set to be zero, then cbp=0; otherwise, cbp=1; If cbp=0, this encoding process can be ended, and cbp=0 is written into the encoding result; if cbp=1, subsequent steps need to be continued.

步骤1004、将四个子序列中,系数不全部为零的子序列中的系数提取出来,执行后续步骤,并可将系数全部为零的子序列删去。Step 1004, extract the coefficients in the subsequences whose coefficients are not all zeros among the four subsequences, perform subsequent steps, and delete the subsequences whose coefficients are all zeros.

本实施例中,也可设置变量来标示各个子序列是否为零的情况。如设置cbpSi,若cbpSi=0,则可标示该子序列Si的系数全部为零,可将该Si序列删除;若cbpSi=1,则可表示该子序列需要进行编码处理。且,也可将该变量cbpSi的值写入编码结果。In this embodiment, variables can also be set to indicate whether each subsequence is zero. If cbpSi is set, if cbpSi=0, it can indicate that the coefficients of the subsequence Si are all zero, and the Si sequence can be deleted; if cbpSi=1, it can indicate that the subsequence needs to be encoded. Also, the value of the variable cbpSi may also be written into the encoding result.

步骤1005、对提取出来的系数进行交织处理,以得到由这些子序列中的系数组成的可不超过64个系数的序列。Step 1005, perform interleaving processing on the extracted coefficients to obtain a sequence consisting of coefficients in these subsequences which may not exceed 64 coefficients.

本实施例中,若四个子序列中均存在不为零的系数,则交织处理后所得到的序列可为:In this embodiment, if there are non-zero coefficients in the four subsequences, the sequence obtained after the interleaving process can be:

a0 b0 c0 d0 a1 b1 c1 d1 a2 b2 c2 d2...a15 b15 c15 d15       (1);a0 b0 c0 d0 a1 b1 c1 d1 a2 b2 c2 d2...a15 b15 c15 d15 (1);

交织处理的做法可以是将各个系数排列成一个序列,且保持原属于各个子序列中的系数在所述序列中的排列顺序,与在原子序列中的排列顺序相同,为进一步提高后续熵编码效率,序列中系数所对应的频率可呈现从低到高的排列趋势。如上述序列(1)中,系数a0,a1,a2,...,a15的排列顺序与S1中的相同,系数b0,b1,b2,...,b15的排列顺序与S2中的相同,类似可看出原S3和S4中的系数在码序列(1)中的排列顺序与在各自所属的原子序列中的排列顺序相同。并且,本实施例中,交织处理后得到的序列也可以是:The method of interleaving processing can be to arrange each coefficient into a sequence, and maintain the arrangement order of the coefficients originally belonging to each subsequence in the sequence, which is the same as the arrangement order in the atomic sequence, in order to further improve the subsequent entropy coding efficiency , the frequencies corresponding to the coefficients in the sequence can show a trend of arrangement from low to high. As in the above sequence (1), the arrangement order of the coefficients a0, a1, a2, ..., a15 is the same as that in S1, and the arrangement order of the coefficients b0, b1, b2, ..., b15 is the same as that in S2, Similarly, it can be seen that the arrangement order of the coefficients in the original S3 and S4 in the code sequence (1) is the same as that in the respective atomic sequences. And, in this embodiment, the sequence obtained after the interleaving process may also be:

a0 b0 d0 c0 a1 c1 b1 d1 b2 a2 c2 d2...c15 a15 b15 d15            (2);a0 b0 d0 c0 a1 c1 b1 d1 b2 a2 c2 d2...c15 a15 b15 d15 (2);

其他可能的情况不再列举。Other possible situations are not listed.

步骤1006、可对a0、b0、c0、d0做2×2的哈达码(Hadamard)变换,序列(1)被变换为序列(3):Step 1006, a0, b0, c0, d0 can be done with 2×2 Hadamard (Hadamard) transformation, sequence (1) is transformed into sequence (3):

a0’b0’c0’d0’a1 b1 c1 d1 a2 b2 c2 d2...a15 b15 c15 d15        (3);a0'b0'c0'd0'a1 b1 c1 d1 a2 b2 c2 d2...a15 b15 c15 d15 (3);

实际应用中,可将序列(1)作为待编码序列,在后续直接对该待编码序列进行编码。在本实施例中,为进一步提高后续熵编码效率,还需要对序列(1)进行变换处理,变换处理后所得到的序列(3)将作为待编码序列。本实施例中,对序列(1)采用哈达码(Hadamard)变换,Hadamard变换的作用在于是系数幅值所体现的能量进一步集中由a0’来体现,经过该变换后,序列(3)中,可能从b0’开始,系数就已经接近于零。从而,后续对序列(3)进行熵编码时,可只对a0’进行编码,得出对应的码字。若对序列(1)或(2)进行了Hadamard变换,那么可在编码结果中写入采用了该变换的标记。In practical applications, the sequence (1) can be used as the sequence to be encoded, and the sequence to be encoded can be directly encoded subsequently. In this embodiment, in order to further improve the subsequent entropy coding efficiency, it is also necessary to perform transformation processing on the sequence (1), and the sequence (3) obtained after the transformation processing will be used as the sequence to be coded. In this embodiment, the Hadamard transformation is adopted for the sequence (1). The effect of the Hadamard transformation is that the energy embodied by the coefficient amplitude is further concentrated by a0'. After the transformation, in the sequence (3), Maybe starting from b0', the coefficient is already close to zero. Therefore, when performing entropy encoding on the sequence (3) subsequently, only a0' can be encoded to obtain the corresponding codeword. If the sequence (1) or (2) is subjected to Hadamard transformation, then a mark using the transformation can be written in the encoding result.

步骤1007、对序列(3)使用适用于8×8变换系数块的熵编码方式进行编码,本次编码流程结束。Step 1007, encode the sequence (3) using an entropy encoding method suitable for 8×8 transform coefficient blocks, and this encoding process ends.

另外,本发明实施例中,步骤1005也在步骤1002之前执行,若在步骤1002之前执行,则序列(1)中包含64个系数。步骤1002至步骤1004的技术方案是为进一步提高编码效率而给出的,实际应用中,可采用其他用以提高编码效率的做法。另外,可采用cbpS替代cbpSi,或者说可将四个子序列是否需要编码,或对其中的哪些子序列需要编码等的标示信息映射到cbpS,如cbpS=0,则可表示四个子序列中都只有预测直流(DC)系数,即a0、b0、c0、d0非零,其他系数均为零;若cbpS=1,可表示需要对四个子序列进行编码;若cbpS=2,可表示需要对子序列S1和S2进行编码,等等,不再列举。In addition, in the embodiment of the present invention, step 1005 is also executed before step 1002, if executed before step 1002, sequence (1) contains 64 coefficients. The technical solution from step 1002 to step 1004 is given to further improve the coding efficiency, and in practical application, other methods for improving the coding efficiency can be adopted. In addition, cbpS can be used instead of cbpSi, or the marking information of whether the four subsequences need to be coded, or which subsequences need to be coded, etc. can be mapped to cbpS, such as cbpS=0, it can indicate that only Predict the direct current (DC) coefficients, that is, a0, b0, c0, and d0 are non-zero, and the other coefficients are all zero; if cbpS=1, it means that four subsequences need to be encoded; if cbpS=2, it means that the subsequences need to be encoded S1 and S2 encode, etc., no longer enumerate.

上述对小尺寸的子变换系数块采用适用于大尺寸的变换系数块的熵编码方式进行编码的实施例一中,所选小尺寸的子变换系数块的组合是4个4×4的块,大尺寸变换系数块是8×8的块,且4个4×4的块恰好可组合成一个8×8的块。而实际上,本发明实施例提供的编码方案是一种兼容方案,即只要大尺寸的变换系数块的系数个数2x×2y大于参与组合的N个小尺寸的子变换系数块的系数个数之和,则均可对组合得出的N个小尺寸的子变换系数块用适用于大尺寸的变换系数块的熵编码方式进行编码,N个小尺寸的子变换系数块的大小也未必需要相同。因为,从实施例一可知,要使用大尺寸的变换系数块所适用的熵编码方式对小尺寸的子变换系数块进行编码,只要能够满足各个小尺寸的子变换系数块所含系数在经过交织所得到的待编码序列中所含系数个数,不超过大尺寸的变换系数块所含系数个数即可,当然,该处所说的经过交织所得到的待编码序列中所含系数个数包含在交织前后可能被删除的为零的系数个数。In the first embodiment in which the small-size sub-transform coefficient blocks are encoded using the entropy coding method suitable for large-size transform coefficient blocks, the combination of selected small-size sub-transform coefficient blocks is four 4×4 blocks, The large-size transform coefficient block is an 8×8 block, and four 4×4 blocks can be combined into one 8×8 block. In fact, the encoding scheme provided by the embodiment of the present invention is a compatible scheme, that is, as long as the number of coefficients 2 x × 2 y of the large-size transform coefficient block is greater than the coefficients of the N small-size sub-transform coefficient blocks participating in the combination The sum of the numbers can encode the combined N small-size sub-transform coefficient blocks with the entropy coding method suitable for large-size transform coefficient blocks, and the size of the N small-size sub-transform coefficient blocks is also Does not necessarily need to be the same. Because, as can be seen from Embodiment 1, to use the entropy coding method applicable to large-size transform coefficient blocks to encode small-size sub-transform coefficient blocks, as long as the coefficients contained in each small-size sub-transform coefficient block can be satisfied after interleaving The number of coefficients contained in the obtained sequence to be encoded should not exceed the number of coefficients contained in the large-size transform coefficient block. Of course, the number of coefficients contained in the sequence to be encoded obtained through interleaving includes The number of zero coefficients that may be removed before and after interleaving.

另外,上述实施例一中,除需要将熵编码结果写入编码结果,还可将上述子变换系数块的组合信息、扫描方式的信息、cbp的信息、cbpSi的信息、关于如何交织的信息、采用了Hadamard变换的标识信息等编码过程的特征信息写入编码结果,供解码端在解码时,依照与编码端相逆的过程进行解码。其中,关于如何交织的信息可以是,如何按本发明实施例中默认的交织方式,即交织后得到的序列为序列(1),则可不需要传送相关信息的标识,在解码端默认该交织方式,如果交织方式是非默认的,如交织后得到的序列是序列(2),则将非默认的交织方式标识信息写入编码结果,传送给解码端。In addition, in the first embodiment above, in addition to writing the entropy coding result into the coding result, the combination information of the above-mentioned sub-transform coefficient blocks, scanning mode information, cbp information, cbpSi information, information on how to interleave, The characteristic information of the encoding process, such as the identification information using the Hadamard transformation, is written into the encoding result for the decoding end to decode according to the reverse process of the encoding end. Wherein, the information about how to interleave can be, how to follow the default interleaving method in the embodiment of the present invention, that is, the sequence obtained after interleaving is sequence (1), then it is not necessary to transmit the identification of related information, and the interleaving method is defaulted at the decoding end , if the interleaving mode is non-default, such as the sequence obtained after interleaving is sequence (2), write the non-default interleaving mode identification information into the encoding result and send it to the decoding end.

实施例二:Embodiment two:

本实施例二中,采用适用于大小为8×8的变换系数块的熵编码方式对16个4×4的子变换系数块进行编码。In the second embodiment, the 16 sub-transform coefficient blocks of 4×4 are encoded by adopting an entropy coding method suitable for a transform coefficient block with a size of 8×8.

参见图11,图11是以一个4×4的子变换系数块为单位的16个子变换系数块的排列示意图。参见图12,图12是本实施例二中16个4×4的子变换系数块的编码组合方案示意图。如图12所示,本实施例二中,仍对4个4×4的子变换系数块作一个组合,如,将图11所示的0~3四个子变换系数块作为一个组合,将4~7四个子变换系数块作为一个组合,将8~11四个子变换系数块作为一个组合,以及将12~15四个子变换系数块作为一个组合。基于上述实施例一的编码流程,对本实施例中的上述4个组合分别采用8×8块所适用的熵编码方式进行编码。对每四个子变换系数块进行编码时的扫描顺序如图12所示,如对0~3四个子变换系数块进行编码时,先扫描子变换系数块0,得出对应的子序列;再扫描子变换系数块1,得出对应的子序列;然后扫描子变换系数块2,得出对应的子序列;最后扫描子变换系数块3,得出对应的子序列;之后从各子序列中提取系数,对提取的系数进行交织处理,后续处理流程可参见实施例一,不再赘述。Referring to FIG. 11 , FIG. 11 is a schematic diagram of arrangement of 16 sub-transform coefficient blocks in units of a 4×4 sub-transform coefficient block. Referring to FIG. 12 , FIG. 12 is a schematic diagram of an encoding combination scheme for 16 4×4 sub-transform coefficient blocks in the second embodiment. As shown in FIG. 12 , in the second embodiment, a combination of four 4×4 sub-transform coefficient blocks is still made. For example, the four sub-transform coefficient blocks 0 to 3 shown in FIG. 11 are used as a combination, and 4 The four sub-transform coefficient blocks of ~7 are taken as a group, the four sub-transform coefficient blocks of 8-11 are taken as a group, and the four sub-transform coefficient blocks of 12-15 are taken as a group. Based on the encoding process of the first embodiment above, the above four combinations in this embodiment are respectively encoded using an entropy encoding method applicable to 8×8 blocks. The scanning sequence when encoding each four sub-transform coefficient blocks is shown in Figure 12. For example, when encoding the four sub-transform coefficient blocks 0 to 3, first scan sub-transform coefficient block 0 to obtain the corresponding subsequence; then scan Sub-transform coefficient block 1 to obtain the corresponding subsequence; then scan sub-transform coefficient block 2 to obtain the corresponding subsequence; finally scan sub-transform coefficient block 3 to obtain the corresponding subsequence; then extract from each subsequence For the coefficients, interleave processing is performed on the extracted coefficients. For the subsequent processing flow, refer to Embodiment 1, and details are not repeated here.

另外,可在编码结果中写入有关本次编码中各个子变换系数块的组合信息,如该组合由4个4×4的子变换系数块组成,这样的组合共有四个,共有16个子变换系数块,按图11所示排列方式排列。In addition, information about the combination of each sub-transform coefficient block in this encoding can be written in the encoding result. For example, the combination consists of four 4×4 sub-transform coefficient blocks. There are four such combinations, and a total of 16 sub-transform The coefficient blocks are arranged according to the arrangement shown in Fig. 11 .

实施例三:Embodiment three:

本实施例三中,采用适用于大小为8×8变换系数块的熵编码对16个4×4的子变换系数块进行编码。该16个子变换系数块的排列情况也可参见图11。参见图13,图13是本实施例三中16个4×4的子变换系数块的编码组合方案示意图。本实施例三中,可将子变换系数块0、4、8、12作为一个组合,即该组合包含四个4×4的子变换系数块,基于实施例一的编码流程,对该四个子变换系数块进行编码,其中,扫描顺序如图13所示,依次扫描子变换系数块0、5、8和12。In the third embodiment, entropy coding applicable to a transform coefficient block with a size of 8×8 is used to encode 16 sub-transform coefficient blocks of 4×4. Refer to FIG. 11 for the arrangement of the 16 sub-transform coefficient blocks. Referring to FIG. 13 , FIG. 13 is a schematic diagram of an encoding combination scheme for 16 4×4 sub-transform coefficient blocks in the third embodiment. In the third embodiment, the sub-transform coefficient blocks 0, 4, 8, and 12 can be regarded as a combination, that is, the combination includes four 4×4 sub-transform coefficient blocks. Based on the encoding process of the first embodiment, the four sub-transform coefficient blocks The transform coefficient blocks are coded, wherein, the scanning order is as shown in FIG. 13 , and the sub-transform coefficient blocks 0, 5, 8 and 12 are scanned sequentially.

对于其余的1、4、2、3、6、7、9、13、10、11、14、15子变换系数块,可继续形成4个组合:1、2、3组合;5、6、7组合;9、10、11组合;13、14、15组合。如对1、2、3组合进行编码时,按如图13所示扫描顺序,先扫描子变换系数块1,得到对应的子序列;然后扫描子变换系数块2,得出对应的子序列;最后扫描子变换系数块3,得出对应的子序列;将得出的三个子序列进行交织处理,交织处理的做法仍然是:保持原属于各个子序列中的系数在所述序列中的排列顺序,与在原子序列中的排列顺序相同。For the remaining 1, 4, 2, 3, 6, 7, 9, 13, 10, 11, 14, and 15 sub-transform coefficient blocks, four combinations can be formed: 1, 2, 3 combinations; 5, 6, 7 Combinations; 9, 10, 11 combinations; 13, 14, 15 combinations. For example, when encoding the combination of 1, 2, and 3, according to the scanning sequence shown in Figure 13, first scan the sub-transform coefficient block 1 to obtain the corresponding subsequence; then scan the sub-transform coefficient block 2 to obtain the corresponding subsequence; Finally, the sub-transform coefficient block 3 is scanned to obtain the corresponding subsequence; the obtained three subsequences are interleaved, and the method of interleaving is still: keep the order of the coefficients originally belonging to each subsequence in the sequence , in the same order as in the atomic sequence.

其余三个组合形成各自待编码序列的过程可类推,不再赘述。The process of forming the sequences to be coded by the remaining three combinations can be analogized, and will not be repeated here.

本实施例中,参与组合的多个子变换系数块未必需要是连续的或紧挨的,可根据需要选择间隔较远的子变换系数块。本实施例中,也可将组合相关信息写入编码结果,写入方式可采用映射写入或变量幅值。In this embodiment, the multiple sub-transform coefficient blocks participating in the combination do not necessarily need to be continuous or close to each other, and sub-transform coefficient blocks that are far apart can be selected as required. In this embodiment, the combination related information may also be written into the encoding result, and the writing method may use mapping writing or variable amplitude.

实施例四:Embodiment four:

本实施例四中,采用适用于大小为8×8的变换系数块的熵编码方式对不同尺寸的子变换系数块进行编码。参见图14,图14是本实施例四中不同尺寸的子变换系数块的组合示意图。该组合包括:4个2×2的子变换系数块,3个4×4的子变换系数块。现对如何得到该组合的待编码序列作说明。参见图15,图15是本实施例四中得出图14所示组合的待编码序列的流程图,该流程可包括以下步骤:In Embodiment 4, sub-transform coefficient blocks of different sizes are encoded by using an entropy coding method suitable for transform coefficient blocks with a size of 8×8. Referring to FIG. 14 , FIG. 14 is a schematic diagram of combinations of sub-transform coefficient blocks of different sizes in the fourth embodiment. The combination includes: four 2×2 sub-transform coefficient blocks, and three 4×4 sub-transform coefficient blocks. How to obtain the combined sequence to be encoded will now be described. Referring to Fig. 15, Fig. 15 is a flow chart of obtaining the sequence to be coded in combination shown in Fig. 14 in the fourth embodiment, and the process may include the following steps:

步骤1501、依次扫描4个2×2的子变换系数块,得出对应的4个子序列Ai,i可取1、2、3、4。其中,Step 1501 , sequentially scan four 2×2 sub-transform coefficient blocks to obtain four corresponding sub-sequences Ai, where i can be 1, 2, 3, or 4. in,

A1:aa0、aa1、aa2、aa3;A1: aa0, aa1, aa2, aa3;

A2:ab0、ab1、ab2、ab3;A2: ab0, ab1, ab2, ab3;

A3:ac0、ac1、ac2、ac3;A3: ac0, ac1, ac2, ac3;

A4:ad0、ad1、ad2、ad3。A4: ad0, ad1, ad2, ad3.

步骤1502、从4个子序列中提取系数,对提出的系数进行交织处理,得出一个所含系数不超过16的S1序列。Step 1502, extract coefficients from the 4 subsequences, perform interleaving processing on the proposed coefficients, and obtain an S1 sequence containing no more than 16 coefficients.

S1:aa0、ab0、ac0、ad0、aa1、ab1、ac1、ad1...aa3、ab3、ac3、ad3。S1: aa0, ab0, ac0, ad0, aa1, ab1, ac1, ad1...aa3, ab3, ac3, ad3.

该步骤中,交织处理的做法与实施例一类似。In this step, the method of interleaving processing is similar to Embodiment 1.

步骤1503、对其余3个4×4的子变换系数块依次进行扫描处理,得出三个子序列:S2、S3、S4。Step 1503 , sequentially scan the remaining three 4×4 sub-transform coefficient blocks to obtain three sub-sequences: S2, S3, and S4.

S2:b0,b1,b2,...,b15;S2: b0, b1, b2, ..., b15;

S3:c0,c1,c2,...,c15;S3: c0, c1, c2, ..., c15;

S4:d0,d1,d2,...,d15。S4: d0, d1, d2, ..., d15.

步骤1504、对S1至S4四个子序列进行交织处理,得出待编码序列:Step 1504, interleaving the four subsequences S1 to S4 to obtain the sequence to be coded:

aa0、b0、c0、d0、ab0、b1、c1、d1、...、ad3、b15、c15、d15。aa0, b0, c0, d0, ab0, b1, c1, d1, ..., ad3, b15, c15, d15.

该步骤中,交织处理的做法与实施例一类似。In this step, the method of interleaving processing is similar to Embodiment 1.

本实施例中,上述步骤1502与步骤1503的执行顺序不需要严格遵守,也就是说,由于组合中存在多个子变换系数块,因此对该多个子变换系数块所进行的扫描,以及系数交织等处理顺序,可根据实际情况来进行,相应地,上述步骤301与302的执行次序,或步骤401与402的执行次序只是针对于最终所要得到的待编码序列而言的,即交织处理是对从各子序列中提取的系数进行的,而具体实施时,可能存在如该实施例四中的需要对不同尺寸的子变换系数块进行编码的情况,因此相应地,可采取类似于本实施例四的处理。In this embodiment, the order of execution of the above-mentioned steps 1502 and 1503 does not need to be strictly followed, that is, since there are multiple sub-transform coefficient blocks in the combination, the scanning of the multiple sub-transform coefficient blocks, coefficient interleaving, etc. The processing order can be carried out according to the actual situation. Correspondingly, the execution order of the above-mentioned steps 301 and 302, or the execution order of the steps 401 and 402 is only for the sequence to be encoded to be finally obtained, that is, the interleaving process is for the The coefficients extracted in each subsequence are carried out, and in specific implementation, there may be cases where sub-transform coefficient blocks of different sizes need to be encoded as in the fourth embodiment, so correspondingly, a method similar to that in the fourth embodiment can be adopted processing.

至此,得到待编码序列,之后对该待编码序列,用适用于8×8的变换系数块的熵编码方式对该待编码序列进行编码。So far, the to-be-coded sequence is obtained, and then the to-be-coded sequence is coded with an entropy coding method suitable for an 8×8 transform coefficient block.

实施例五:Embodiment five:

本实施例五中,采用适用于大小为8×8的变换系数块的熵编码方式对两个8×4的子变换系数块进行编码。参见图16,图16本实施例五中两个8×4的子变换系数块的组合示意图。参见图17,图17是本实施例五中得出图18所示组合的待编码序列的流程图,该流程可包括以下步骤:In the fifth embodiment, two 8×4 sub-transform coefficient blocks are encoded by using an entropy coding method suitable for a transform coefficient block with a size of 8×8. Referring to FIG. 16 , FIG. 16 is a schematic diagram of a combination of two 8×4 sub-transform coefficient blocks in the fifth embodiment. Referring to Fig. 17, Fig. 17 is a flow chart of obtaining the sequence to be coded in combination shown in Fig. 18 in the fifth embodiment, and the process may include the following steps:

步骤1701、采用如图16所示类似于之字的扫描方式,依次对两个8×4的子变换系数块进行扫描,得出对应的两个子序列S1和S2。其中,Step 1701 , using a zigzag-like scanning method as shown in FIG. 16 , sequentially scan two 8×4 sub-transform coefficient blocks to obtain two corresponding sub-sequences S1 and S2 . in,

S1:a0、b0、a1、b1、a2、b2、...、a15、b15;S1: a0, b0, a1, b1, a2, b2, ..., a15, b15;

S2:c0、d0、c1、d1、c2、d2、...、c15、d15。S2: c0, d0, c1, d1, c2, d2, . . . , c15, d15.

也可采用类似于场扫描的扫描或其他扫描方式,且通常扫描到的序列中,排在之前的系数幅值所体现的能量较大。Scanning similar to field scanning or other scanning methods may also be used, and generally, in the scanned sequence, the energy represented by the magnitude of the preceding coefficients is relatively large.

步骤1702、对从S1和S2中提取的系数进行交织处理,得出该组合的待编码序列:Step 1702, interleaving the coefficients extracted from S1 and S2 to obtain the combined sequence to be coded:

a0、b0、c0、d0、a1、b1、c1、d1、...、a15、b15、c15、d15。a0, b0, c0, d0, a1, b1, c1, d1, ..., a15, b15, c15, d15.

该步骤中,交织处理的做法与实施例一类似。In this step, the method of interleaving processing is similar to Embodiment 1.

至此,得到图16所示组合的待编码序列,之后对该待编码序列,用适用于8×8的变换系数块的熵编码方式对该待编码序列进行编码。So far, the sequence to be encoded combined as shown in FIG. 16 is obtained, and then the sequence to be encoded is encoded with the entropy encoding method suitable for the 8×8 transform coefficient block.

本发明实施例还提供一种与兼容不同大小块变换的编码相对应的解码方法,对编码结果按照与所述编码相逆的过程进行解码处理,即该解码过程与编码过程相对应,且是编码过程的逆过程。参见图18,图18是该解码方法的流程图,该流程可包括以下步骤:The embodiment of the present invention also provides a decoding method corresponding to the encoding compatible with different size block transformations, and the encoding result is decoded according to the reverse process of the encoding, that is, the decoding process corresponds to the encoding process, and is The inverse of the encoding process. Referring to FIG. 18, FIG. 18 is a flow chart of the decoding method, which may include the following steps:

步骤1801、对编码结果进行熵解码处理,得到待解码序列。Step 1801. Perform entropy decoding processing on the encoding result to obtain a sequence to be decoded.

该待解码序列对应的上述待编码序列相同。The sequence to be encoded corresponding to the sequence to be decoded is the same.

步骤1802、对所述待解码序列进行反交织处理,得到N个子序列。Step 1802: Perform deinterleaving processing on the sequence to be decoded to obtain N subsequences.

反交织处理的作用是将待解码序列重新还原成多个子序列。The function of deinterleaving is to restore the sequence to be decoded into multiple subsequences.

步骤1803、对所述N个子序列分别进行反扫描处理,得到N个子变换系数块。Step 1803: Perform inverse scanning processing on the N sub-sequences respectively to obtain N sub-transform coefficient blocks.

反扫描的作用是将各个序列中的系数重新还原到二维块中相应位置。The function of inverse scanning is to restore the coefficients in each sequence to the corresponding position in the two-dimensional block.

本发明实施例还提供一种与兼容不同大小块变换的编码器相对应的解码器。参见图19,图19是该解码器的结构示意图。该解码器可包括:熵解码单元、反交织处理单元、反扫描处理单元;其中,The embodiment of the present invention also provides a decoder corresponding to an encoder compatible with block transformations of different sizes. Referring to FIG. 19, FIG. 19 is a schematic structural diagram of the decoder. The decoder may include: an entropy decoding unit, an inverse interleaving processing unit, and an inverse scanning processing unit; wherein,

熵解码单元,对编码结果进行熵解码处理,得到待解码序列,将所述待解码系列的信息传送给反交织处理单元;该待解码序列对应的上述带编码序列相同;The entropy decoding unit performs entropy decoding processing on the encoding result to obtain the sequence to be decoded, and transmits the information of the sequence to be decoded to the deinterleaving processing unit; the above-mentioned coded sequence corresponding to the sequence to be decoded is the same;

反交织处理单元,用于接收来自熵解码单元的待解码序列的信息,对所述待解码序列进行反交织处理,得到N个子序列,将该N个子序列的信息传送给反扫描单元;The deinterleaving processing unit is used to receive the information of the sequence to be decoded from the entropy decoding unit, perform deinterleaving processing on the sequence to be decoded, obtain N subsequences, and transmit the information of the N subsequences to the descanning unit;

反扫描处理单元,用于接收来自反交织处理单元的N个子序列的信息,对所述N个子序列分别进行反扫描处理,得到N个子变换系数块。The inverse scanning processing unit is configured to receive the information of the N subsequences from the deinterleaving processing unit, and respectively perform inverse scanning processing on the N subsequences to obtain N sub-transform coefficient blocks.

以对上述实施例一的编码进行解码,说明本发明实施例中解码过程的实现。解码器对所接收到的编码结果进行解码,如:The implementation of the decoding process in the embodiment of the present invention is described by decoding the encoding in the first embodiment above. The decoder decodes the received encoding result, such as:

在编码结果中解码出子变换系数块的组合信息,获知待解码序列所对应的块的尺寸等信息;Decode the combination information of the sub-transform coefficient block in the encoding result, and obtain information such as the size of the block corresponding to the sequence to be decoded;

在编码结果中解码cbp的信息,如果cbp为0,后续就不存在更多关于本次编码的信息;如果cbp为1,继续解码;Decode cbp information in the encoding result. If cbp is 0, there will be no more information about this encoding; if cbp is 1, continue decoding;

解码出CbpSi(i=1,2,3,4)的信息,获知待解码序列对应哪些Si;Decode the information of CbpSi (i=1, 2, 3, 4), and know which Si corresponds to the sequence to be decoded;

解码出采用Hadamard变换标识,对待解码序列进行Hadamard逆变换,得到逆变换后的待解码序列;The Hadamard transformation is used for decoding, and the Hadamard inverse transformation is performed on the sequence to be decoded to obtain the sequence to be decoded after the inverse transformation;

未解码出交织方式标识,因此对变换后的待解码序列按默认交织方式进行反交织处理,得到多个子序列;The interleaving mode identifier has not been decoded, so the deinterleaving process is performed on the transformed sequence to be decoded according to the default interleaving mode, and multiple subsequences are obtained;

解码出扫描方式的信息,对各个子序列进行反扫描处理,将各系数重新归位到属原二维的子变换系数块的相应位置,对子变换系数块的解码就结束了。The information of the scanning mode is decoded, each sub-sequence is reverse-scanned, and each coefficient is repositioned to the corresponding position of the original two-dimensional sub-transform coefficient block, and the decoding of the sub-transform coefficient block is completed.

综上所述,本发明实施例提供的兼容不同大小块变换的编解码方案,通过将多个小尺寸的子变换系数块中所提取出的系数进行交织处理,得出适用于大尺寸的变换系数块的熵编码方式所能够处理的编码序列,使适用于大尺寸的变换系数块的熵编码方式也能够适用于小尺寸的变换系数块,从而,使基于不同大小的块编码的编码系统中,如一个引入ABT技术的编码系统,在拥有适用于大尺寸的变换系数块的熵编码方式的情况下,能够不需要重新设计适用于小尺寸的变换系数块的熵编码方式,因此,能够减少编码的设计成本,降低设计复杂度。In summary, the embodiment of the present invention provides a codec scheme compatible with block transformations of different sizes. By interleaving the coefficients extracted from multiple small-sized sub-transform coefficient blocks, a transformation suitable for large sizes is obtained. The coding sequence that can be processed by the entropy coding method of the coefficient block makes the entropy coding method suitable for the large-sized transform coefficient block also applicable to the small-sized transform coefficient block, so that in the coding system based on block coding of different sizes , such as a coding system that introduces ABT technology, in the case of having an entropy coding method suitable for a large-sized transform coefficient block, it does not need to redesign the entropy coding method suitable for a small-sized transform coefficient block, so it can reduce Coding design costs and reduce design complexity.

并且,本发明实施例中,由于可对多个子变换系数块同时编码,因此进一步减少块间相关性,提高编码性能。另外,本发明实施例中,可对多个子变换系数块同时编码,相比于一个一个地对子变换系数块进行编码的情况,减少读取编码的块结束(EoB)标记的次数,有效提高编码效率。Moreover, in the embodiment of the present invention, since multiple sub-transform coefficient blocks can be coded simultaneously, inter-block correlation is further reduced, and coding performance is improved. In addition, in the embodiment of the present invention, multiple sub-transform coefficient blocks can be coded at the same time. Compared with the case where the sub-transform coefficient blocks are coded one by one, the number of times to read the coded end-of-block (EoB) mark is reduced, which effectively improves Coding efficiency.

Claims (14)

1. A coding method compatible with different size block transforms, comprising:
scanning each of N sub-transform coefficient blocks obtained according to video image data to generate a sub-sequence composed of coefficients in the sub-transform coefficient block;
wherein N is a positive integer greater than or equal to 2, and an ith one of the N sub-transform coefficient blocks containsA coefficient, i 1, 2iAnd miIs a positive integer greater than or equal to 1;
extracting coefficients in each subsequence, and performing interweaving processing on the extracted coefficients to generate a sequence to be coded;
using an apparatus comprising 2x×2yCoding the sequence to be coded by an entropy coding mode applicable to the transformation block of each coefficient;
wherein x and y are positive integers greater than or equal to 2, and the transform coefficient block contains 2 coefficientsx×2yGreater than or equal to the sum of the number of coefficients contained in the N sub-transform coefficient blocks.
2. The method of claim 1, wherein the step of interleaving the extracted coefficients comprises:
and arranging the coefficients into a sequence, and keeping the arrangement sequence of the coefficients originally belonging to the subsequences in the sequence to be the same as the arrangement sequence in the atomic sequence.
3. The method of claim 2, wherein the step of arranging the respective coefficients into a sequence comprises: and arranging the coefficients according to the arrangement trend of the frequencies corresponding to the coefficients from low to high.
4. A method according to claim 1, 2 or 3, wherein the step of generating the sequence to be encoded comprises:
the sequence formed by arranging the coefficients is used as the sequence to be coded; or,
and carrying out transformation processing on the sequence to obtain a sequence to be coded.
5. The method of claim 4, wherein the transformation process comprises: hadamard transform.
6. A method according to claim 1, 2 or 3, wherein the step of extracting coefficients in each sub-sequence comprises:
if the coefficients in the subsequence are not all zeros, the coefficients in the subsequence are extracted.
7. A method as claimed in claim 1, 2 or 3, characterized in that x-3 and y-3.
8. A method as claimed in claim 1, 2 or 3, wherein the coefficients are quantized coefficients.
9. A method for generating a sequence to be encoded, comprising:
scanning each of N sub-transform coefficient blocks obtained according to video image data to generate a sub-sequence composed of coefficients in the sub-transform coefficient block;
wherein N is a positive integer greater than or equal to 2, and an ith one of the N sub-transform coefficient blocks contains
Figure A2007101116850003C1
A coefficient, i 1, 2iAnd miIs a positive integer greater than or equal to 1;
extracting coefficients in each subsequence, interleaving the extracted coefficients to generate a usable content 2x×2yThe coding sequence to be coded is coded by the entropy coding mode suitable for the transformation block of each coefficient;
wherein x and y are positive integers greater than or equal to 2, and the transform coefficient block contains 2 coefficientsx×2yGreater than or equal to the sum of the number of coefficients contained in the N sub-transform coefficient blocks.
10. An apparatus for generating a sequence to be encoded, comprising:
a subsequence generating unit, a to-be-coded sequence generating unit and an output unit; wherein,
a sub-sequence generating unit, which is used for scanning each sub-transformation coefficient block in N sub-transformation coefficient blocks obtained according to video image data, generating a sub-sequence consisting of coefficients in the sub-transformation coefficient block, and transmitting the generated sub-sequence information to a to-be-coded sequence generating unit; where N is a positive integer greater than or equal to 2, and the ith transform coefficient block contains
Figure A2007101116850003C2
A coefficient, i 1, 2iAnd miIs a positive integer greater than or equal to 1;
a to-be-coded sequence generating unit for receiving the subsequence information from the subsequence generating unit, extracting the coefficients in each subsequence, interleaving the extracted coefficients, and generating a usable code containing 2x×2yThe coding sequence to be coded is coded by the entropy coding mode applicable to the transformation block of each coefficient, and the information of the coding sequence to be coded is transmitted to an output unit;
the output unit is used for receiving the information of the code sequence to be coded from the code sequence generating unit and outputting the information;
wherein x and y are positive integers greater than or equal to 2, and the transform coefficient block contains 2 coefficientsx×2yGreater than or equal to the sum of the number of coefficients contained in the N sub-transform coefficient blocks.
11. The apparatus of claim 10, wherein the unit for generating the sequence to be coded comprises:
the device comprises a coefficient extraction module, an interleaving processing module and a to-be-coded sequence generation module; wherein,
the coefficient extraction module is used for extracting coefficients needing to be subjected to interleaving processing from each subsequence and transmitting the extracted coefficient information to the interleaving processing unit;
the interleaving processing unit is used for receiving the coefficient information from the coefficient extraction module, arranging each coefficient into a sequence, keeping the arrangement sequence of the coefficients originally belonging to each subsequence in the sequence, keeping the same as the arrangement sequence in the atomic sequence, and transmitting the sequence information to the module for generating the sequence to be coded;
a to-be-coded sequence generating module, configured to receive the sequence information from the interleaving unit, and use the sequence as a to-be-coded sequence; or transforming the sequence to obtain the coding sequence to be coded.
12. An encoder compatible with different size block transforms, comprising: means for generating a sequence to be coded to be entropy coded and an entropy coding unit;
the device for generating the sequence to be coded to be entropy coded comprises: a subsequence generating unit and a to-be-coded sequence generating unit; wherein,
a sub-sequence generating unit, which is used for scanning each sub-transformation coefficient block in N sub-transformation coefficient blocks obtained according to video image data, generating a sub-sequence consisting of coefficients in the sub-transformation coefficient block, and transmitting the generated sub-sequence information to a to-be-coded sequence generating unit; where N is a positive integer greater than or equal to 2, and the ith transform coefficient block contains
Figure A2007101116850004C1
A coefficient, i 1, 2iAnd miIs a positive integer greater than or equal to 1;
a to-be-coded sequence generating unit for receiving the subsequence information from the subsequence generating unit, extracting the coefficients in each subsequence, interleaving the extracted coefficients, and generating a usable code containing 2x×2yThe coding sequence to be coded is coded by the entropy coding mode applicable to the transformation block of each coefficient, and the information of the coding sequence to be coded is transmitted to an output unit;
the output unit is used for receiving the information of the code sequence to be coded from the code sequence generating unit and outputting the information;
an entropy coding unit for receiving the information of the sequence to be coded from the output unit, using a code comprising 2x×2yCoding the sequence to be coded by an entropy coding mode applicable to the transformation block of each coefficient;
wherein x and y are positive integers greater than or equal to 2, and the transform coefficient block contains 2 coefficientsx×2yGreater than or equal to the sum of the number of coefficients contained in the N sub-transform coefficient blocks.
13. A decoding method corresponding to an encoding compatible with a transform of blocks of different sizes, for performing a decoding process on an encoding result in a process inverse to the encoding, comprising:
carrying out entropy decoding processing on the encoding result to obtain a sequence to be decoded;
performing reverse interleaving processing on the sequence to be decoded to obtain N subsequences;
and respectively carrying out inverse scanning processing on the N subsequences to obtain N sub-transformation coefficient blocks.
14. A decoder corresponding to an encoder compatible with different size block transforms, comprising: the device comprises an entropy decoding unit, an inverse interleaving processing unit and an inverse scanning processing unit; wherein,
the entropy decoding unit is used for carrying out entropy decoding processing on the encoding result to obtain a sequence to be decoded and transmitting the information of the sequence to be decoded to the de-interleaving processing unit;
the device comprises an entropy decoding unit, a reverse interleaving unit and a reverse scanning unit, wherein the entropy decoding unit is used for decoding a sequence to be decoded;
and the inverse scanning processing unit is used for receiving the information of the N subsequences from the inverse interleaving processing unit and respectively performing inverse scanning processing on the N subsequences to obtain N sub-transformation coefficient blocks.
CN 200710111685 2007-06-10 2007-06-10 Codec methods and codecs compatible with different size block transformations Expired - Fee Related CN101321283B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN 200710111685 CN101321283B (en) 2007-06-10 2007-06-10 Codec methods and codecs compatible with different size block transformations
PCT/CN2008/071233 WO2008151560A1 (en) 2007-06-10 2008-06-06 Coding and decoding method, coder and decoder, and method and device for generating the sequences to be coded

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200710111685 CN101321283B (en) 2007-06-10 2007-06-10 Codec methods and codecs compatible with different size block transformations

Publications (2)

Publication Number Publication Date
CN101321283A true CN101321283A (en) 2008-12-10
CN101321283B CN101321283B (en) 2010-04-07

Family

ID=40129254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200710111685 Expired - Fee Related CN101321283B (en) 2007-06-10 2007-06-10 Codec methods and codecs compatible with different size block transformations

Country Status (2)

Country Link
CN (1) CN101321283B (en)
WO (1) WO2008151560A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104041029A (en) * 2012-01-13 2014-09-10 高通股份有限公司 Determining contexts for coding transform coefficient data in video coding
CN105284110A (en) * 2013-07-31 2016-01-27 松下电器(美国)知识产权公司 Image coding method, and image coding device
CN106878748A (en) * 2010-08-17 2017-06-20 M&K控股株式会社 For the equipment of decoding moving picture
CN109996074A (en) * 2017-12-29 2019-07-09 富士通株式会社 Picture coding device, picture decoding apparatus and electronic equipment
CN110291792A (en) * 2017-01-11 2019-09-27 交互数字Vc控股公司 The ratio depending on block of asymmetric coding unit size
US20210211743A1 (en) 2010-04-13 2021-07-08 Ge Video Compression, Llc Coding of a spatial sampling of a two-dimensional information signal using sub-division
US11546641B2 (en) 2010-04-13 2023-01-03 Ge Video Compression, Llc Inheritance in sample array multitree subdivision
US11611761B2 (en) 2010-04-13 2023-03-21 Ge Video Compression, Llc Inter-plane reuse of coding parameters
US11734714B2 (en) 2010-04-13 2023-08-22 Ge Video Compression, Llc Region merging and coding parameter reuse via merging

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120009618A (en) * 2010-07-19 2012-02-02 에스케이 텔레콤주식회사 Frequency conversion unit division encoding method and apparatus and image encoding / decoding method and apparatus using same

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6795584B2 (en) * 2002-10-03 2004-09-21 Nokia Corporation Context-based adaptive variable length coding for adaptive block transforms
JP3679083B2 (en) * 2002-10-08 2005-08-03 株式会社エヌ・ティ・ティ・ドコモ Image encoding method, image decoding method, image encoding device, image decoding device, image encoding program, image decoding program
CN1286322C (en) * 2004-08-06 2006-11-22 联合信源数字音视频技术(北京)有限公司 Quantizing device for low complicated degree integer 4x4 discrete cosine transform and its realizing method
US7839933B2 (en) * 2004-10-06 2010-11-23 Microsoft Corporation Adaptive vertical macroblock alignment for mixed frame video sequences
CN100345449C (en) * 2005-03-18 2007-10-24 清华大学 Method of entropy coding of transformation coefficient in image/video coding

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11736738B2 (en) 2010-04-13 2023-08-22 Ge Video Compression, Llc Coding of a spatial sampling of a two-dimensional information signal using subdivision
US11765363B2 (en) 2010-04-13 2023-09-19 Ge Video Compression, Llc Inter-plane reuse of coding parameters
US12120316B2 (en) 2010-04-13 2024-10-15 Ge Video Compression, Llc Inter-plane prediction
US12010353B2 (en) 2010-04-13 2024-06-11 Ge Video Compression, Llc Inheritance in sample array multitree subdivision
US11983737B2 (en) 2010-04-13 2024-05-14 Ge Video Compression, Llc Region merging and coding parameter reuse via merging
US11910029B2 (en) 2010-04-13 2024-02-20 Ge Video Compression, Llc Coding of a spatial sampling of a two-dimensional information signal using sub-division preliminary class
US11910030B2 (en) 2010-04-13 2024-02-20 Ge Video Compression, Llc Inheritance in sample array multitree subdivision
US11553212B2 (en) 2010-04-13 2023-01-10 Ge Video Compression, Llc Inheritance in sample array multitree subdivision
US11546642B2 (en) 2010-04-13 2023-01-03 Ge Video Compression, Llc Coding of a spatial sampling of a two-dimensional information signal using sub-division
US11765362B2 (en) 2010-04-13 2023-09-19 Ge Video Compression, Llc Inter-plane prediction
US11546641B2 (en) 2010-04-13 2023-01-03 Ge Video Compression, Llc Inheritance in sample array multitree subdivision
US20210211743A1 (en) 2010-04-13 2021-07-08 Ge Video Compression, Llc Coding of a spatial sampling of a two-dimensional information signal using sub-division
US11734714B2 (en) 2010-04-13 2023-08-22 Ge Video Compression, Llc Region merging and coding parameter reuse via merging
US11611761B2 (en) 2010-04-13 2023-03-21 Ge Video Compression, Llc Inter-plane reuse of coding parameters
CN106878748B (en) * 2010-08-17 2019-12-06 M&K控股株式会社 Apparatus for decoding moving picture
CN106878748A (en) * 2010-08-17 2017-06-20 M&K控股株式会社 For the equipment of decoding moving picture
CN104041029A (en) * 2012-01-13 2014-09-10 高通股份有限公司 Determining contexts for coding transform coefficient data in video coding
CN104041029B (en) * 2012-01-13 2018-03-06 高通股份有限公司 It is determined that it is used for the context for decoding transform coefficient data in video coding
CN105284110A (en) * 2013-07-31 2016-01-27 松下电器(美国)知识产权公司 Image coding method, and image coding device
CN105284110B (en) * 2013-07-31 2019-04-23 太阳专利托管公司 Image encoding method and picture coding device
US11533502B2 (en) 2017-01-11 2022-12-20 Interdigital Madison Patent Holdings, Sas Asymmetric coding unit size block dependent ratio
CN110291792A (en) * 2017-01-11 2019-09-27 交互数字Vc控股公司 The ratio depending on block of asymmetric coding unit size
CN109996074A (en) * 2017-12-29 2019-07-09 富士通株式会社 Picture coding device, picture decoding apparatus and electronic equipment

Also Published As

Publication number Publication date
WO2008151560A1 (en) 2008-12-18
CN101321283B (en) 2010-04-07

Similar Documents

Publication Publication Date Title
CN101321283B (en) Codec methods and codecs compatible with different size block transformations
CN104618728B (en) Method and apparatus for carrying out entropy coding and entropy decoding to video data
JP2023040013A (en) Method and Apparatus for Video Encoding and Video Decoding Binary Sets Using Adaptive Tree Selection
JP6491691B2 (en) Method and apparatus for improved entropy encoding and decoding
AU2006204634B2 (en) Runlength encoding of leading ones and zeros
CN1200568C (en) Optimum scanning method for change coefficient in coding/decoding image and video
US8532192B2 (en) Video processing apparatus and a method of processing video data
KR101313952B1 (en) Compressed domain system and method for compression gains in encoded data
CN101389014A (en) A region-based video encoding and decoding method with variable resolution
CN118354094A (en) Video image encoding and decoding method and device, electronic equipment and computer storage medium
KR20100089546A (en) Method and apparatus for successively encoding/decoding image
JP2993212B2 (en) How to combine images
Keshaveni et al. Implementation of context adaptive variable length coder for H. 264 video encoder
Min et al. Enhanced renormalization algorithm in MQ-coder of JPEG2000
CN101242529A (en) Data compression device and method
KR100460947B1 (en) Device for processing image signal and method thereof
Pan et al. A binary wavelet-based scheme for grayscale image compression
Tin A LOSSY CODING SCHEME FOR IMAGES BY USING THE HAAR WAVELET TRANSFORM AND THE THEORY OF IDEAL CROSS-POINTS REGIONS
Muharam et al. Efficient Architecture for 3-D Medical Image Compression Using CABAC
JPH06350856A (en) Picture encoding device
Jung et al. An efficient VLSI architecture for JPEG2000 encoder
JP2004056575A (en) Moving image encoding device, moving image decoding device and their methods
Guo Analysis and Design of Lossless Bi-level Image Coding Systems
HK1227583A1 (en) Methods and apparatus for video encoding and decoding binary sets using adaptive tree selection

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100407

Termination date: 20160610