Abstract:
The invention provides a memory access method for overlapping partial boundary data in order to reduce or eliminate cross-page penalties when reading data. The method includes the step of a determining step to determine the maximum size of prediction blocks; a storing step to overlap partial boundary data from one side page of a page boundary into the other side page of the page boundary; and a reading step to read a prediction block from the page having all the data of the prediction block when the prediction block is at the page boundaries with overlapping data to eliminate cross-page penalties so as to increase the reading speed. Hence, the invention utilizes an overlapping method to eliminate cross-page penalties when reading the block data so as to increase the memory bandwidth as well as the reading speed.

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The invention relates to a memory access method and, more particularly, to a memory access method of a video decoding system that utilizes a method of overlapping boundary data to reduce cross-page penalties when reading data. 
     2. Description of the Related Art 
     In many modern video decoding systems, such as MPEG-I, MPEG-II, and H261, inter-frame compression is used to reduce the redundancies between pictures and results in substantial data reduction. These systems all involve algorithms based on a common core of compression techniques, i.e. predictive and/or interpolative inter-frame encoding. The motion compensation is block-based and each prediction block has associated with motion vectors. The motion compensation operation involves reading the prediction blocks from reference pictures according to the motion vector information. Generally speaking, the reference pictures are quite large and typically stored in DRAM. The DRAM consists of several memory banks, and each bank in turns consists of many memory pages. Some additional overhead cycles, such as pre-charging and activating a memory page, are needed before accessing data in a memory page. Hence, when the current accessed page is different from the previous one, some overhead cycles, i.e. cross-page penalties, will occur. The cross-page penalties will significantly lower the bandwidth of reading prediction blocks from DRAM. 
     In order to reduce cross-page penalties, the prediction blocks should occupy as few pages as possible, and they should be read out page-by-page. FIG. 1 is a schematic diagram showing reference picture data stored in blocks. As shown in FIG. 1, the size of the reference picture is 720×576 pixels, and the size of each macro-block is 16×16 pixels. If the DRAM&#39;s page size is 1024 bytes, then each page may store four macro-blocks. The storing method in FIG. 1 is that each page (shown by thick lines) stores four vertical macro-blocks (shown by thin lines). When reading the dash-lined prediction block A, the data areas A 1 , A 2 , A 3 , and A 4  of prediction block A are allocated in four different pages; therefore, it is necessary to have three cross-page penalties. 
     Although cross page penalties can be substantially reduced by page-by-page read sequence, it still becomes an inevitable and inherent DRAM bandwidth bottleneck in very high bandwidth applications such as HDTV video decoding. Especially, such high bandwidth application usually has real time decoding requirement. Hence, the burst and large memory read action during motion compensation process may fail to achieve real-time decoding due to excessive page crossings. 
     SUMMARY OF THE INVENTION 
     In view of the above-mentioned problems, the object of the invention is to provide a memory access method, in which a virtual page is formed through overlapping boundary data at page boundaries to logically enlarge DRAM page size so as to reduce or entirely prevent cross-page penalties. 
     In order to achieve the above-mentioned object, the memory access method of the invention is to overlap partial boundary data at page boundary in order to reduce or eliminate cross-page penalties when reading data. The method includes the following steps: the first is a determining step, to determine the maximum size of prediction blocks; the second is a storing step, to overlap partial boundary data at adjacent pages; and the final is a reading step, to read prediction block from the page having all the data of the prediction block when the prediction block is at the boundary with overlapping data. 
     Hence, the invention utilizes a method of overlapping boundary data to eliminate or reduce cross-page penalties when reading the block data so as to increase the memory bandwidth as well as the reading speed. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic diagram showing reference picture data stored in blocks. 
     FIG. 2 is a diagram illustrating the principle of merging two pages into one virtual page, wherein (A) shows that the prediction block A is at page M; (B) illustrates that the prediction block A is right shifted by one pixel and is now occupying both pages of M and N; (C) illustrates that the boundary data of page M is overlapped to page N; and (D) shows the resulting virtual page M_N. 
     FIG. 3 is a diagram showing an example of the invention that illustrates all the horizontal page boundaries have been removed, wherein (A) shows the overlapping storage of each page; and (B) shows resulting equivalent virtual page arrangement. 
     FIG. 4 is a diagram showing an example of the invention that illustrates all the horizontal and vertical page boundaries have been removed, wherein (A) shows overlapping storage of each page; and (B) shows resulting equivalent single virtual page. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     A memory access method according to an embodiment of the invention will be described below in detail with reference to the drawings. 
     In FIG.  2 (A), the pages M and N are two horizontally adjacent pages. The prediction block A is entirely enclosed by page M; therefore, there will not be any cross-page penalties when the system reads the prediction block A. However, as shown in FIG.  2 (B), when the prediction block A is located right by one pixel position, a column data of the prediction block A is located in page N. Thus, when the system reads the prediction block A, a cross-page penalty from page M to page N will occur. Therefore, in order to prevent the cross-page penalty, the memory access method of the invention overlaps partial boundary data of page M into page N, as shown in the cross-shaded area in FIG.  2 (C). The width of the overlapping area is the width of the prediction block A minus 1. The cross-shaded area data are duplicate stored in both page M and N. 
     By the overlapping boundary data technique, when the system detects the prediction block A will run cross the vertical boundary of page M, the system will read out the data of the prediction block A from page N, and because the prediction block A is entirely enclosed by page N, no page crossing results. Therefore, from system viewpoint, the pages M and N can be treated as a whole virtual page M_N, as shown in FIG.  2 (D). Consequently, as long as the prediction block A is positioned within the virtual page M_N, it can be entirely enclosed either by page M or page N and the system reads the data of the prediction block from the page which entirely encloses the prediction block A. In this way, no any cross-page penalty occurs at the vertical boundary. By the technique of generating a virtual page, it is possible to logically enlarge the size of a page through overlapping boundary data between the adjacent pages. FIG. 2 shows an example of removing a vertical page boundary, and in the same way, the same technique can be applied to remove a horizontal page boundary as well. 
     The necessary conditions of creating virtual page are described as follows. First, the overlapping area is determined by the maximum possible size of a prediction block. Define W max  and H max  as the maximum width and height of the prediction blocks, respectively and the unit of the W max  and H max  is pixel. For example, in MPEG I, the prediction block size with half pixel precision contains 16×16, 17×17, 16×17, and 17×16. Among these sizes, the maximum width W max  and maximum height H max  are both 17; that is W max =17 and H max =17. 
     Second, assume that the DRAM page size is S page  and the shape of each page to store reference picture data is rectangular. Define W page  and H page  as the pixel width and pixel height for each rectangular page, respectively. If the vertical page boundary is desired to be removed as in FIG. 2, the necessary condition W page γW max  must be satisfied and the number of overlapping columns, W dup , between two horizontally adjacent pages is W max −1. The width of merged virtual page is (2*W page−(W   max −1)). On the other hand, if the horizontal page boundary is desired to be removed, the necessary condition H page γH max  must be satisfied and the number of overlapping rows, H dup , between two vertically adjacent pages is H max −1. The height of merged virtual page is (2*H page −(H max −1) ). Both the horizontal and vertical page boundaries can be removed at the same time. Furthermore, we can recursively perform the same procedure to merge virtual pages we just created. Thus, with merging adjacent pages into larger virtual pages, the cross-page penalties when reading the prediction blocks can be dramatically and substantially reduced. 
     FIG. 3 is a diagram showing an example of the invention that illustrates all the horizontal page boundaries have been removed, wherein (A) shows overlapping storage of each page; and (B) shows resulting equivalent virtual page arrangement. For example in MPEG I specification, the size of each macro-block is 16×16 pixels, and the maximum height, H max , of prediction blocks is 17. Assume the size of each page in memory can store four macro-blocks, and then the height of each page, H page , is 64. Since the condition H page γH max  is satisfied, the horizontal page boundary between vertically adjacent pages can then be removed. Besides, the number of overlapping rows, H dup , between each of the vertically adjacent pages is 16, H max □1, and this number happens to be the height of a macro-block. Therefore, the system overlaps the upper macro-blacks row of each horizontal boundary into the adjacent pages under the horizontal boundary, as shown in the cross-shaded area in FIG.  3 . 
     For example shown in FIG. 3, assume the reference picture size is 720×576 pixels; the number of stored pixel rows without overlapping boundary data is 576 rows. When applying the overlapping method, 16 rows between vertical adjacent pages need to be stored twice and total 176 rows are duplicate stored. The number of stored rows is 752 rows, which increased about one third of the original number. Although the size of the memory needs to be increased, the horizontal page boundaries have be removed to improve the speed for reading the prediction blocks. Referring to FIG.  3 (B), the horizontal boundary of each page has been removed, so the height of the virtual page SP 0 ˜SP 44  has been extended. In other words, the invention increases the size of memory to exchange for higher DRAM bandwidth. Since the trend of DRAM storage development is that the storage size increasing much faster than bandwidth. From system viewpoint, the DRAM bandwidth will become more and more important than DRAM storage. Consequently, it is worth exchange storage for bandwidth. In FIG.  3 (A), since the width of the page W page  is smaller than the maximum width W max  of the prediction block, it is impossible to remove the vertical page boundary. 
     FIG. 4 is a diagram showing an example of the invention that illustrates all the horizontal and vertical page boundaries have been removed, wherein (A) shows overlapping storage of each page; and (B) shows resulting equivalent single virtual page. For example in MPEG I specification, the size of each macro-block is 16×16 pixels, and the maximum height of prediction blocks H max  is 17. Assume the size of the page can store 16 macro-blocks, and then the height H page  and width W page  for each page are all 64. Thus, the conditions H page γH max  and W page γW max  are all satisfied. Therefore, the vertical page boundaries between horizontally adjacent pages can be removed, and the horizontal page boundary between vertically adjacent pages can be removed as well. Besides, the number of overlapping rows H dup  and columns W dup  between each of vertical and horizontal page boundary are both 16, i.e. H max −1 or W max −1, and these numbers happen to be the height and the width of a macro-block. Therefore, the system overlaps the upper macro-blacks row of each horizontal boundary into the adjacent pages under the horizontal boundary and overlaps left macro-blacks column of each vertical boundary into the right pages of each vertical boundary, as shown in the cross-shaded area in FIG.  4 . 
     For example shown in FIG. 4, assume the reference picture size is 720×576 pixels, the number of stored rows after applying the overlapping method increases from 576 to 752 and the number of stored columns increases from 720 to 944. Hence, with the overlapping method, the number of stored rows and columns has increased about one third of their original numbers. Although the size of the memory needs to be increased, all the boundaries for each page can then be removed. As shown in FIG.  4 (B), there is only one whole virtual page SP 0 . Therefore, when the system reads any prediction block, no cross-page penalties occur. Hence, the speed for reading the prediction blocks can be dramatically enhanced. Thus, after the reference pictures have been stored in the memory according to the method of the invention, the system will not encounter any cross-page penalties when reading any prediction block. Therefore, in the very high bandwidth real-time applications, the bottleneck that the bandwidth has been encountered due to the cross-page penalties can then be overwhelmingly overcome. 
     The specific embodiment described above is only intended to illustrate the invention; it does not, however, to limit the invention to the specific embodiment. Accordingly, various modifications and changes may be made without departing from the spirit and scope of the invention as described in the appended claims.