Method for memory allocation for images
View Patent ↗In a method for memory allocation for images, when storing data describing an image ( 10 ) in operating memory ( 1 ), the image ( 10 ) is divided into lines, and each line is described by a separate subset of data from which at least one set of data is created, to which a free segment of operating memory ( 1 ) is assigned. The creation of sets of data is performed until data describing the whole image ( 10 ) is assigned to the sets of data, and when reading the image ( 10 ), consecutive lines are read from the operating memory ( 1 ), until the whole image ( 10 ) is read.
1. A method for memory allocation for images, comprising the steps of:
while storing the data describing an image in operating memory dividing the image into lines, each line being described by a separate subset of data;
allocating the image in the operating memory by
determining a size of a largest free block of operating memory,
creating a set of data from subsets of data which have not been allocated in operating memory yet, the set of data comprising a maximum number of subsets of data that can be allocated in the largest free block of operating memory;
allocating the set of data in the largest free block of operating memory until data describing the image is allocated in operating memory; and
while reading the image, reading consecutive lines from the operating memory until the whole image is read.
2. The method according to claim 1 , wherein each set of data contains subsets of data describing an integer multiple of lines.
3. The method according to claim 1 , wherein each line is assigned a number.
4. The method according to claim 1 , wherein simultaneously with allocating the subsets of data in operating memory, the table of pointers to individual lines is filled.
5. The method according to claim 4 , wherein the table of pointers to individual lines comprises the memory address of each line of the image.