[go: up one dir, main page]

CN101166272B - Data storage method for difference compensation points - Google Patents

Data storage method for difference compensation points Download PDF

Info

Publication number
CN101166272B
CN101166272B CN 200610135945 CN200610135945A CN101166272B CN 101166272 B CN101166272 B CN 101166272B CN 200610135945 CN200610135945 CN 200610135945 CN 200610135945 A CN200610135945 A CN 200610135945A CN 101166272 B CN101166272 B CN 101166272B
Authority
CN
China
Prior art keywords
storage area
temporary storage
point
integer
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN 200610135945
Other languages
Chinese (zh)
Other versions
CN101166272A (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.)
Industrial Technology Research Institute ITRI
Original Assignee
Industrial Technology Research Institute ITRI
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 Industrial Technology Research Institute ITRI filed Critical Industrial Technology Research Institute ITRI
Priority to CN 200610135945 priority Critical patent/CN101166272B/en
Publication of CN101166272A publication Critical patent/CN101166272A/en
Application granted granted Critical
Publication of CN101166272B publication Critical patent/CN101166272B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention provides a data storage method of compensation point, which uses the temporary storage area in the high-speed buffer and the concept of storing overlapping record to store the calculated data of compensation point, thereby avoiding repeated calculation, reducing the system operation amount and reducing the times of reading integer point from the external memory to calculate the compensation point. In addition, the invention provides a data storage mode of the temporary storage area, and utilizes the concept of memory address rotation to store the data of the interpolation point beyond the boundary of the temporary storage area. The invention also stores the interpolation point data in a plurality of areas according to different combinations of the decimal part of the coordinate of the interpolation point, thereby saving the storage space of the temporary storage area and being convenient for searching the interpolation point data in the temporary storage area.

Description

补差点数据储存方法 Data storage method for making up shortfall points

技术领域technical field

本发明是关于在视频编码与解码系统中的补差点运算(interpolation),且特别是关于视频编码与解码系统中的补差点数据储存方法。The present invention relates to an interpolation calculation in a video encoding and decoding system, and in particular to a method for storing interpolation data in a video encoding and decoding system.

背景技术Background technique

在目前视频编码与解码系统中,动态估计(motion estimation)具有1/2、1/4、1/8点的精准度,而此非整数点不存在于外部存储器之中,为利用存在外部存储器的整数点计算而来。所以在视频编码与解码系统中,无论动态估计或动态补偿(motion compensation),只要涉及非整数点的动态向量(motion vector),都会使用补差点运算。In the current video encoding and decoding system, motion estimation (motion estimation) has the accuracy of 1/2, 1/4, 1/8 point, and this non-integer point does not exist in the external memory, there is an external memory for use Integer points calculated from . Therefore, in the video encoding and decoding system, regardless of motion estimation or motion compensation, as long as the motion vector of non-integer points is involved, the compensation point operation will be used.

举例而言,如图1所示,在H.264视频系统规格中,其1/2点位置像素(pixel)的值为利用六组系数(six-tap)的有限脉冲响应滤波器(finiteimpulse response,简称为FIR)所计算出来。图1当中,白色方块(如A、B、C、D等)表示整数点位置,而内含线条的方块(如aa、bb、h、m等)表示需要补差点运算的1/2点位置。b点位置像素的值为算式(E-5F+20G+20H-5I+J)/32的值取整数值。h点位置像素的值为算式(A-5C+20G+20M-5R+T)/32的值取整数值。由上述算式得知,计算1/2点位置像素的值需4个乘法运算。以目前最为普遍的图像格式CIF格式(common intermediate format,简称CIF)而言,每一画面(frame)具有352*288个像素,计算CIF格式所有1/2点位置像素的值需(703*575-352*288(整数点))*4=1,211,396个乘法运算,约120万个乘法运算;计算所有1/8点位置像素的值约需5000万个乘法运算。其中1/4点位置像素的值可以利用加法器与位移器,因此不列于评估。此外,在CIF格式中,所有1/2点位置具有703*575-352*288(整数点)=302,846个像素,即表示储存所有1/2点位置像素的值约需296Kbytes的存储器空间;储存所有1/8点位置像素的值约需6Mbytes的存储器空间。由于补差点为利用外部存储器储存的整数点推演而来,若考虑外部存储器频宽为16位,则为了计算1/2、1/4及1/8点位置像素的值,各需抓取整个画面的整数点数据,也就是要抓取396*256*1.5/16=76032次。For example, as shown in Figure 1, in the H.264 video system specification, the value of its 1/2 point pixel (pixel) is a finite impulse response filter (finiteimpulse response) using six sets of coefficients (six-tap). , referred to as FIR) calculated. In Figure 1, the white squares (such as A, B, C, D, etc.) represent integer point positions, while the squares containing lines (such as aa, bb, h, m, etc.) represent 1/2 point positions that need to be supplemented by point calculations . The value of the pixel at point b is an integer value for the value of the formula (E-5F+20G+20H-5I+J)/32. The value of the pixel at point h is an integer value for the value of the formula (A-5C+20G+20M-5R+T)/32. It can be seen from the above formula that calculating the value of the pixel at the 1/2 point requires 4 multiplication operations. Taking the common intermediate format (CIF for short) as the most common image format at present, each frame (frame) has 352*288 pixels, and the value of all 1/2 dot pixels in the CIF format needs to be calculated (703*575 -352*288 (integer point))*4=1,211,396 multiplication operations, about 1.2 million multiplication operations; about 50 million multiplication operations are required to calculate the values of all 1/8 point position pixels. Among them, the value of the 1/4 point position pixel can use the adder and shifter, so it is not included in the evaluation. In addition, in the CIF format, all 1/2 dot positions have 703*575-352*288 (integer points)=302,846 pixels, which means that it takes about 296Kbytes of memory space to store the values of all 1/2 dot position pixels; The values of all 1/8 dot pixels require about 6Mbytes of memory space. Since the supplementary point is deduced from the integer points stored in the external memory, if the bandwidth of the external memory is 16 bits, in order to calculate the value of the 1/2, 1/4, and 1/8 point pixel, each needs to capture the entire The integer point data of the screen, that is, to capture 396*256*1.5/16=76032 times.

由上列叙述可知,在视频编码与解码系统中,计算补差点的运算量与所需储存补差点的存储器空间所费极大,而且需多次读取储存整数点的外部存储器。It can be seen from the above description that in the video encoding and decoding system, the amount of computation for calculating the supplementary points and the required memory space for storing the supplementary points are extremely costly, and the external memory for storing integer points needs to be read multiple times.

发明内容Contents of the invention

本发明提供一种补差点数据储存方法,利用暂存区(memory buffer)存在于高速缓存(cache)中,藉以储存计算过的补差点数据,可降低运算量与存储器存取次数。The present invention provides a method for storing supplementary point data. A temporary storage area (memory buffer) exists in a high-speed cache (cache) to store calculated supplementary point data, which can reduce the amount of computation and the number of memory accesses.

本发明还提供一种补差点数据储存方法,采用有效利用存储器空间的储存方式,藉以避免上述暂存区空间的浪费。The present invention also provides a storage method for supplementary point data, which adopts a storage method that effectively utilizes memory space, so as to avoid the above-mentioned waste of space in the temporary storage area.

本发明的一较佳实施例为利用动态向量差(motion vector difference)的大小分布比例来分析图像,藉以决定暂存区存在于高速缓存的空间大小.补差点为利用动态向量找到参考画面的宏区块(macroblock),藉以计算出补差点,而这些动态向量对应参考画面的宏区块,在一般彼此间关联性强的图像会有较多重迭之处,因此利用此一暂存区储存前些计算过的补差点,避免重复计算的运算量以及对外部存储器读取整数点位置像素的次数.A preferred embodiment of the present invention is to use the size distribution ratio of the motion vector difference to analyze the image, so as to determine the space size of the temporary storage area in the cache. The supplementary point is to use the motion vector to find the macro of the reference picture Block (macroblock), in order to calculate the supplementary points, and these motion vectors correspond to the macroblocks of the reference picture, and generally there will be more overlaps in images with strong correlation with each other, so use this temporary storage area to store the previous These calculated supplementary points avoid the amount of repeated calculations and the number of times to read the integer point position pixels from the external memory.

本发明另一较佳实施例为该暂存区存在于高速缓存中的储存方式。利用这些补差点对应于外部存储器内的逻辑坐标的小数点部分,将暂存区划分为多个区域,使用这些区域储存非整数点位置的补差点数据。如此不需要保留整数点位置也能在暂存区内迅速搜寻补差点数据,兼具节省高速缓存空间与提高效率的优点。Another preferred embodiment of the present invention is a storage method in which the temporary storage area exists in the cache. The temporary storage area is divided into a plurality of areas by using these supplementary points corresponding to the decimal point of the logical coordinates in the external memory, and these areas are used to store the supplementary point data of non-integer point positions. In this way, the supplementary point data can be quickly searched in the temporary storage area without retaining the integer point position, which has the advantages of saving cache space and improving efficiency.

本发明还提供一种补差点数据储存方法,包括:判断暂存区内是否储存非整数点的补差点数据;若该暂存区已储存该补差点数据,则提供该补差点数据;以及若该暂存区未储存该补差点数据,则自存储器读取邻近该非整数点的整数点数据,据以计算该补差点数据,然后将该补差点数据存入该暂存区。The present invention also provides a method for storing supplementary point data, including: judging whether non-integer point supplementary point data is stored in the temporary storage area; if the temporary storage area has stored the supplementary point data, providing the supplementary point data; and if The supplementary point data is not stored in the temporary storage area, and the integer point data adjacent to the non-integer point is read from the memory to calculate the supplementary point data, and then the supplementary point data is stored in the temporary storage area.

本发明还提供一种补差点数据储存方法,包括:将暂存区划分为多个区域;以及使用该些区域储存多个非整数点的补差点数据;其中,每一上述非整数点的每一逻辑坐标的小数部分与同一区域的另一上述非整数点的对应逻辑坐标的小数部分皆相同。The present invention also provides a method for storing supplementary point data, including: dividing the temporary storage area into a plurality of areas; and using these areas to store the supplementary point data of multiple non-integer points; The fractional part of a logical coordinate is the same as that of the corresponding logical coordinate of another non-integer point in the same area.

本发明还提供一种补差点数据储存方法,包括:将暂存区划分为多个区域;使用该些区域储存多个非整数点的补差点数据,其中,每一上述非整数点的每一逻辑坐标的小数部分与同一区域的另一上述非整数点的对应逻辑坐标的小数部分皆相同;若特定非整数点的补差点数据已储存于该暂存区,则直接提供该补差点数据;以及若该暂存区未储存该特定非整数点的补差点数据,则自存储器读取邻近该特定非整数点的整数点数据,据以计算该补差点数据,然后将该补差点数据存入该暂存区。The present invention also provides a method for storing supplementary point data, including: dividing the temporary storage area into multiple areas; using these areas to store multiple non-integer point supplementary point data, wherein each of the above-mentioned non-integer points The decimal part of the logical coordinates is the same as that of the corresponding logical coordinates of another non-integer point in the same area; if the supplementary point data of a specific non-integer point has been stored in the temporary storage area, the supplementary point data will be provided directly; And if the temporary storage area does not store the supplementary point data of the specific non-integer point, read the integer point data adjacent to the specific non-integer point from the memory, calculate the supplementary point data, and then store the supplementary point data into the staging area.

为让本发明的上述和其它目的、特征和优点能更明显易懂,下文特举本发明的较佳实施例,并配合所附图式,作详细说明如下。In order to make the above and other objects, features and advantages of the present invention more comprehensible, preferred embodiments of the present invention will be described in detail below together with the accompanying drawings.

附图说明Description of drawings

图1为一般视频编码与解码系统的补差点运算示意图。FIG. 1 is a schematic diagram of a supplementary point calculation in a general video encoding and decoding system.

图2为本发明一实施例的补差点数据暂存区示意图。FIG. 2 is a schematic diagram of a temporary storage area for supplementary point data according to an embodiment of the present invention.

图3及图4为本发明一实施例的存储地址旋转示意图。3 and 4 are schematic diagrams of storage address rotation according to an embodiment of the present invention.

图5为本发明一实施例的分区域储存方法示意图。FIG. 5 is a schematic diagram of a partitioned storage method according to an embodiment of the present invention.

[主要元件标号说明][Description of main component labels]

200:高速缓存的暂存区200: Staging area for cache

201、202:宏方块201, 202: Macro block

203:宏方块的重迭部分203: The overlapping part of the macro block

310、320:补差点数据暂存区在参考画面的对应边界310, 320: The temporary storage area of supplementary point data is at the corresponding boundary of the reference picture

315、325:参考画面的非整数点宏区块315, 325: non-integer point macroblocks of the reference picture

500:补差点数据暂存区500: Temporary storage area for make-up point data

501、502、503:暂存区内的储存区域501, 502, 503: storage areas in the temporary storage area

511、521、531:暂存区内的非整数点数据511, 521, 531: Non-integer point data in the temporary storage area

MV1、MV2:动态向量MV1, MV2: dynamic vector

具体实施方式Detailed ways

以下较佳实施例的说明以视频编码器或视频解码器为例。本实施例的视频编码器或视频解码器使用外部存储器储存参考画面(reference frame)整数点位置像素的数据,并使用内建的高速缓存做为暂存区,储存之前计算过的非整数点位置像素的值。The following description of the preferred embodiments takes a video encoder or a video decoder as an example. The video encoder or video decoder of this embodiment uses an external memory to store the data of the pixels at the integer point positions of the reference frame, and uses the built-in high-speed cache as a temporary storage area to store the previously calculated non-integer point positions The value of the pixel.

若欲降低系统运算量与外部存储器存取频率,可以利用容量较大的高速缓存储存计算过的补差点数据,但是太大的高速缓存会造成电路面积与价格上的问题。因此本实施例使用相对较小的暂存区,例如32*32像素,加上存储地址旋转的观念(细节后述),就可以有效降低系统运算量与外部存储器存取频率,同时也不需要太大的高速缓存。在本实施例中,每当需要一个非整数点的补差点数据,会先判断暂存区内是否储存这个非整数点的补差点数据,若有储存就直接取出使用,不用重复计算。反之,若暂存区没储存这个补差点数据,就从外部存储器读取邻近上述非整数点的整数点数据,据以计算所需的补差点数据,然后将计算得出的补差点数据存入暂存区,以后就能重复使用。If you want to reduce the amount of system computation and the access frequency of external memory, you can use a large-capacity cache to store the calculated supplementary point data, but too large a cache will cause problems in terms of circuit area and price. Therefore, this embodiment uses a relatively small temporary storage area, such as 32*32 pixels, and adds the concept of storage address rotation (details will be described later), which can effectively reduce the amount of system computation and the frequency of external memory access, and also does not require Cache too large. In this embodiment, whenever a non-integer point supplementary point data is required, it is first judged whether the non-integer point supplementary point data is stored in the temporary storage area, and if it is stored, it is directly taken out and used without repeated calculation. On the contrary, if the temporary storage area does not store the supplementary point data, read the integer point data adjacent to the non-integer point from the external memory, calculate the required supplementary point data, and then store the calculated supplementary point data into Temporary storage area, which can be reused later.

图2绘示上述方法的一个范例。请参照图2,200是用来储存补差点数据的暂存区。假设目前画面的某一宏区块根据动态向量MV1对应到参考画面的非整数点宏区块201,而且根据动态向量MV2对应到参考画面的非整数点宏区块202。计算宏区块201的补差点数据时,已将这些补差点数据存入暂存区200。当需要宏区块202的补差点数据时,两宏区块重迭部分203的补差点数据可由暂存区200直接提供,不用重复计算。就宏区块202而言,原本需要31*31*4=3844个乘法运算,扣掉重迭部分203之后只需31*4-16*2=368个乘法运算,节省了约90.4%的计算量。FIG. 2 illustrates an example of the above method. Please refer to FIG. 2 , 200 is a temporary storage area for storing the supplementary point data. Assume that a certain macroblock of the current picture corresponds to the non-integer point macroblock 201 of the reference picture according to the motion vector MV1, and corresponds to the non-integer point macroblock 202 of the reference picture according to the motion vector MV2. When the supplementary point data of the macroblock 201 is calculated, the supplementary point data has been stored in the temporary storage area 200 . When the supplementary point data of the macroblock 202 is needed, the supplementary point data of the overlapping part 203 of the two macroblocks can be directly provided by the temporary storage area 200 without repeated calculation. As far as the macro block 202 is concerned, 31*31*4=3844 multiplication operations are originally required, but only 31*4-16*2=368 multiplication operations are required after deducting the overlapping part 203, saving about 90.4% of calculations quantity.

本实施例的暂存区大小不限定32*32像素。实际上,本实施例是先统计至少一个视频数据流(video bitstream)的动态向量差(MVD:motion vectordifference)的大小分布,然后根据上述大小分布决定暂存区的大小。所谓动态向量差的大小,在此定义为动态向量差的各坐标分量的最大值。例如某个动态向量差为(a,b),若a大于b,则此动态向量差的大小为a,否则为b。The size of the temporary storage area in this embodiment is not limited to 32*32 pixels. In fact, in this embodiment, the size distribution of the motion vector difference (MVD: motion vector difference) of at least one video bitstream is counted first, and then the size of the temporary storage area is determined according to the above size distribution. The magnitude of the so-called dynamic vector difference is defined here as the maximum value of each coordinate component of the dynamic vector difference. For example, a dynamic vector difference is (a, b), if a is greater than b, then the magnitude of the dynamic vector difference is a, otherwise it is b.

本实施例分析三个视频数据流,其名称为News、Silent及Football,分别可以代表低频、中频及高频的视频图像。视频数据流News主要为播报新闻,其图像移动变化小;视频数据流Silent主要为手语动作,其图像移动集中在部分区域,移动变化较News高;视频数据流Football为美式足球运动场景,运动员与球移动变化大。以上三个视频数据流皆为CIF规格,分析结果如下列的表1所示。In this embodiment, three video data streams are analyzed, which are named News, Silent and Football, which can respectively represent low-frequency, medium-frequency and high-frequency video images. The video data stream News is mainly for broadcasting news, and its image movement changes little; the video data stream Silent is mainly for sign language movements, and its image movement is concentrated in some areas, and the movement change is higher than that of News; the video data stream Football is an American football scene, where athletes and Ball movement varies greatly. The above three video data streams are all CIF specifications, and the analysis results are shown in Table 1 below.

MVD<8像素MVD<8 pixels 8<MVD<16像素8<MVD<16 pixels 16<MVD<32像素16<MVD<32 pixels MVD>32像素MVD > 32 pixels   NewsNews   67%67%   32.9%32.9%   0.1%0.1%   0%0%   SilentSilent   22% twenty two%   57%57%   19%19%   2% 2%   FootballFootball   11%11%   36%36%   45%45%   8% 8%

表1各种视频数据流的动态向量差分析统计表Table 1 Statistical table of dynamic vector difference analysis of various video data streams

表1当中,绝大部分的动态向量差皆小于32像素,所以本实施例的暂存区大小设定为32*32像素.若集中处理高频视频,可使用64*64像素的暂存区;若集中处理低频视频,则16*16像素的暂存区就已经足够.总之暂存区大小可视动态向量差的大小分布比例做调整,例如设定暂存区的最小边长必须大于所有视频数据流的所有动态向量差当中,一个预设比例的动态向量差.In Table 1, most of the motion vector differences are less than 32 pixels, so the size of the temporary storage area in this embodiment is set to 32*32 pixels. If the high-frequency video is processed intensively, a temporary storage area of 64*64 pixels can be used ; If low-frequency video is processed intensively, a temporary storage area of 16*16 pixels is enough. In short, the size of the temporary storage area can be adjusted according to the distribution ratio of the dynamic vector difference. For example, the minimum side length of the temporary storage area must be greater than all Among all the motion vector differences of the video data stream, a preset proportion of the motion vector differences.

本实施例的暂存区是二维阵列,会对应到参考画面中一个同等大小的区域,因为暂存区大小有限,难免会有非整数点的宏区块超出暂存区边界。请参照图3。假设暂存区原本在参考画面中的对应边界为310,其左上角在参考画面的逻辑坐标为(2.5,3.5),右下角在参考画面的逻辑坐标为(34.5,35.5),以左上角为起点。边界310可容纳宏区块315,其左上角在参考画面的逻辑坐标为(18.5,19.5),右下角在参考画面的逻辑坐标为(34.5,35.5)。宏区块315的非整数点逻辑坐标都是根据目前画面的某一宏区块与其动态向量计算得出。The temporary storage area in this embodiment is a two-dimensional array, which corresponds to an area of the same size in the reference frame. Since the temporary storage area is limited in size, it is inevitable that there will be macroblocks with non-integer points beyond the boundary of the temporary storage area. Please refer to Figure 3. Assume that the original boundary of the temporary storage area in the reference picture is 310, the logical coordinates of the upper left corner in the reference picture are (2.5, 3.5), the logical coordinates of the lower right corner in the reference picture are (34.5, 35.5), and the upper left corner is starting point. The boundary 310 can accommodate a macroblock 315 whose upper left corner has logical coordinates (18.5, 19.5) in the reference frame and its lower right corner has logical coordinates (34.5, 35.5) in the reference frame. The non-integer logical coordinates of the macroblock 315 are calculated based on a certain macroblock and its motion vector in the current frame.

图3当中,另一宏区块325的左上角逻辑坐标为(20.5,21.5),右下角逻辑坐标为(36.5,37.5)。对目前的边界310而言,若要储存宏区块325的补差点数据,就有部分非整数点会超出范围。在本实施例中,若有非整数点超出暂存区边界,就调整暂存区的起点的逻辑坐标,使这个非整数点落入暂存区的新边界。在图3的范例,为了容纳宏区块325的补差点数据,会将暂存区的起点逻辑坐标从(2.5,3.5)移动至(4.5,5.5),也就是将暂存区边界从310移动至320。In FIG. 3 , the logical coordinates of the upper left corner of another macroblock 325 are (20.5, 21.5), and the logical coordinates of the lower right corner are (36.5, 37.5). For the current boundary 310, if the supplementary point data of the macroblock 325 is to be stored, some non-integer points will exceed the range. In this embodiment, if a non-integer point exceeds the boundary of the temporary storage area, the logical coordinates of the starting point of the temporary storage area are adjusted so that the non-integer point falls into the new boundary of the temporary storage area. In the example of FIG. 3, in order to accommodate the supplementary point data of the macroblock 325, the logical coordinates of the starting point of the temporary storage area will be moved from (2.5, 3.5) to (4.5, 5.5), that is, the boundary of the temporary storage area will be moved from 310 to 320.

补差点数据在暂存区内的存取是根据其真实坐标,暂存区内的真实坐标不同于参考画面的逻辑坐标。每当暂存区的起点移动时,起点的逻辑坐标与真实坐标会同步移动,如此已储存在暂存区内的补差点数据就不必因为起点移动而跟随挪移。非整数点的真实坐标计算方法是,对上述非整数点的每一个逻辑坐标,计算此逻辑坐标减去起点的对应逻辑坐标加上起点的对应真实坐标的结果,以上述结果作为此非整数点的此逻辑坐标的对应真实坐标。上述的每一个逻辑坐标是指对应每一个坐标轴的不同子坐标,而上述不同子坐标之间的对应关系是指对应同一坐标轴。例如图3的范例中,暂存区边界310的起点逻辑坐标为(2.5,3.5),起点真实坐标为[0][0]。宏区块315左上角的x逻辑坐标为18.5,将其减去起点的x逻辑坐标2.5再加上起点的x真实坐标0,结果为16,此即为宏区块315左上角的x真实坐标。同理,宏区块315左上角的y逻辑坐标为19.5,将其减去起点的y逻辑坐标3.5再加上起点的y真实坐标0,结果为16,此即为宏区块315左上角的y真实坐标。当暂存区边界从310移动至320之后,新的起点逻辑坐标为(4.5,5.5),新的起点真实坐标为[2][2]。将宏区块315左上角的逻辑坐标(18.5,19.5)减去起点逻辑坐标(4.5,5.5)再加上起点真实坐标[2][2],结果是同样的真实坐标[16][16]。从上述结果可知,由于起点的逻辑坐标与真实坐标同步移动,同一非整数点在边界移动前后的真实坐标相同,因此其补差点数据不必跟随起点移动而在暂存区内挪移。The access of supplementary point data in the temporary storage area is based on its real coordinates, and the real coordinates in the temporary storage area are different from the logical coordinates of the reference picture. Whenever the starting point of the temporary storage area moves, the logical coordinates of the starting point and the real coordinates will move synchronously, so that the supplementary point data stored in the temporary storage area does not have to follow the movement of the starting point. The method of calculating the real coordinates of a non-integer point is, for each logical coordinate of the above-mentioned non-integer point, calculate the result of subtracting the corresponding logical coordinate of the starting point from the logical coordinate plus the corresponding real coordinate of the starting point, and use the above result as the non-integer point The corresponding real coordinates of this logical coordinates of . Each of the above-mentioned logical coordinates refers to a different sub-coordinate corresponding to each coordinate axis, and the correspondence between the above-mentioned different sub-coordinates refers to corresponding to the same coordinate axis. For example, in the example of FIG. 3 , the logical coordinates of the starting point of the temporary storage area boundary 310 are (2.5, 3.5), and the real coordinates of the starting point are [0][0]. The x logical coordinate of the upper left corner of the macro block 315 is 18.5, subtract the x logical coordinate 2.5 of the starting point and add the x real coordinate 0 of the starting point, and the result is 16, which is the x real coordinate of the upper left corner of the macro block 315 . In the same way, the y logical coordinate of the upper left corner of the macro block 315 is 19.5, which is subtracted from the y logical coordinate 3.5 of the starting point and added to the y real coordinate 0 of the starting point, and the result is 16, which is the y coordinate of the upper left corner of the macro block 315. y real coordinate. When the boundary of the temporary storage area moves from 310 to 320, the logical coordinates of the new starting point are (4.5, 5.5), and the real coordinates of the new starting point are [2][2]. The logical coordinates (18.5, 19.5) of the upper left corner of the macroblock 315 are subtracted from the logical coordinates (4.5, 5.5) of the starting point and the real coordinates [2][2] of the starting point are added, and the result is the same real coordinates [16][16] . From the above results, it can be known that since the logical coordinates of the starting point and the real coordinates move synchronously, the real coordinates of the same non-integer point before and after the boundary movement are the same, so the data of the supplementary point does not need to follow the movement of the starting point and move in the temporary storage area.

移动起点位置之后,非整数点的真实坐标仍有可能超出暂存区界限,例如图3当中,宏区块325右下角的真实坐标为[34][34],超出最大可容许坐标[31][31].此时本实施例的对策为存储地址旋转,如图4所示,将真实坐标超出暂存区右侧的非整数点储存在暂存区左侧,将真实坐标超出暂存区下端的非整数点储存在暂存区上端,反之亦然.更精确地说,就是若有非整数点的对应某一坐标轴的真实坐标小于暂存区对应同一坐标轴的坐标下限,则将此真实坐标加上暂存区对应同一坐标轴的边长.反之,若有非整数点的对应某一坐标轴的真实坐标大于暂存区对应同一坐标轴的坐标上限,则将此真实坐标减去暂存区对应同一坐标轴的边长.例如宏区块325右上角的逻辑坐标为(36.5,21.5),真实坐标为[34][18],其x真实坐标超出暂存区的x轴上限31,必须减去暂存区的x轴边长32,然后根据调整后的真实坐标[2][18]在暂存区内作存取.同理,宏区块325左下角的逻辑坐标为(20.5,37.5),真实坐标为[18][34],其y真实坐标超出暂存区的y轴上限31,必须减去暂存区的y轴边长32,然后根据调整后的真实坐标[18][2]在暂存区内作存取.After moving the starting point, the real coordinates of the non-integer points may still exceed the boundary of the temporary storage area. For example, in Figure 3, the real coordinates of the lower right corner of the macro block 325 are [34][34], exceeding the maximum allowable coordinates [31] [31]. At this time, the countermeasure of this embodiment is to store address rotation, as shown in Figure 4, store the non-integer points whose real coordinates exceed the right side of the temporary storage area on the left side of the temporary storage area, and store the real coordinates beyond the temporary storage area The non-integer points at the lower end are stored at the upper end of the temporary storage area, and vice versa. More precisely, if the real coordinates of a non-integer point corresponding to a certain coordinate axis are smaller than the lower limit of the coordinates of the same coordinate axis in the temporary storage area, then the This real coordinate plus the side length of the temporary storage area corresponding to the same coordinate axis. Conversely, if the real coordinate of a non-integer point corresponding to a certain coordinate axis is greater than the upper limit of the coordinates of the temporary storage area corresponding to the same coordinate axis, the real coordinate is subtracted Remove the side length corresponding to the same coordinate axis in the temporary storage area. For example, the logical coordinates of the upper right corner of the macro block 325 are (36.5, 21.5), the real coordinates are [34][18], and its x real coordinate exceeds the x-axis of the temporary storage area The upper limit is 31, the x-axis side length of the temporary storage area must be subtracted by 32, and then access is made in the temporary storage area according to the adjusted real coordinates [2][18]. Similarly, the logical coordinates of the lower left corner of the macroblock 325 is (20.5, 37.5), the real coordinates are [18][34], and its y real coordinates exceed the upper limit of the y-axis of the temporary storage area by 31, and the side length of the y-axis of the temporary storage area must be subtracted by 32, and then according to the adjusted real The coordinates [18][2] are accessed in the temporary storage area.

以下请参照图5,在图5的暂存区500当中,除了非整数点(以x标示)以外,也保留了整数点的储存位置(以o标示)。这是为了便于在暂存区500之内搜寻非整数点的补差点数据,然而这样会浪费存储空间。反之,若为了节省高速缓存而不保留整数点位置,则需要较复杂的寻址运算以决定非整数点的储存位置。为了兼顾存储空间与运算效率,本实施例采用如图5所示的方法,将暂存区划分为多个区域,然后将非整数点的补差点数据分散储存在上述区域。区域501储存x坐标为1/2,y坐标为整数点的非整数点数据,例如511。区域502储存y坐标为1/2,x坐标为整数点的非整数点数据,例如521。区域503储存x、y坐标皆为1/2的非整数点数据,例如531。如此每个区域中的非整数点都呈规律排列,不仅容易寻址,也能避免整数点空间的存储浪费。Please refer to FIG. 5 below. In the temporary storage area 500 in FIG. 5 , in addition to the non-integer points (marked by x), the storage locations of integer points (marked by o) are also reserved. This is for the convenience of searching for non-integer point supplementary point data in the temporary storage area 500 , but this will waste storage space. On the contrary, if the location of the integer point is not reserved in order to save the cache, more complex addressing operations are required to determine the storage location of the non-integer point. In order to take into account both storage space and computing efficiency, this embodiment adopts the method shown in FIG. 5 to divide the temporary storage area into multiple areas, and then disperse and store the supplementary point data of non-integer points in the above areas. Area 501 stores non-integer point data whose x coordinate is 1/2 and y coordinate is an integer point, such as 511 . Area 502 stores non-integer point data, such as 521 , whose y-coordinate is 1/2 and x-coordinate is an integer point. Area 503 stores non-integer point data whose x and y coordinates are both 1/2, such as 531 . In this way, the non-integer points in each area are arranged regularly, which is not only easy to address, but also can avoid the storage waste of integer point space.

图5的分区储存方法是以1/2点为例,其实上述的分区储存方法也适用于其它种非整数点,例如1/4点或1/8点。1/4点的暂存区应分为42-1=15个区域,1/8点的暂存区应分为82-1=63个区域,依此类推。一般原则是每一个区域中,每一个非整数点对应每一个坐标轴的逻辑坐标的小数部分,与同一区域的另一个非整数点的对应同一坐标轴的逻辑坐标的小数部分皆相同。例如图5的区域502中,每一个非整数点的x逻辑坐标小数部分皆为0,而且每一个非整数点的y逻辑坐标小数部分皆为0.5。此外,每一个区域的非整数点的逻辑坐标小数部分所构成的集合各不相同。例如图5的范例中,区域501的非整数点的逻辑坐标小数部分的集合为{0.5,0},区域502为{0,0.5},区域503为{0.5,0.5},三个区域的集合各不相同。The partition storage method in FIG. 5 is an example of 1/2 points. In fact, the above partition storage method is also applicable to other types of non-integer points, such as 1/4 points or 1/8 points. The temporary storage area of 1/4 point should be divided into 4 2 -1=15 areas, the temporary storage area of 1/8 point should be divided into 8 2 -1=63 areas, and so on. The general principle is that in each region, each non-integer point corresponds to the fractional part of the logical coordinates of each coordinate axis, which is the same as the fractional part of the logical coordinates corresponding to the same coordinate axis of another non-integer point in the same region. For example, in the region 502 in FIG. 5 , the fractional part of the x logical coordinate of each non-integer point is 0, and the fractional part of the y logical coordinate of each non-integer point is 0.5. In addition, the sets formed by the fractional parts of logical coordinates of non-integer points in each area are different. For example, in the example of Figure 5, the set of fractional parts of logical coordinates of non-integer points in area 501 is {0.5, 0}, the set of three areas is {0, 0.5} in area 502, and {0.5, 0.5} in area 503 vary.

以下说明本实施例的实验结果。本实施例的实验环境为H.264解码端,分别测试CIF格式的视频数据流News、Silent以及Football,比较国际标准组织(ISO:International Standards Organization)的参考码JM8.2以及本实施例的方法,评估计算1/2点位置像素的值所需的乘法计算量(乘法运算次数)与每一画面的存储器存取量。实验结果如以下的表2、表3及表4所示。从下列表格可看出,本实施例和已知的JM8.2相比,确实可降低乘法计算量与存储器存取频率。The experimental results of this example will be described below. The experimental environment of the present embodiment is the H.264 decoder, respectively testing the video data stream News, Silent and Football of the CIF format, comparing the reference code JM8.2 of the International Standards Organization (ISO: International Standards Organization) and the method of the present embodiment , evaluate the amount of multiplication calculations (number of multiplication operations) required to calculate the value of the pixel at the 1/2 dot position and the amount of memory access per frame. The experimental results are shown in Table 2, Table 3 and Table 4 below. It can be seen from the following table that compared with the known JM8.2, this embodiment can indeed reduce the amount of multiplication calculation and memory access frequency.

  NewsNews   JM8.2JM8.2   本实施例This embodiment   增进率growth rate   乘法计算量Amount of multiplication   35.7万/画面357,000/picture   11.3万/画面113,000/picture   68%68%   存储器存取量memory access   148.5K字节/画面148.5K bytes/picture   49.5K字节/画面49.5K bytes/picture   66.7%66.7%

表2CIF视频数据流News的实验结果Table 2 Experimental results of CIF video data stream News

  SilentSilent   JM8.2JM8.2   本实施例This embodiment   增进率growth rate   乘法计算量Amount of multiplication   20.6万/画面206,000/picture   8.6万/画面86,000/picture   58.5%58.5%   存储器存取量memory access   148.5K字节/画面148.5K bytes/picture   65.4K字节/画面65.4K bytes/picture   56%56%

表3CIF视频数据流Silent的实验结果Table 3 Experimental results of CIF video data stream Silent

  FootballFootball   JM8.2JM8.2   本实施例This embodiment   增进率growth rate   乘法计算量Amount of multiplication   8.7万/画面87,000/picture   6.7万/画面67,000/picture   23% twenty three%   存储器存取量memory access   148.5K字节/画面148.5K bytes/picture   117.4K字节/画面117.4K bytes/picture   21% twenty one%

表4CIF视频数据流Football的实验结果Table 4 Experimental results of CIF video data stream Football

综上所述,本实施例采用相对较小的暂存区以储存先前计算的补差点数据,可降低补差点的运算量,降低自外部存储器读取整数点数据的频率,而且不需要太大的高速缓存。本实施例也采用分区域储存非整数点数据的方式,以维持简易的寻址运算,并且避免浪费暂存区空间。本发明的应用不限于视频编码与解码,任何需要重复计算补差点的运算系统皆可应用。计算补差点所需的整数点数据不限于取自参考画面,也可以取自二维以上的任意数据阵列。相对于上述的运算系统,整数点数据除了储存在外部存储器,也可以储存在内建的一般存储器。To sum up, this embodiment uses a relatively small temporary storage area to store the previously calculated supplementary point data, which can reduce the calculation amount of the supplementary point and reduce the frequency of reading integer point data from the external memory, and it does not need to be too large. cache. This embodiment also adopts the method of storing non-integer point data in sub-areas to maintain simple addressing operations and avoid wasting space in the temporary storage area. The application of the present invention is not limited to video encoding and decoding, and any computing system that needs to repeatedly calculate the difference point can be applied. The integer point data required for calculating the supplementary point is not limited to be obtained from the reference picture, but may also be obtained from any data array with more than two dimensions. Compared with the above-mentioned computing system, the integer point data can be stored in the built-in general memory besides the external memory.

虽然本发明已以较佳实施例揭露如上,然其并非用以限定本发明,任何本领域技术人员,在不脱离本发明的精神和范围内,当可作些许的更动与润饰,因此本发明的保护范围当视所附的权利要求范围所界定者为准。Although the present invention has been disclosed above with preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, this The scope of protection of the invention should be defined by the appended claims.

Claims (10)

1.一种补差点数据储存方法,包括:1. A data storage method for making up shortfalls, comprising: 判断暂存区内是否储存非整数点的补差点数据;Judging whether the supplementary point data of non-integer points is stored in the temporary storage area; 若该暂存区已储存该补差点数据,则提供该补差点数据;以及Provide the make-up point data if the temporary storage area has already stored the make-up point data; and 若该暂存区未储存该补差点数据,则自存储器读取邻近该非整数点的整数点数据,据以计算该补差点数据,然后将该补差点数据存入该暂存区。If the supplementary point data is not stored in the temporary storage area, the integer point data adjacent to the non-integer point is read from the memory to calculate the supplementary point data, and then the supplementary point data is stored in the temporary storage area. 2.根据权利要求1所述的补差点数据储存方法,还包括:2. The data storage method for making up the difference according to claim 1, further comprising: 若该非整数点超出该暂存区的边界,则调整该暂存区的起点的逻辑坐标,使该非整数点落入该暂存区的边界。If the non-integer point exceeds the boundary of the temporary storage area, the logical coordinates of the starting point of the temporary storage area are adjusted so that the non-integer point falls within the boundary of the temporary storage area. 3.根据权利要求2所述的补差点数据储存方法,还包括:3. The data storage method for making up the difference according to claim 2, further comprising: 对该非整数点的每一逻辑坐标,计算该逻辑坐标减去该起点的对应逻辑坐标加上该起点的对应真实坐标的结果,以上述结果做为该非整数点的该逻辑坐标的对应真实坐标;For each logical coordinate of the non-integer point, calculate the result of the logical coordinate minus the corresponding logical coordinate of the starting point plus the corresponding real coordinate of the starting point, and use the above result as the corresponding real value of the logical coordinate of the non-integer point coordinate; 若该非整数点的该真实坐标小于该暂存区的对应下限,则将该真实坐标加上该暂存区的对应边长;If the real coordinate of the non-integer point is smaller than the corresponding lower limit of the temporary storage area, add the real coordinate to the corresponding side length of the temporary storage area; 若该非整数点的该真实坐标大于该暂存区的对应上限,则将该真实坐标减去该暂存区的对应边长;以及If the real coordinate of the non-integer point is greater than the corresponding upper limit of the temporary storage area, the real coordinate is subtracted from the corresponding side length of the temporary storage area; and 使用该非整数点的上述真实坐标存取该暂存区。The temporary storage area is accessed using the above real coordinates of the non-integer point. 4.根据权利要求1所述的补差点数据储存方法,其中该补差点数据储存方法由运算系统执行,该暂存区储存于该运算系统的高速缓存,储存该些整数点数据的该存储器为该运算系统的外部存储器。4. The method for storing supplementary point data according to claim 1, wherein the supplementary point data storage method is executed by a computing system, the temporary storage area is stored in the cache memory of the computing system, and the memory for storing these integer point data is The external memory of the operating system. 5.根据权利要求4所述的补差点数据储存方法,其中该运算系统为视频编码器或视频解码器。5. The method for storing supplementary point data according to claim 4, wherein the computing system is a video encoder or a video decoder. 6.根据权利要求5所述的补差点数据储存方法,还包括:6. The data storage method for making up the difference according to claim 5, further comprising: 统计至少一视频数据流的动态向量差的大小分布;以及Statistically calculate the magnitude distribution of the motion vector difference of at least one video data stream; and 根据上述大小分布决定该暂存区的大小。The size of the temporary storage area is determined according to the above size distribution. 7.根据权利要求6所述的补差点数据储存方法,其中每一该些动态向量差的大小为该动态向量差的各坐标分量的最大值。7. The data storage method of supplementary points according to claim 6, wherein the magnitude of each of the dynamic vector differences is the maximum value of each coordinate component of the dynamic vector differences. 8.根据权利要求7所述的补差点数据储存方法,此外该些动态向量差当中,有预设比例的动态向量差的大小小于该暂存区的最小边长。8 . The method for storing supplementary point data according to claim 7 , furthermore, among the dynamic vector differences, a preset proportion of the dynamic vector differences is smaller than the minimum side length of the temporary storage area. 9.根据权利要求5所述的补差点数据储存方法,其中该些整数点数据来自宏区块的参考画面。9. The method for storing complementary point data according to claim 5, wherein the integer point data comes from reference frames of macroblocks. 10.根据权利要求9所述的补差点数据储存方法,其中该非整数点的逻辑坐标是根据该宏区块的动态向量计算得出。10. The method for storing supplementary point data according to claim 9, wherein the logical coordinates of the non-integer point are calculated according to the motion vector of the macroblock.
CN 200610135945 2006-10-17 2006-10-17 Data storage method for difference compensation points Active CN101166272B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200610135945 CN101166272B (en) 2006-10-17 2006-10-17 Data storage method for difference compensation points

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200610135945 CN101166272B (en) 2006-10-17 2006-10-17 Data storage method for difference compensation points

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN 200910141065 Division CN101568032B (en) 2006-10-17 2006-10-17 Data storage method for making up shortfall points

Publications (2)

Publication Number Publication Date
CN101166272A CN101166272A (en) 2008-04-23
CN101166272B true CN101166272B (en) 2010-05-12

Family

ID=39334707

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200610135945 Active CN101166272B (en) 2006-10-17 2006-10-17 Data storage method for difference compensation points

Country Status (1)

Country Link
CN (1) CN101166272B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6570574B1 (en) * 2000-01-10 2003-05-27 Intel Corporation Variable pre-fetching of pixel data
US6757330B1 (en) * 2000-06-01 2004-06-29 Hewlett-Packard Development Company, L.P. Efficient implementation of half-pixel motion prediction
US20060050976A1 (en) * 2004-09-09 2006-03-09 Stephen Molloy Caching method and apparatus for video motion compensation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6570574B1 (en) * 2000-01-10 2003-05-27 Intel Corporation Variable pre-fetching of pixel data
US6757330B1 (en) * 2000-06-01 2004-06-29 Hewlett-Packard Development Company, L.P. Efficient implementation of half-pixel motion prediction
US20060050976A1 (en) * 2004-09-09 2006-03-09 Stephen Molloy Caching method and apparatus for video motion compensation

Also Published As

Publication number Publication date
CN101166272A (en) 2008-04-23

Similar Documents

Publication Publication Date Title
KR100907843B1 (en) Caching method and apparatus for video motion compensation
US9800889B2 (en) Video decoding device, video decoding method, video decoding program, and video decoding integrated circuit
CN108876700B (en) Method and circuit for improving VR display effect
CN101163244A (en) Picture element caching method and system in movement compensation process of video decoder
CN101783958B (en) Calculation method and device of temporal direct mode motion vector in AVS video standard
CN110278443A (en) The context modeling method and device of division symbolizing position
JP2008514160A (en) Apparatus and method for edge handling in image processing
CN104731519B (en) Cache memory management device and dynamic image system and method using the cache memory management device
CN101166272B (en) Data storage method for difference compensation points
WO2025001955A1 (en) Video coding method and apparatus, and electronic device and readable storage medium
JP2009015637A (en) Computational unit and image filtering apparatus
US20130127887A1 (en) Method for storing interpolation data
CN101568032A (en) Data storage method for difference compensation points
CN102300086A (en) Method for Extending Reference Frame Boundaries and Defining Motion Compensated Reference Sample Positions
US20080049035A1 (en) Apparatus and method for accessing image data
JP2009100041A (en) Image decoding device
Motten et al. Adaptive memory architecture for real-time image warping
CN115866157A (en) Method and apparatus for performing dirty region reads and writes to reduce memory bandwidth usage
JP2000287214A (en) Method and unit for motion detection
TWI513282B (en) Cache managing device and motion picture system and method utilizing the same
Woo et al. A cache-aware motion estimation organization for a hardware-based H. 264 encoder
US7864858B2 (en) Techniques for minimizing memory bandwidth used for motion compensation
KR100319741B1 (en) A parallel address control method between data memory banks
KR100672376B1 (en) Motion compensation method
JP2005157783A (en) Processor system with an accelerator that can be reserved for execution

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