CN1612111A - Data stream conversion method and buffer device - Google Patents
Data stream conversion method and buffer device Download PDFInfo
- Publication number
- CN1612111A CN1612111A CN 200310103402 CN200310103402A CN1612111A CN 1612111 A CN1612111 A CN 1612111A CN 200310103402 CN200310103402 CN 200310103402 CN 200310103402 A CN200310103402 A CN 200310103402A CN 1612111 A CN1612111 A CN 1612111A
- Authority
- CN
- China
- Prior art keywords
- mark position
- order
- block
- read
- writes
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000006243 chemical reaction Methods 0.000 title abstract description 7
- 238000007906 compression Methods 0.000 description 7
- 230000006835 compression Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 6
- 230000006837 decompression Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- TVEXGJYMHHTVKP-UHFFFAOYSA-N 6-oxabicyclo[3.2.1]oct-3-en-7-one Chemical compound C1C2C(=O)OC1C=CC2 TVEXGJYMHHTVKP-UHFFFAOYSA-N 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
Images
Landscapes
- Image Input (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种资料流转换方法,特别是涉及一种能将以线为主(line-based)的资料流转换为以像块为主(block-based)的资料流,以利于后续的压缩处理,或者将以像块为主的资料流转换为以线为主的资料流,以利后续解压缩处理的资料流转换方法。The present invention relates to a data stream conversion method, in particular to a method capable of converting a line-based data stream into a block-based data stream for subsequent compression processing, or converting the block-based data stream into a line-based data stream for subsequent decompression processing.
背景技术Background technique
JPEG与MPEG分别是静态影像压缩及动态影像压缩的国际标准,以MPEG为例,如图1所示,其资料结构皆是由一个或至少一个以上的序列(sequence)所构成,而在每个序列中则包含了复数个图像群组(picture of group,GOP)。JPEG and MPEG are international standards for static image compression and dynamic image compression respectively. Taking MPEG as an example, as shown in Figure 1, its data structure is composed of one or at least one sequence (sequence), and in each The sequence contains a plurality of picture groups (picture of group, GOP).
每个画面又可细分为数个像条(slice),像条中又可再分为数个巨集像块(MacroBlock,MB)。而巨集像块可由四个亮度(Luminance)像块及数个彩度(Chrominance)像块所组成,最后,每一像块(block)具有8×8位元组,并定义为MPEG的资料结构中一最小编码单位。Each picture can be subdivided into several slices, and the slice can be further divided into several macro blocks (MacroBlock, MB). The macro block can be composed of four Luminance blocks and several Chrominance blocks. Finally, each block has 8×8 bytes and is defined as MPEG data. A smallest coding unit in a structure.
参阅图2,将一原始的影像资料以MPEG-1或MPEG-2格式进行压缩时,是先进行资料流的转换,以便将输入的资料流转变为以像块为主的资料流输出,如步骤201。接着如步骤202,对每一像块的像素资料施以离散余弦转换(DCT),即把像素资料由时域转换为频域,并去除掉人眼较不敏感的高频部分。如步骤203,再施以量化(quantization),使得许多经过离散余弦转换的DCT系数量化为零。Referring to Fig. 2, when an original image data is compressed with MPEG-1 or MPEG-2 format, the conversion of the data stream is carried out first, so that the input data stream is converted into a block-based data stream output, such as Step 201. Next, in step 202, discrete cosine transform (DCT) is applied to the pixel data of each block, that is, the pixel data is converted from the time domain to the frequency domain, and the high-frequency part which is less sensitive to human eyes is removed. In step 203, quantization is performed again, so that many DCT coefficients after DCT are quantized to zero.
步骤204,接着再以交错扫描(zig-zag scan)来将量化后的DCT系数重新排列,将低频系数排列在前而高频系数排列在后。最后在经交错扫描过后的DCT系数中,将DC系数进行差动信号调变编码(DPCM),并对AC系数进行动态长度编码(RLE),最后再对二者进行可变长度编码(VLC),即完成MPEG-1/MPEG-2格式的压缩,如步骤205所示。JPEG的压缩过程亦类似于上述的作法,而当解压缩时,则是采取上述的相反作法。In step 204, the quantized DCT coefficients are rearranged by zig-zag scan, so that the low-frequency coefficients are arranged in front and the high-frequency coefficients are arranged in the rear. Finally, among the DCT coefficients after interleaved scanning, the DC coefficients are subjected to differential signal modulation coding (DPCM), and the AC coefficients are subjected to dynamic length encoding (RLE), and finally the two are subjected to variable length encoding (VLC). , that is to complete the compression of the MPEG-1/MPEG-2 format, as shown in step 205. The compression process of JPEG is also similar to the above-mentioned practice, and when decompressing, the above-mentioned opposite method is adopted.
参阅图3,由于JPEG与MPEG皆是以像块作为其基本的处理单位,因此在上述步骤201中,为了能将以线为主(line-based)的资料流转换为以像块为主(block-based)的资料流输出,一般是以一缓冲记忆体7与一缓冲控制器(buffer controller)8来进行。Referring to Fig. 3, since both JPEG and MPEG take the image block as its basic processing unit, in the above step 201, in order to convert the line-based data stream into an image block-based ( The block-based data stream output is generally performed by a
当资料流受控制器8的控制而写入缓冲记忆体7时,会循序由左至右、由上至下逐条地写入缓冲记忆体7中,但是在取出资料时,由于必需以像块为基本单位,所以控制器8会以纵向取出资料(例如由左上角依次由上而下取出8次8个位元组输出,其输出资料流的内容即为第一个像块),由于此一特性,所以在缓冲记忆体7中的资料未完全填满前,无法取出资料,而若未将资料取出,则又无法写入资料。When the data stream is written into the
因此,一般会将缓冲记忆体7划分为两个部分,一个部分用作资料输入、另一个部分则用作资料输出。如图3所示,当上半部71资料填满后也就是以像块为单位进行资料输出,而下半部72则同时进行资料写入的动作。待上半部71资料输出完毕后又有空间可以进行资料写入的动作,此时下半部72因资料写入完毕,所以又可进行资料读取的动作。然而,虽然此法能增加资料的输入与输出速度,但是却需要大量的缓冲记忆体7空间才能进行。Therefore, the
发明内容Contents of the invention
本发明的目的在于提供一种可达到只需少量的缓冲记忆体空间,即可快速地进行资料流转换的方法及使用该方法的缓冲装置。The purpose of the present invention is to provide a method and a buffer device using the method that can quickly convert data streams with only a small amount of buffer memory space.
本发明的特征在于:本发明缓冲装置包括一缓冲记忆体、一标记记忆体,以及一缓冲控制器。The feature of the present invention is that the buffer device of the present invention includes a buffer memory, a tag memory, and a buffer controller.
该缓冲记忆体具有复数大小相等并供该输入资料流写入的区块,该等区块并依一写入次序被标记出复数写入标记位置。该标记记忆体是用来储存各该区块所对应的实体标记位置。该控制器是用以依据该写入次序及该等写入标记位置,计算出欲进行读取该等区块的一读取次序及一读取标记位置,以进一步由各该区块的实体标记位置读取出各该区块资料成为该输出资料流。The buffer memory has a plurality of blocks of the same size for the input data stream to write into, and the blocks are marked with a plurality of writing mark positions according to a write order. The tag memory is used to store the physical tag positions corresponding to each block. The controller is used to calculate a read order and a read mark position of the blocks to be read according to the write order and the write mark positions, so as to further determine the entity of each block The marked position reads out the data of each block to become the output data stream.
在一第一较佳实施例中,本发明依据上述架构,提供了一种资料流转换方法,是能将一以线为主的输入资料流转换为一以像块为主的输出资料流,该方法包括步骤:A)将一缓冲记忆体依序标记出对应于复数个大小相同的区块的写入标记位置。步骤B)依据各该写入标记位置,循序写入资料至各该区块中。步骤C)依据各该写入标记位置及相对应的写入次序,计算出欲读取区块的读取标记位置及相对应的输出次序。步骤D)依据该输出次序,依序自对应于各该标记位置的区块读取资料,以输出该输出资料流。In a first preferred embodiment, the present invention provides a data stream conversion method based on the above structure, which is capable of converting an input data stream mainly based on lines into an output data stream mainly based on blocks, The method includes the steps of: A) sequentially marking a buffer memory with write-in mark positions corresponding to a plurality of blocks with the same size. Step B) Write data into each block sequentially according to the position of each write mark. Step C) Calculate the read mark position and the corresponding output order of the block to be read according to the write mark position and the corresponding write order. Step D) According to the output order, sequentially read data from the blocks corresponding to the positions of the marks, so as to output the output data stream.
其中,于该步骤C)中,是依据下列关系式:Wherein, in the step C), it is based on the following relational expression:
On(t)=In((t%h)×w+t/h) On (t)=I n ((t%h)×w+t/h)
计算出该读取标记位置,O(t)是该读取次序为t时的读取标记位置,该I(t)是该写入次序为t时的写入标记位置,h是该像块的高度,w是该缓冲记忆体总宽度所具有的该等区块数目,「t%h」是t除以h后所得到的余数,「t/h」是t除以h后所得到的商。Calculate the read mark position, O(t) is the read mark position when the read order is t, the I(t) is the write mark position when the write order is t, and h is the image block height, w is the number of blocks in the total width of the buffer memory, "t%h" is the remainder obtained after dividing t by h, and "t/h" is obtained after dividing t by h business.
在一第二较佳实施例中,本发明也提供了一种能将一以像块为主的输入资料流转换为一以线为主的输出资料流,与该第一较佳实施例不同的是,于前述步骤C)中,是依据下列关系式:In a second preferred embodiment, the present invention also provides a method capable of converting a block-based input data stream into a line-based output data stream, unlike the first preferred embodiment What is, in aforesaid step C) in, be based on following relational expression:
On(t)=In((t%w)×h+t/w)O n (t) = I n ((t%w) × h+t/w)
计算出该读取标记位置,O(t)是该读取次序为t时的读取标记位置,该I(t)是该写入次序为t时的写入标记位置,h是该像块的高度,w是该缓冲记忆体总宽度所具有的该等区块数目,「t%w」是t除以w后所得的余数,「t/w」是t除以w后所得的商。Calculate the read mark position, O(t) is the read mark position when the read order is t, the I(t) is the write mark position when the write order is t, and h is the image block height, w is the number of blocks in the total width of the buffer memory, "t%w" is the remainder obtained after dividing t by w, and "t/w" is the quotient obtained after dividing t by w.
本发明的功效在于采取上述方法后,其相较于以往,只需增设一小容量的标记记忆体来储存各标记位置,即能以少量的缓冲记忆体空间,完成资料流的转换动作The effect of the present invention is that after adopting the above method, compared with the past, it only needs to add a small-capacity tag memory to store each tag position, and can complete the conversion action of the data stream with a small amount of buffer memory space
下面结合附图及实施例对本发明进行详细说明。The present invention will be described in detail below in conjunction with the accompanying drawings and embodiments.
附图说明Description of drawings
图1是一示意图,说明MPEG的资料结构。FIG. 1 is a schematic diagram illustrating the data structure of MPEG.
图2是一示意图,说明一般MPEG的压缩步骤。Fig. 2 is a schematic diagram illustrating the general MPEG compression steps.
图3是一示意图,说明以往一缓冲记忆体与一缓冲控制器。FIG. 3 is a schematic diagram illustrating a conventional buffer memory and a buffer controller.
图4是一示意图,说明本发明缓冲装置的一较佳实施例。Fig. 4 is a schematic diagram illustrating a preferred embodiment of the cushioning device of the present invention.
图5~图10是动作示意图,说明本发明将以线为主的输入资料流转换为以像块为主的输出资料流时,一缓冲记忆体的读取与写入动作。5 to 10 are schematic diagrams of operations, illustrating the reading and writing operations of a buffer memory when the present invention converts the line-based input data stream into a block-based output data stream.
图11~图15是动作示意图,说明本发明将以像块为主的输入资料流转换为以线为主的输出资料流时,该缓冲记忆体的读取与写入动作。11 to 15 are schematic diagrams of operations, illustrating the reading and writing operations of the buffer memory when the present invention converts the block-based input data stream into a line-based output data stream.
具体实施方式Detailed ways
实施例1Example 1
参阅图4、5,本发明缓冲装置100的第一较佳实施例是能将以线为主的输入资料流转换为以像块为主的输出资料流,该较佳实施例包括一缓冲记忆体1、一标记记忆体2,以及一缓冲控制器3。Referring to Fig. 4, 5, the first preferred embodiment of the
缓冲记忆体1是供储存由控制器3所接收的输入资料流,本例中,是以一具有640×8位元组空间的缓冲记忆体1来作说明,换句话说,缓冲记忆体1一次可以储存一640×8大小的影像,惟不应以此作为本发明的限制。如图5所示,缓冲记忆体1能被逻辑地分割出复数个大小相同的区块,本例中,每一区块的大小皆是8×1位元组,因此总共区分为640个区块。The
每一区块的起始位置(address)并被加以标记,以方便后续的写入与读取动作,为方便说明起见,下文中特别将每一区块的标记位置,依据写入与读取状态的不同,分别表示为写入标记位置I(t)与读取标记位置O(t),事实上,同一区块只有一实体的标记位置。其中,t是指写入次序或者输出次序,依序为0、1、2、3…639。The starting position (address) of each block is marked to facilitate subsequent writing and reading operations. For the convenience of explanation, the marking position of each block will be specially used in the following according to writing and reading The different states are respectively expressed as the writing mark position I(t) and the reading mark position O(t). In fact, there is only one physical mark position in the same block. Wherein, t refers to a writing sequence or an output sequence, which are 0, 1, 2, 3...639 in sequence.
本例中所欲取出的像块大小为一符合MPEG或JPEG规范的最小处理单位,所以为一8×8位元组的像块,因此本实施例中的每8个区块为一栏(column)恰构成一像块,并可由左至右共区分为80个像块。In this example, the image block size to be taken out is a minimum processing unit conforming to the MPEG or JPEG standard, so it is an 8*8 byte image block, so every 8 blocks in the present embodiment are a column ( column) just constitutes a block, and can be divided into 80 blocks from left to right.
特别是,上述写入标记位置I(t)与读取标记位置O(t)两者具有下列的特定关系式:In particular, the above-mentioned write mark position I(t) and read mark position O(t) both have the following specific relationship:
On(t)=In((t%h)×w+t/h)(1)On(t)=In((t%h)×w+t/h)(1)
其中,h是像块的高度,w是缓冲记忆体每一列所具有的区块数目,而「t%h」是指t除以h后所得的余数,「t/h」是指t除以h所得的商。利用式(1),可由写入标记位置及其写入次序,得知相对应的读取标记位置及其读取次序。Among them, h is the height of the image block, w is the number of blocks in each column of the buffer memory, and "t%h" refers to the remainder obtained after dividing t by h, and "t/h" refers to dividing t by The quotient obtained by h. Using formula (1), the corresponding position of the read mark and its read order can be obtained from the position of the write mark and its write order.
本例中,由于h=8、w=640/8=80,因此式(1)进一步成为:In this example, since h=8, w=640/8=80, so formula (1) further becomes:
On(t)=In((t%8)×80+t/8)(2)On(t)=In((t%8)×80+t/8)(2)
因此,第一个读取标记位置O(0)等于第一个写入标记位置I(0)【O(0)=I(0)】、第二个读取标记位置O(1)=I((1%8)×80+1/8)=I(80)、第三个读取标记位置O(2)=I((2%8)×80+1/8)=I(160)、O(3)=I(240)……,所以由式(2)知,依据O(0)、O(1)、O(2)…O(7)分别对应于I(0)、I(180)、I(160)…I(560)的顺序依序读取每个区块,就能够读取出第一个像块,而其余O(8)、O(9)…,则可再读取其余像块。Therefore, the first read mark position O(0) is equal to the first write mark position I(0) [O(0)=I(0)], the second read mark position O(1)=I ((1%8)×80+1/8)=I(80), the third read mark position O(2)=I((2%8)×80+1/8)=I(160) , O(3)=I(240)..., so from formula (2), according to O(0), O(1), O(2)...O(7) respectively correspond to I(0), I (180), I(160)...I(560) in order to read each block sequentially, the first image block can be read, and the rest O(8), O(9)... can be Then read the remaining blocks.
标记记忆体2是用来储存的各区块的标记位置,换句话说,由于本发明在同时进行读取与写入的动作,因此必需记录有I(0)~I(639)以及O(0)~O(639)各个读取与写入标记位置,所以标记记忆体2需要有2×210位元的空间大小。在标记记忆体2中,主要可以分为两组供储存标记的空间,第一组标记是用来供控制器3参照,以由特定的缓冲记忆体1地址进行第一次的写入与读取动作,第二组则是供控制器3以第一组为依据,计算出第二次写入与读取动作所指向的缓冲记忆体1地址,而待控制器3以第二组标记来进行第二次读取与写入时,第一组标记又可依据第二组标记被更新成第三次读取与写入时的标记地址,如此反复进行,即控制器3能一边参照标记记忆体2中的标记进行读取与写入,并一边进行下一次欲进行读取与写入地址的更新。The
下文中为了便于说明,是将各标记直接标示于缓冲记忆体1中,事实上,标记只是储存在标记记忆体2中供控制器3作参照。In the following, for the convenience of explanation, the flags are directly marked in the
控制器3可以控制资料流,并参照于标记记忆体2中所储存的写入标记位置I(0)、I(1)…I(639),依序写入各区块,并在读取时会依据式(2)计算出所要的读取标记位置,再由标记记忆体2中撷取所要的读取标记位置,进一步执行读取的动作,以下分就写入与读取动作进行详细说明:The
(1)第一次写入(1) Write for the first time
参阅图5,控制器3是参照标记记忆体2中所储存的写入标记位置,使输入资料流循序由I1(0)、I1(1)、I1(2)…的顺序写入影像资料。Referring to Fig. 5, the
(2)第一次读取(2) Read for the first time
参阅图6,本发明并不需要等待缓冲记忆体1的所有空间已填满资料后才进行资料的读取。可以但是不限于,例如在最后一排写入标记位置为I1(560)~I1(639)的区块尚未写入资料时,就可以开始进行资料的读取,即一边进行输入资料的写入动作并一边进行输出资料流的输出动作。Referring to FIG. 6 , the present invention does not need to wait for all the space of the
如前所述,读取的次序O1(0)、O1(1)…的各读取标记位置可以由控制器3经式(2)计算后所得,所以在控制器3参照标记记忆体2中所要的标记读取位置后,即由缓冲记忆体1中取出相对应的区块的资料O1(0)、O1(1)、O1(2)…【即对应为写入标记位置为I1(0)、I1(80)、I1(160)…的区块】。As mentioned above, the positions of the read marks in the read sequence O 1 (0), O 1 (1)... can be obtained by the
此外,在读取的同时,也持续进行I1(560)~I1(639)区块的写入,因此循序由O1(0)读取至O1(8)时并不会产生间断。In addition, while reading, blocks I 1 (560) to I 1 (639) are also continuously written, so there will be no interruption when sequentially reading from O 1 (0) to O 1 (8) .
(3)第二次写入(3) Second write
在第一次写入动作已届I1(639)时,如图7所示,此时也有若干区块已经过第一次读取,所以持续而来的输入资料流能再持续进行写入的动作而不间断。由下列式(3):When the first write operation has reached I 1 (639), as shown in Figure 7, there are also some blocks that have been read for the first time, so the continuous input data stream can continue to write action without interruption. By the following formula (3):
In+1(t)=On(t) (3)I n+1 (t) = On (t) (3)
知其第二次写入次序与第一次所读取的次序相同,换句话说,经读取后的第一个区块O1(0)等于第二次写入时的第一个区块位置I2(0),也就是将O1(0)、O1(1)…区块依次写入新的资料为I2(0)、I2(1)…,如图8所示。It is known that the second writing sequence is the same as the first reading sequence, in other words, the first block O 1 (0) after reading is equal to the first block O 1 (0) in the second writing The block position I 2 (0), that is, the O 1 (0), O 1 (1) ... blocks are sequentially written with new data as I 2 (0), I 2 (1) ..., as shown in Figure 8 .
(4)第二次读取(4) The second read
当第一次读取已届O1(639)区块时,如图9所示,即可以接续第二次读取【第二次写入尚在进行】,如图10所示,第二次读取的次序O2(0)、O2(1)…的各读取标记位置依然可以由控制器3经式(2)计算后所得,其对应于各标记写入位置I(0)、I(180)…,换句话说,虽然第二次写入时是以由上而下的次序循序写入,但是由于控制器3依然由式(2)计算出所需取出区块O2(0)、O2(1)…的相对应标记位置为I(0)、I(180)…,因此读取出的输出资料流依然是以像块为单位。When reading the O 1 (639) block for the first time, as shown in Figure 9, the second reading can be continued [the second writing is still in progress], as shown in Figure 10, the second The position of each read mark in the sequence O 2 (0), O 2 (1) ... of the second read can still be calculated by the
因此,上述写入、读取的动作反复进行,就能够持续地将资料流转换为像块输出,由于随着写入、读取的次数增加,其变化也渐复杂,所以在此不再详细说明。但是需知,由于区分出复数个大小相等的区块,再加以标记出各区块位置,因此即便输入资料流的资料被分别储存于不相邻近的区块中,控制器3也能进一步以式(2)连同式(3)一并计算出所需取出资料的标记位置,能够正确地输出所欲的资料流。Therefore, the above-mentioned writing and reading operations are repeated, and the data stream can be continuously converted into pixel output. As the number of writing and reading increases, the changes become more and more complicated, so I will not go into details here. illustrate. However, it should be known that since a plurality of blocks of equal size are distinguished and the positions of each block are marked, even if the data of the input data stream are stored in non-adjacent blocks, the
此外,举凡JPEG的静态影像压缩,是分别对红(R)、绿(G)、蓝(B)三原色来分别处理,因此通常具有三组相同的缓冲记忆体1,本例中为简化说明起见,只以单一缓冲记忆体1来作说明,但是熟习此技者应知本发明的技术也能推演至多组缓冲装置100并行的状态。In addition, for JPEG static image compression, the three primary colors of red (R), green (G) and blue (B) are processed separately, so there are usually three sets of the
实施例2Example 2
参阅图3与图11,本发明的第二较佳实施例其架构与第一较佳实施例相同,所以不再详细说明。惟本实施例是用来将以像块为主的输入资料流转换为以线为主的输出资料流,即本实施例是第一较佳实施例的逆工程,可以使用在例如MPEG、JPEG解压缩过程中的最后段。Referring to FIG. 3 and FIG. 11 , the structure of the second preferred embodiment of the present invention is the same as that of the first preferred embodiment, so it will not be described in detail again. However, this embodiment is used to convert the input data stream mainly based on blocks into an output data stream mainly based on lines, that is, this embodiment is the reverse engineering of the first preferred embodiment, and can be used in MPEG, JPEG, etc. Last segment during decompression.
本例中也是以一大小为640×8位元组的缓冲记忆体1来作说明,且每一区块也是区分为8×1个位元组。写入标记位置与读取标记位置两者间的特定关系式则变成下式:In this example, a
On(t)=In((t%w)×h+t/w) (4) On (t)= In ((t%w)×h+t/w) (4)
其中,h是像块的高度,w是缓冲记忆体1一列所具有的区块数目,而「t%w」是指t除以w后所得的余数,「t/w」是指t除以w所得的商。即利用式(4),可由写入标记位置及其写入次序,得知相对应的读取标记位置及其读取次序。Among them, h is the height of the image block, w is the number of blocks in a column of the buffer memory, and "t%w" refers to the remainder obtained after dividing t by w, and "t/w" refers to dividing t by The quotient obtained by w. That is, using formula (4), the corresponding position of the read mark and its read order can be known from the position of the write mark and its write order.
由于w=80,h=8,所以式(4)成为:Since w=80, h=8, so formula (4) becomes:
On(t)=In((t%80)×8+t/80)(5)On(t)=In((t%80)×8+t/80)(5)
以下将说明写入资料的过程与利用式(5)读取资料的过程:The following will describe the process of writing data and the process of reading data using formula (5):
(1)第一次写入(1) Write for the first time
参阅图11,在进行写入时,由于输入资料流乃是以区块为主,所以控制器3是参照标记记忆体2中的写入标记位置,循序依I1(0)、I1(1)…I1(639)的顺序写入资料至各区块中。Referring to FIG. 11 , when writing, since the input data stream is mainly based on blocks, the
(2)第一次读取(2) Read for the first time
参阅图12,可以但是不限于,在缓冲记忆体1最后一行(写入标记位置为I1(632)~I1(639))尚未写入资料时,就可以开始进行资料的读取。所读取的区块位置与顺序,可以由控制器3依(5)计算所得O1(0)=I1(0)、O1(1)=I1(8)、O1(2)=I1(16)……,所以控制器3参照标记记忆体2中所要的标记读取位置后,即能由特定的标记位置读取出各区块中的资料,而依序所取出的资料,恰构成一以线为主的输出资料流。Referring to FIG. 12 , it is possible, but not limited to, to start reading data when data has not been written in the last line of the buffer memory 1 (the write mark positions are I 1 ( 632 )˜I 1 ( 639 )). The read block position and order can be calculated by the
另一方面,写入I1(632)~I1(639)区块的动作也持续进行,直至最后区块I1(639)。On the other hand, the operation of writing blocks I 1 ( 632 )˜I 1 ( 639 ) is also continued until the last block I 1 ( 639 ).
(3)第二次写入(3) Second write
在第一次写入结束的同时,由于前述已被读取过的区块O1(0)、O1(1)…等又可被写入资料,因此依据前述式(3):In+1(t)=On(t)再写入资料,即依序由读取标记位置为O1(0)、O1(1)、O1(2)的区块写入资料,使其成为被第二次写入的区块位置I2(0)、I2(1)、I2(2)…,如图13所示。At the same time when the first writing is completed, since the previously read blocks O 1 (0), O1(1)...etc. can be written into data again, according to the above formula (3): I n+ 1 (t)=O n (t) and then write data, that is, write data in the blocks whose read mark positions are O 1 (0), O 1 (1), O 1 (2) in sequence, so that These become block positions I 2 (0), I 2 (1), I 2 (2), . . . to be written for the second time, as shown in FIG. 13 .
(4)第二次读取(4) The second read
参阅图14,当第一次读取已届O1(639)区块后,即可以接续第二次读取,如图15所示,第二次读取的次序O2(0)、O2(1)……的各读取标记位置可以由控制器3经式(5)计算后,由标记记忆体2中所得,其对应于各标记写入位置I2(0)、I2(8)、I2(16)……。因此,虽然在第二次写入时是以由左而右的区块循序写入,但是由于控制器3依然由式(2)计算出所需取出区块O2(0)、O2(1)…的相对应标记位置为I(0)、I(8)…,因此读取出的资料依然是由像块为主解码成以线为主资料流后输出。Referring to FIG. 14 , after the first read of the O 1 (639) block, the second read can be continued, as shown in FIG. 15 , the order of the second read O 2 (0), O 2 (1) ... each reading mark position can be obtained from the
因此,控制器依据上述式(3)与式(5),能知所欲写入的区块以及所欲读取的区块次序,即便所欲取出的区块已不相邻,亦能够正确地进行资料的读取与写入动作。Therefore, the controller can know the order of the blocks to be written and the sequence of the blocks to be read according to the above formula (3) and formula (5), even if the blocks to be taken out are no longer adjacent, the sequence can be correct read and write data in a timely manner.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 200310103402 CN1291324C (en) | 2003-10-31 | 2003-10-31 | Data stream conversion method and buffer device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN 200310103402 CN1291324C (en) | 2003-10-31 | 2003-10-31 | Data stream conversion method and buffer device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1612111A true CN1612111A (en) | 2005-05-04 |
| CN1291324C CN1291324C (en) | 2006-12-20 |
Family
ID=34756654
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN 200310103402 Expired - Fee Related CN1291324C (en) | 2003-10-31 | 2003-10-31 | Data stream conversion method and buffer device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1291324C (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI798034B (en) * | 2022-03-23 | 2023-04-01 | 慧榮科技股份有限公司 | Memory controller and data processing method |
-
2003
- 2003-10-31 CN CN 200310103402 patent/CN1291324C/en not_active Expired - Fee Related
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI798034B (en) * | 2022-03-23 | 2023-04-01 | 慧榮科技股份有限公司 | Memory controller and data processing method |
| US12223173B2 (en) | 2022-03-23 | 2025-02-11 | Silicon Motion, Inc. | Memory controller and data processing method for processing disordered read-out data |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1291324C (en) | 2006-12-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8989263B2 (en) | Inverse quantizer supporting multiple decoding processes | |
| CN113170140B (en) | Method for encoding data element, method for decoding data stream, device and medium | |
| CN101030365A (en) | Digital image storage displaying method and device | |
| JP2017184250A (en) | Apparatus and method for decoding using coefficient compression | |
| CN1893659A (en) | DCT compression using Golomb-Rice coding | |
| CN1798341A (en) | Adaptive coefficient scan order | |
| CN103262531B (en) | For the method and apparatus that storage compression ratio is indicated in pixel value buffer in encoding in segment | |
| CN109889846B (en) | Method and device for compressing and decompressing Demura table data and coding and decoding system | |
| CN1290339C (en) | Compressed moving image decompression device and image display device using the same | |
| TWI236605B (en) | Data flow conversion method and its buffer device | |
| CN102970544A (en) | JPEG (Joint Photographic Experts Group) encoding and decoding method and JPEG encoding and decoding system | |
| CN1118470A (en) | Image processing apparatus | |
| CN1719435A (en) | Device and method for performing discrete cosine transform/inverse discrete cosine transform | |
| CN1369175A (en) | Method and device for increasing use of memory resource in information flow decoder | |
| CN1791219A (en) | Dual layer bus architecture for system-on-a-chip | |
| CN1574967A (en) | Compressor arrangement for moving images and video taking device using the same | |
| CN1291324C (en) | Data stream conversion method and buffer device | |
| CN112422985B (en) | Multi-core parallel hardware coding method and device suitable for JPEG | |
| CN114387356B (en) | A PNG format encoding and decoding method and device | |
| CN105992003A (en) | Method and device for image compression of palette color number based on order or frequency | |
| CN1708123A (en) | Decoding device with multiple buffers | |
| JP2004509528A (en) | Data transfer between RGB color space and YCrCb color space for DCT interface | |
| CN1976475A (en) | Image processing device and method | |
| CN1692625A (en) | Image conversion device, image conversion method, and recording medium | |
| CN1574977A (en) | Method and device for changing image size |
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 |
Granted publication date: 20061220 Termination date: 20201031 |
|
| CF01 | Termination of patent right due to non-payment of annual fee |