JP2007034555A - DYNAMIC MEMORY MANAGEMENT METHOD, MEMORY MANAGEMENT DEVICE, ELECTRONIC DEVICE, AND IMAGING DEVICE - Google Patents
DYNAMIC MEMORY MANAGEMENT METHOD, MEMORY MANAGEMENT DEVICE, ELECTRONIC DEVICE, AND IMAGING DEVICE Download PDFInfo
- Publication number
- JP2007034555A JP2007034555A JP2005215307A JP2005215307A JP2007034555A JP 2007034555 A JP2007034555 A JP 2007034555A JP 2005215307 A JP2005215307 A JP 2005215307A JP 2005215307 A JP2005215307 A JP 2005215307A JP 2007034555 A JP2007034555 A JP 2007034555A
- Authority
- JP
- Japan
- Prior art keywords
- memory
- area
- memory management
- unused
- rectangular
- 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.)
- Pending
Links
Images
Landscapes
- Memory System (AREA)
- Studio Devices (AREA)
Abstract
【課題】 シンプルかつ低コストのメモリ管理手法により、2次元のデータを含む多様なサイズのデータを自由な取り扱いを可能とし、かつ、無駄なメモリ領域の発生を抑制可能な新規な動的メモリ管理技術を実現する。
【解決手段】 メモリ管理装置120のメモリ領域確保・解放部122は、2次元の共有メモリ110において、多様なサイズの2次元(一次元を含む)のメモリ領域112a〜112cを自由に確保し、そのメモリ領域の使用後に解放する。メモリ領域の確保に際し、格納しようとする矩形データの水平垂直の関係をそのまま維持できるようにし、メモリの断片化も抑制することを考慮して、適切なサイズのメモリ領域を確保する。メモリ110のメモリ空間の使用状況(未使用状況)は、管理情報124によって適宜、管理する。
【選択図】 図2PROBLEM TO BE SOLVED: To provide a new dynamic memory management capable of freely handling various sizes of data including two-dimensional data by using a simple and low-cost memory management method and suppressing generation of a useless memory area. Realize technology.
A memory area securing / releasing unit 122 of a memory management device 120 freely secures two-dimensional (including one-dimensional) memory areas 112a to 112c of various sizes in a two-dimensional shared memory 110, Release after using the memory area. In securing the memory area, the horizontal and vertical relations of the rectangular data to be stored can be maintained as they are, and the memory area of an appropriate size is secured in consideration of suppressing fragmentation of the memory. The usage status (unused status) of the memory space of the memory 110 is appropriately managed by the management information 124.
[Selection] Figure 2
Description
本発明は、動的メモリ管理方法、メモリ管理装置、電子機器及び撮像装置に関し、特にメモリを有効利用する技術に関する。 The present invention relates to a dynamic memory management method, a memory management device, an electronic apparatus, and an imaging device, and more particularly to a technique for effectively using a memory.
固体撮像素子を備えた撮像装置(電子スチルカメラやビデオカメラ等)では、固体撮像素子によって光電変換されて得られるアナログ信号をA/D変換し、その結果として得られる画像データをそのまま、あるいは必要に応じて圧縮してメモリに一時的に蓄積し、次に、その画像データを読出して画像処理回路へ送って所定の画像処理(例えば、歪み補正、YC分離、縮小ズーム、画像回転、ポストフィルタ処理、JPEG圧縮、垂直方向の拡大といった各種の画像処理)を行い、画像処理後の画像データを必要に応じて圧縮した後に再度メモリに蓄積する、というような一連の処理が行われる。 In an imaging apparatus (such as an electronic still camera or a video camera) equipped with a solid-state image sensor, analog signals obtained by photoelectric conversion by the solid-state image sensor are A / D converted, and the resulting image data is used as is or necessary. The image data is compressed and temporarily stored in the memory, and then the image data is read out and sent to the image processing circuit for predetermined image processing (for example, distortion correction, YC separation, reduction zoom, image rotation, post filter A series of processes such as processing, JPEG compression, and various types of image processing such as vertical enlargement are performed, and the image data after image processing is compressed as necessary and stored in the memory again.
上記処理では、撮像データの一時的な蓄積のため、あるいは、各種の画像処理時(圧縮・伸長処理を含む)における処理データの一時的蓄積のため等に、メモリが頻繁に使用される。 In the processing described above, a memory is frequently used for temporarily storing imaging data or temporarily storing processing data during various image processing (including compression / decompression processing).
デジタルカメラ等の撮像機器では、CCD等の撮像素子からは一行毎のラインデータが出力される点に着目し、一行のデータを格納するためのラインメモリ(所定サイズをもつ静的メモリ)が多く用いられている。 In imaging devices such as digital cameras, paying attention to the fact that line data is output for each row from an image sensor such as a CCD, there are many line memories (static memories with a predetermined size) for storing one row of data. It is used.
ただし、ラインメモリのサイズを一律に固定してしまうと、メモリの使用効率が低下する(メモリが無駄になる)場合もある。そこで、特許文献1では、多数のラインメモリの集合体によって共有メモリを構築し、そして、共有メモリの使用の必要性が生じると、その都度、使用するラインメモリを、メモリ使用要求元の回路に割り当てるようにして、ラインメモリを効率的に使用できるようにしている。
特許文献1記載の技術において、使用される共有メモリは、ラインメモリの集合体であり、したがって取り扱えるデータは、結局のところ、イメージセンサから出力される一行分の画像データだけである。
In the technique described in
しかし、近年、撮像装置(電子スチルカメラ、ビデオカメラならびにカメラ付き携帯端末のような携帯機等を含む)の高機能化、多機能化に伴い、カメラ付き携帯電話機のような携帯機では、ネットワーク上のサーバからダウンロードした画像を実写した写真画像と合成する等の処理も可能となってきており、通常の撮像装置においても、イメージセンサから出力される一行分のデータ(ラインデータ)だけではなく、多様なサイズの2次元データを自由に取り扱う必要性が高まっている。 However, in recent years, with the increase in functionality and multifunction of imaging devices (including portable devices such as electronic still cameras, video cameras, and camera-equipped portable terminals), in portable devices such as camera-equipped cellular phones, Processing such as combining the image downloaded from the above server with a photographed photograph is also possible, and even in a normal imaging device, not only data for one line (line data) output from the image sensor There is an increasing need to freely handle two-dimensional data of various sizes.
また、イメージセンサから出力される一行分のラインデータの処理に限った場合でも、特許文献1の技術では、固定サイズのラインメモリを多数使用することから、無駄なメモリ領域が発生し易くなるのはやむを得ない。つまり、一口にラインデータといっても、実際は、撮像装置の機種に応じて、あるいは、ユーザが選択する解像度等に応じて、ラインデータのサイズは多様に変化することから、特許文献1記載のように、一行分のサイズが固定のラインメモリを使用する場合、最も大きなサイズを想定してラインメモリの容量を決める必要があり、実際に取り扱うデータが小サイズの場合には、残余の部分が無駄になってしまう。
Further, even when the processing is limited to processing one line of line data output from the image sensor, the technique of
また、共有メモリとしては、図12に示される構造をもつDRAMを使用することができる。DRAMは、図12に示されるように、ワード線W1〜W4と、ビット線(データ線)C1〜C4によって選択されるメモリセル(m1〜m12)にデータを随時書き込みでき、同様に、選択されるメモリセルから随時データを読み出すことができるメモリである。ワード線(W1〜W4)の切替時には、若干の遅延が生じる。 As the shared memory, a DRAM having the structure shown in FIG. 12 can be used. As shown in FIG. 12, the DRAM can write data to the memory cells (m1 to m12) selected by the word lines W1 to W4 and the bit lines (data lines) C1 to C4 at any time. It is a memory that can read data from memory cells at any time. A slight delay occurs when the word lines (W1 to W4) are switched.
また、CCD等のイメージセンサを用いて画像データを生成する撮像装置(電子スチルカメラ等)では、基本的に、一行分のラインデータを単位として画像を処理する必要がある。 In addition, in an imaging apparatus (such as an electronic still camera) that generates image data using an image sensor such as a CCD, it is basically necessary to process an image in units of line data for one line.
つまり、図13(a)に示すように、CCD等のイメージセンサで撮像されて得られる一枚の画像の画像データは、各行のラインデータ(1)〜(7)に区分されている。仮に、図13(a)の画像データを、共有メモリのメモリ空間に図13(b)のような態様で格納すると、一行分のラインデータ(2),(4)が2行に跨って格納されてしまう。したがって、これらのラインデータを読み出すときに、ワード線を切り替える必要があり、この際に画像データの読み出しに遅延が生じる可能性が生じる。この場合、後続の処理に悪影響(例えば、画像の乱れや、DSP等による画像処理の遅延が生じる等)を及ぼす場合がある。 That is, as shown in FIG. 13A, image data of one image obtained by imaging with an image sensor such as a CCD is divided into line data (1) to (7) of each row. If the image data of FIG. 13A is stored in the memory space of the shared memory in the manner as shown in FIG. 13B, the line data (2) and (4) for one line is stored across two lines. Will be. Therefore, when reading out these line data, it is necessary to switch the word line, and at this time, there is a possibility that a delay occurs in reading out the image data. In this case, the subsequent processing may be adversely affected (for example, image disturbance or image processing delay due to a DSP or the like).
このように、2次元データを動的メモリ管理方法によって管理する場合、単に、メモリ空間に必要なサイズの領域を確保すればよいというものではなく、後続の画像処理への影響を考えて、適切な形状のメモリ領域を迅速に確保する必要がある。また、無駄に大きなサイズのメモリ領域を確保することを避け、また、メモリの断片化(フラグメンテーション)を防止することも重要である。 As described above, when managing the two-dimensional data by the dynamic memory management method, it is not only necessary to secure an area of a necessary size in the memory space, and it is appropriate to consider the influence on the subsequent image processing. It is necessary to quickly secure a memory area having a proper shape. It is also important to avoid unnecessarily securing a large memory area and to prevent memory fragmentation.
本発明は、このような考察に基づいてなされたものであり、1次元のデータだけではなく、2次元のデータを含めて自由に取り扱いでき、また、多様なサイズのデータを自由に取り扱いでき、かつ、無駄なメモリ領域の発生を抑制できる、新規なメモリ管理技術を実現することを目的とする。 The present invention has been made based on such considerations, and can freely handle not only one-dimensional data but also two-dimensional data, and can freely handle data of various sizes. It is another object of the present invention to realize a novel memory management technique that can suppress the generation of useless memory areas.
本発明に係る上記目的は下記構成により達成される。
(1) メモリ空間に2次元のデータを格納する必要が生じると、前記メモリ空間のメモリ使用状況を管理するメモリ管理情報を参照して前記メモリ空間における未使用領域を検索し、前記2次元のデータを格納可能な2次元のメモリ領域を確保する第1のステップと、前記確保した2次元のメモリ領域が不要となると、その2次元のメモリ領域を解放する第2のステップとを含む動的メモリ管理方法であって、前記2次元のデータは矩形状の画像データであり、前記第1のステップでは、前記画像データの矩形状を維持したまま格納可能な矩形メモリ領域を確保することを特徴とする動的メモリ管理方法。
The above object of the present invention is achieved by the following configuration.
(1) When it becomes necessary to store two-dimensional data in the memory space, an unused area in the memory space is searched with reference to memory management information for managing the memory usage of the memory space, and the two-dimensional data A first step of securing a two-dimensional memory area capable of storing data, and a second step of releasing the two-dimensional memory area when the secured two-dimensional memory area is no longer needed In the memory management method, the two-dimensional data is rectangular image data, and in the first step, a rectangular memory area that can be stored while maintaining the rectangular shape of the image data is secured. Dynamic memory management method.
この動的メモリ管理方法によれば、メモリ空間における使用領域又は未使用領域をメモリ管理情報によって管理し、このメモリ情報を適宜、参照することによって、共通のメモリ空間において、多様なサイズの2次元のデータ(1次元のデータを含む)を自由に確保し、また、不要となったメモリ領域を解放することが可能な、メモリの動的管理方法を実現することができる。ここで用意されるメモリ空間は、従来技術に見られるようなラインメモリの集合体ではなく、多目的に、制限なく使用可能な、一つのメモリ空間であるため、イメージセンサからの1行分のラインデータだけでなく、他のあらゆる形式のデータ(2次元、1次元を問わない)をそのメモリ空間に格納することができる。必要なサイズのメモリ領域を必要なときに確保し、また、不要となったメモリ領域は解放して再利用を可能とすることができ、したがって、メモリの無駄を省き、効率的なメモリ利用が可能となる。 According to this dynamic memory management method, a used area or an unused area in the memory space is managed by the memory management information, and the memory information is referred to as appropriate so that two-dimensional of various sizes can be obtained in the common memory space. It is possible to realize a dynamic memory management method that can freely secure data (including one-dimensional data) and free a memory area that is no longer needed. The memory space prepared here is not a collection of line memories as found in the prior art, but is a single memory space that can be used without limitation for multiple purposes. Not only data but also any other type of data (whether 2D or 1D) can be stored in the memory space. A memory area of the required size can be secured when necessary, and the memory area that is no longer needed can be released and reused, thus eliminating memory waste and efficient memory usage. It becomes possible.
また、CCD等のイメージセンサからは、一行分のラインデータ単位で画像データが出力される。ここで、確保したメモリ領域の行方向のサイズが足りず、一行分のラインデータを、二行のメモリ領域にまたがって格納することになると、メモリのリード時において、行の切替(つまり、ワード線の切替)のためにデータ読み出しに遅延が生じ、このことが後続の画像処理に悪影響(例えば、表示画像に乱れが生じる、あるいは、DSP等による画像の信号処理に遅延が生じる等)を与える場合がある。そこで、メモリ空間に矩形(四角形)のブロックの画像データを格納するための矩形メモリ領域を動的に確保する際、矩形(四角形)の画像データ(のブロック)の状態を維持したまま、その画像データをそのまま格納できるような矩形状のメモリ領域を確保する。つまり、メモリ領域を自由に確保できるといっても、必要なサイズさえ満足すればどのような形状の領域を確保してもよい、という訳ではなく、その画像データの縦横のサイズを意識して領域を確保することが肝要である。これにより、一行分のラインデータは必ず一行のメモリ領域に確保でき、一行のラインデータの読み出しの途中で遅延が生じることを防止でき、また、矩形状の画像データがその形状を維持されてメモリ空間に格納されるため、画像処理回路等は、その画像データをそのまま読み出して、すぐに処理、加工を行うことができ、画像の処理、加工に伴う余計な負担が生じることもない。 In addition, image data such as a line data unit for one row is output from an image sensor such as a CCD. Here, if the size of the reserved memory area is insufficient and the line data for one line is stored across the two memory areas, the line switching (that is, the word (Line switching) causes a delay in data reading, which adversely affects subsequent image processing (for example, disturbance in a display image or delay in image signal processing by a DSP or the like). There is a case. Therefore, when dynamically securing a rectangular memory area for storing image data of a rectangular (rectangular) block in the memory space, the image is maintained while maintaining the state of the rectangular (rectangular) image data (block). A rectangular memory area is secured so that data can be stored as it is. In other words, even if the memory area can be secured freely, it does not mean that the area of any shape can be secured as long as the required size is satisfied, but it is conscious of the vertical and horizontal size of the image data. It is important to secure the area. As a result, the line data for one line can always be secured in the memory area of one line, a delay can be prevented during the reading of the line data for one line, and the shape of the rectangular image data is maintained in the memory. Since the image data is stored in the space, the image processing circuit or the like can read the image data as it is, and can immediately process and process the image data, and there is no additional burden associated with image processing and processing.
(2) 請求項1記載の動的メモリ管理方法であって、前記メモリ管理情報として、前記メモリ空間上の使用領域又は未使用領域を判定するためのテーブルを使用し、該テーブルにおいて、開始アドレスと、第1の方向及び該第1の方向に直交する第2の方向のサイズによって定義される矩形領域を単位として、前記メモリ空間上の使用領域又は未使用領域を特定することを特徴とする動的メモリ管理方法。
(2) The dynamic memory management method according to
この動的メモリ管理方法によれば、メモリ空間上の使用領域又は未使用領域を表すテーブルを用意し、そのテーブルにおいて、矩形領域(矩形ブロック)毎に、開始アドレスと、水平及び垂直方向のサイズを定義し、これをメモリ管理情報として使用するものである。テーブルを参照することによって、メモリ空間上に、どのようなサイズの矩形ブロックがどの位置にあるのかを直ちに検索することができ、これにより、必要なメモリ領域の迅速な確保に寄与できる。また、メモリ領域の確保や解放に伴い、メモリ管理情報は適宜、更新されるため、メモリ管理情報によって、メモリ空間の使用(未使用)状況をリアルタイムで管理することが可能となる。 According to this dynamic memory management method, a table representing a used area or an unused area in a memory space is prepared, and in the table, for each rectangular area (rectangular block), a start address and horizontal and vertical sizes are prepared. Are defined and used as memory management information. By referring to the table, it is possible to immediately search what size rectangular block is located in which position in the memory space, thereby contributing to promptly securing a necessary memory area. In addition, since the memory management information is updated appropriately as the memory area is secured or released, the memory space usage (unused) status can be managed in real time by the memory management information.
(3) (2)記載の動的メモリ管理方法であって、前記メモリ管理情報を参照して未使用領域を検索し、必要なメモリ領域を確保するに際し、前記メモリ空間上において前記第1走査方向に検索する第1検索ステップと、前記第1走査方向に必要サイズの未使用の部分があった場合に、前記第2走査方向に検索して必要サイズの未使用の部分があるかを検索する第2検索ステップと、前記第2検索ステップによって、必要サイズ以上の矩形状の未使用領域を検出した場合に、この最初に検出した矩形状の未使用領域を前記2次元データの格納先として確保する格納先設定ステップと、を有することを特徴とする動的メモリ管理方法。 (3) The dynamic memory management method according to (2), wherein when the unused area is searched with reference to the memory management information and a necessary memory area is secured, the first scan is performed on the memory space. A first search step for searching in the direction, and if there is an unused portion of the required size in the first scanning direction, search in the second scanning direction to search for an unused portion of the required size When a rectangular unused area that is larger than the required size is detected by the second search step and the second search step, the first detected rectangular unused area is used as the storage destination of the two-dimensional data. And a storage location setting step for securing the dynamic memory management method.
この動的メモリ管理方法によれば、必要なサイズの矩形領域をメモリ空間上に確保する際、メモリ空間上を所定の場所から所定の方向に順番にサーチしていき、最初に発見できた、必要なサイズをもつ矩形状の未使用領域を、データの格納先のメモリ領域として確保する。これにより、高速なサーチが可能となる。 According to this dynamic memory management method, when a rectangular area of a required size is secured on the memory space, the memory space is searched in order from a predetermined location in a predetermined direction, and can be found first. A rectangular unused area having a necessary size is secured as a memory area for storing data. Thereby, a high-speed search becomes possible.
(4) (2)記載の動的メモリ管理方法であって、前記メモリ管理情報を参照して未使用領域を検索し、必要なメモリ領域を確保するに際し、前記メモリ空間上において前記第1走査方向に検索する第1検索ステップと、前記第1走査方向に必要サイズの未使用の部分があった場合に、前記第2走査方向に検索して必要サイズの未使用の部分があるかを検索する第2検索ステップと、前記第1及び第2検索ステップを繰り返し、必要サイズ以上の矩形状の未使用領域を全て検出する全未使用領域検出ステップと、前記検出された未使用領域の中から、選択的にいずれか一つの矩形状の未使用領域を前記2次元データの格納先として確保する格納先選択設定ステップと、を有することを特徴とする動的メモリ管理方法。 (4) The dynamic memory management method according to (2), wherein when the unused area is searched with reference to the memory management information and a necessary memory area is secured, the first scan is performed on the memory space. A first search step for searching in the direction, and if there is an unused portion of the required size in the first scanning direction, search in the second scanning direction to search for an unused portion of the required size The second search step, the first search step and the second search step are repeated to detect all unused areas having a rectangular shape larger than the required size, and from the detected unused areas And a storage destination selection setting step for selectively securing any one rectangular unused area as a storage destination for the two-dimensional data.
この動的メモリ管理方法によれば、メモリ管理情報を参照して未使用領域を検索して必要なメモリ領域を確保するに際し、メモリ空間上を所定の場所から所定の方向に順番にサーチしていき、必要なサイズ以上の矩形状の未使用領域を抽出し、抽出された矩形状の未使用領域の各々の中から、必要なサイズに近く無駄な余白領域を少なくできる等の条件を満たすいずれか一つの矩形状の未使用領域を選択し、その選択された矩形状の未使用領域を2次元データの格納先として確保する。これにより、無駄に大きなサイズの領域を確保することがなくなり、また、その領域を確保したことによって生じるメモリの断片化(フラグメンテーション)の問題(メモリ空間内で、細切れの領域が散らばることによってメモリの利用効率が低下する問題)を、生じにくくすることができる。 According to this dynamic memory management method, when searching for unused areas by referring to memory management information and securing necessary memory areas, the memory space is searched in order from a predetermined location in a predetermined direction. Any rectangular unused area that is larger than the required size is extracted, and any of the extracted rectangular unused areas that satisfy the conditions such as being able to reduce unnecessary blank areas that are close to the required size, etc. One rectangular unused area is selected, and the selected rectangular unused area is secured as a storage destination of two-dimensional data. As a result, it is no longer necessary to secure an unnecessarily large size area, and the problem of memory fragmentation (fragmentation) caused by securing the area (the memory area is divided due to scattering of the fragmented areas in the memory space). The problem that the utilization efficiency is reduced) can be made difficult to occur.
(5) (1)〜(4)のいずれか1項記載の動的メモリ管理方法であって、前記第1のステップと第2のステップの間で、前記2次元のメモリ領域の確保に伴う前記メモリ管理情報の更新を行う第3のステップと、前記第2のステップの後で、前記2次元のメモリ領域の解放に伴う前記メモリ管理情報の更新を行う第4のステップと、を有することを特徴とする動的メモリ管理方法。 (5) The dynamic memory management method according to any one of (1) to (4), wherein the two-dimensional memory area is secured between the first step and the second step. A third step of updating the memory management information; and a fourth step of updating the memory management information accompanying the release of the two-dimensional memory area after the second step. A dynamic memory management method characterized by the above.
この動的メモリ管理方法によれば、メモリ領域の確保の後、及び、メモリ領域の解放の後に、メモリ管理情報が更新される。したがって、メモリ管理情報により、メモリ空間の使用状況(未使用状況)をリアルタイムで把握することが可能となる。 According to this dynamic memory management method, the memory management information is updated after securing the memory area and after releasing the memory area. Therefore, it is possible to grasp the usage status (unused status) of the memory space in real time by the memory management information.
(6) (5)記載の動的メモリ管理方法であって、前記第3のステップは、前記2次元のメモリ領域が確保された後の、残余の未使用のメモリ領域に対して、新たに矩形領域を設定し直し、該設定された矩形領域の各々についての開始アドレスと水平及び垂直方向のサイズとの情報を前記テーブルに登録する処理であることを特徴とする動的メモリ管理方法。 (6) The dynamic memory management method according to (5), wherein the third step is newly performed on a remaining unused memory area after the two-dimensional memory area is secured. A dynamic memory management method, comprising: setting a rectangular area again, and registering information about a start address and horizontal and vertical sizes for each of the set rectangular areas in the table.
この動的メモリ管理方法によれば、メモリ空間における使用領域又は未使用領域では、矩形(四角形)領域毎に未使用領域(又は使用領域)を定義している。したがって、一つのメモリ領域が新規に確保された結果として、残余の未使用領域の形がいびつな多角形になってしまうと、そのままでは管理しにくいため、この場合には、残余の未使用のメモリ領域に対して、新たに扁平率の極力低い矩形領域を設定し直し、それらの矩形領域の各々についての定義情報を追加し、これによって、テーブルの内容を更新するようにしたものである。 According to this dynamic memory management method, in the used area or unused area in the memory space, an unused area (or used area) is defined for each rectangular (quadrangle) area. Therefore, as a result of newly securing one memory area, if the shape of the remaining unused area becomes an irregular polygon, it is difficult to manage as it is, so in this case, the remaining unused area A new rectangular area with the lowest flattening ratio is newly set for the memory area, definition information about each of the rectangular areas is added, and the contents of the table are thereby updated.
(7) (5)記載の動的メモリ管理方法であって、前記第4のステップは、解放されたメモリの矩形領域を、該矩形領域の周辺の未使用領域と結合することによって、より大きなサイズの矩形エリアを形成し、この結合によって新たに生じる大サイズの矩形領域に対し、その開始アドレスと、水平及び垂直方向のサイズとの情報を前記テーブルに登録する処理であることを特徴とする動的メモリ管理方法。 (7) The dynamic memory management method according to (5), wherein the fourth step is performed by combining a rectangular area of the released memory with an unused area around the rectangular area. This is a process for forming a rectangular area of a size and registering information on the start address and the size in the horizontal and vertical directions in the table for a large rectangular area newly generated by this combination. Dynamic memory management method.
この動的メモリ管理方法によれば、メモリ領域を解放する際、その解放する領域に隣接して未使用の領域が存在し、かつ、解放される領域とその未使用の隣接領域との結合によって、より大きなサイズの矩形領域を形成できるのであれば、そのような結合を実行し、メモリ管理情報であるテーブルには、その結合後の矩形領域についての定義情報を追加するようにしたものである。これによって、次に未使用領域をサーチする場合に、連続した未使用領域のサイズを簡単に把握できるようになり(つまり、小さな未使用領域毎に定義情報が管理されていると、それらが連続してどの程度のサイズの未使用領域を確保できるのかを、サーチ時にいちいち確認する必要が生じてサーチが面倒となる)、効率的な未使用領域のサーチが可能となる。 According to this dynamic memory management method, when a memory area is released, there is an unused area adjacent to the area to be released, and by combining the released area and the unused adjacent area. If a rectangular area of a larger size can be formed, such a combination is executed, and definition information about the combined rectangular area is added to the table that is the memory management information. . This makes it easy to grasp the size of consecutive unused areas the next time you search for unused areas (that is, if definition information is managed for each small unused area, they will be Thus, it is necessary to confirm at what time the size of the unused area can be ensured at the time of the search, and the search becomes troublesome), and an efficient search of the unused area becomes possible.
(8) (1)記載の動的メモリ管理方法であって、前記メモリ空間を、m画素×n画素(m,nは共に2以上の自然数)に対応する矩形領域を単位として分割し、それらの矩形領域の各々の使用状況を、各矩形領域を代表する代表ビットで表現し、該代表ビットを前記メモリ管理情報として使用することを特徴とする動的メモリ管理方法。 (8) The dynamic memory management method according to (1), wherein the memory space is divided in units of rectangular areas corresponding to m pixels × n pixels (m and n are natural numbers of 2 or more), and A dynamic memory management method characterized in that the usage status of each rectangular area is represented by a representative bit representing each rectangular area, and the representative bit is used as the memory management information.
この動的メモリ管理方法によれば、前述のテーブルの代わりに、実メモリ空間を表すビットマップ情報を使用してメモリ管理を行うものである。例えば、JPEG画像で採用されている8×8画素(合計64画素)ブロックを単位として、このブロック中の1画素でも使用中であるならば、そのブロックを代表するビットを、使用中を示す“1”に設定する(この場合“0”は未使用を示すことになる)。このようにすれば、ビットマップの“1”,“0”の配列をチェックするだけで、どのようなサイズの未使用領域がどこに存在するのか、未使用領域がどの程度、連続して存在するのか、といった情報を簡単に取得することが可能となる。したがって、効率的な未使用領域のサーチが可能となる。 According to this dynamic memory management method, memory management is performed using bitmap information representing a real memory space instead of the above-described table. For example, if an 8 × 8 pixel block (total of 64 pixels) employed in a JPEG image is used as a unit and even one pixel in this block is in use, a bit representing that block is used. Set to “1” (in this case “0” indicates unused). In this way, by simply checking the array of “1” and “0” in the bitmap, what size of unused area exists, where is the unused area, and how much unused area exists. It becomes possible to easily acquire information such as. Therefore, it is possible to search for an unused area efficiently.
(9) (8)記載の動的メモリ管理方法であって、前記メモリ管理情報を参照して未使用領域を検索し、必要なメモリ領域を確保するに際し、前記メモリ空間上において前記第1走査方向に検索する第1検索ステップと、前記第1走査方向に必要サイズの未使用の部分があった場合に、前記第2走査方向に検索して必要サイズの未使用の部分があるかを検索する第2検索ステップと、前記第2検索ステップによって、必要サイズ以上の矩形状の未使用領域を検出した場合に、この検出した矩形状の未使用領域を前記2次元データの格納先として確保する格納先設定ステップと、を有することを特徴とする動的メモリ管理方法。 (9) The dynamic memory management method according to (8), wherein when the unused area is searched with reference to the memory management information and a necessary memory area is secured, the first scan is performed on the memory space. A first search step for searching in the direction, and if there is an unused portion of the required size in the first scanning direction, search in the second scanning direction to search for an unused portion of the required size When a rectangular unused area larger than the required size is detected by the second search step and the second search step, the detected rectangular unused area is secured as a storage destination for the two-dimensional data. And a storage destination setting step.
この動的メモリ管理方法によれば、複数画素を一単位とするビットマップを使用して未使用領域をサーチする際に、ビットマップ上の所定の場所から所定の方向に順番にサーチしていき、必要なサイズをもつ矩形状の未使用領域を、データの格納先のメモリ領域として確保する。これにより、高速なサーチが可能となる。 According to this dynamic memory management method, when an unused area is searched using a bitmap having a plurality of pixels as a unit, the search is sequentially performed from a predetermined location on the bitmap in a predetermined direction. A rectangular unused area having a required size is secured as a memory area for storing data. Thereby, a high-speed search becomes possible.
(10) (1)〜(9)のいずれか1項記載の動的メモリ管理方法を実施するメモリ管理装置であって、前記メモリ管理情報を具備し、前記第1及び第2のステップを実施するメモリ領域確保・解放部を有することを特徴とするメモリ管理装置。 (10) A memory management device that implements the dynamic memory management method according to any one of (1) to (9), comprising the memory management information, and performing the first and second steps. A memory management device comprising a memory area securing / releasing unit that performs the processing.
このメモリ管理装置によれば、共通のメモリ空間において、多様なサイズの2次元のデータ(1次元のデータを含む)を自由に確保し、また、不要となったメモリ領域を解放する、という動的管理方法を実施できるメモリ管理装置が実現される。このメモリ管理装置によれば、無駄の少ないメモリ利用が可能となるため、小型化、軽量化、低コスト化が厳しく要求される電子機器におけるメモリ関連の問題の解決に貢献する。 According to this memory management device, two-dimensional data (including one-dimensional data) of various sizes can be freely secured in a common memory space, and a memory area that is no longer needed is released. A memory management device capable of performing a general management method is realized. According to this memory management device, it is possible to use a memory with little waste, and this contributes to solving a memory-related problem in an electronic device that is strictly required to be reduced in size, weight, and cost.
(11) (10)記載のメモリ管理装置と、前記メモリ空間を提供する少なくとも一つのメモリと、を有することを特徴とする電子機器。 (11) An electronic apparatus comprising: the memory management device according to (10); and at least one memory that provides the memory space.
この電子機器によれば、小型化、軽量化、低コスト化が厳しく要求される電子機器においても、非常に効率的なメモリ利用が可能となる。 According to this electronic device, it is possible to use a very efficient memory even in an electronic device that is strictly required to be small in size, light in weight, and low in cost.
(12) 固体撮像素子と、被写体像を前記固体撮像素子に結像する光学系と、前記固体撮像素子から出力されてくる信号を処理し画像データを生成する信号処理部と、この生成された画像を表示する表示部と、を備えた撮像装置であって、前記画像データの生成の際に使用されるメモリと、前記メモリを管理する(10)項記載のメモリ管理装置と、を備えたことを特徴とする撮像装置。 (12) A solid-state imaging device, an optical system that forms a subject image on the solid-state imaging device, a signal processing unit that processes a signal output from the solid-state imaging device and generates image data, and the generated An image pickup apparatus comprising: a display unit that displays an image; and a memory used when generating the image data; and a memory management device according to (10) that manages the memory An imaging apparatus characterized by that.
この撮像装置によれば、小型化、軽量化、低コスト化が厳しく要求されても、非常に効率的なメモリ利用が可能となる。また、共通のメモリ空間を有効利用して、多様なサイズのデータを効率的に処理することが可能となり、撮像装置の高性能化、多機能化が促進される。また、CCD等のイメージセンサから出力される一行分のラインデータは、メモリ空間上において、他の行にまたがって記憶されることがなく、その画像データの縦横の関係がそのまま保たれたまま記憶されることになる。したがって、一行のラインデータの読み出しの途中で遅延が生じるのを防止でき、また、矩形状の画像データの縦と横の関係がそのまま維持されてメモリ空間に格納されるため、画像処理回路等は、その画像データをそのまま読み出して、すぐに処理、加工を行うことができ、画像の処理、加工に伴う余計な負担が生じることもなく、効率的な画像データの処理が実現される。 According to this imaging apparatus, even when miniaturization, weight reduction, and cost reduction are strictly demanded, it is possible to use the memory very efficiently. In addition, it is possible to efficiently process data of various sizes by effectively using a common memory space, and the performance and functionality of the imaging apparatus are promoted. In addition, line data for one line output from an image sensor such as a CCD is not stored across other lines in the memory space, and is stored while maintaining the vertical and horizontal relationship of the image data. Will be. Therefore, it is possible to prevent a delay from occurring during the reading of one line of line data, and the rectangular image data is stored in the memory space while maintaining the vertical and horizontal relationship as it is. The image data can be read as it is, and can be processed and processed immediately, and an efficient processing of the image data can be realized without causing an extra burden accompanying the processing and processing of the image.
本発明によって、メモリ空間における使用領域・未使用領域をメモリ管理情報によって管理し、このメモリ情報を適宜、参照することによって、共通のメモリ空間において、多様なサイズの2次元のデータ(1次元のデータを含む)を自由に確保し、また、不要となったメモリ領域を解放することが可能な、メモリの動的管理方法を実現することができる。 According to the present invention, the used / unused areas in the memory space are managed by the memory management information, and the memory information is referred to as appropriate, so that two-dimensional data (one-dimensional (Including data) can be freely secured, and a memory dynamic management method capable of releasing a memory area that has become unnecessary can be realized.
また、本発明のメモリ管理装置によって、共通のメモリ空間において、多様なサイズの2次元のデータ(1次元のデータを含む)を自由に確保し、また、不要となったメモリ領域を解放する、という動的管理方法を実施可能となる。このメモリ管理装置は、無駄の少ないメモリ利用を可能とし、したがって、小型化、軽量化、低コスト化が厳しく要求される電子機器におけるメモリ関連の問題の解決に貢献する。 Further, the memory management device of the present invention can freely secure two-dimensional data (including one-dimensional data) of various sizes in a common memory space, and free a memory area that is no longer needed. The dynamic management method can be implemented. This memory management device enables use of memory with little waste, and thus contributes to solving memory-related problems in electronic devices that are strictly required to be downsized, lightened, and reduced in cost.
また、本発明は、小型化、軽量化、低コスト化が厳しく要求される電子機器、また、撮像装置においても、非常に効率的なメモリ利用を可能とするという効果を奏する。 In addition, the present invention has an effect of enabling very efficient use of a memory even in an electronic apparatus and an imaging apparatus that are strictly required to be reduced in size, weight, and cost.
以下、本発明の動的メモリ管理方法の実施形態について、図面を参照して具体的に説明する。以下の実施形態では、電子機器の一例として電子スチルカメラを説明するがこれに限定されることはない。
(第1の実施形態)
Embodiments of the dynamic memory management method of the present invention will be specifically described below with reference to the drawings. In the following embodiments, an electronic still camera will be described as an example of an electronic device, but the present invention is not limited to this.
(First embodiment)
図1は、本発明の撮像装置(電子スチルカメラ)の構成の一例を示すブロック図である。
図示されるように、この撮像装置は、レンズ10、レンズ駆動部11を備えた光学系と、撮像装置の動作を統括的に制御するCPU12と、システムメモリ13と、タイミングジェネレータ26と、固体撮像素子であるCCD31と、表示部としてのLCDディスプレイ32と、AF回路36と、AE/AWB回路37と、アナログ信号処理回路(CDS/AGC/ADC)38と、メモリカード49と、DSP(DigitalSignal Processor)100(画像入力インタフェース42,画像処理回路43,圧縮・伸長処理回路44,メディアコントローラ46,ビデオエンコーダ47,システムバス55を備える信号処理部)と、メモリ110と、メモリ管理装置120(メモリ領域確保・解放部122と、管理情報124とを備える)と、を有している。
FIG. 1 is a block diagram showing an example of the configuration of an imaging apparatus (electronic still camera) according to the present invention.
As shown in the figure, this imaging apparatus includes an optical system including a
CCDイメージセンサ31から取り込まれたアナログの撮像信号は、アナログ信号処理回路38に入力される。
An analog imaging signal captured from the
アナログ信号処理回路38は、相関2重サンプリング回路(CDS)と、オートゲインコントローラ(AGC)と、ADコンバータ(ADC)とからなる。CDSは、アナログ信号のノイズを除去し、AGCはアナログ信号のゲインを自動調節する。ADCは、アナログ信号をデジタル変換して画像データを生成する。
The analog
この画像データは、各画素毎にR,G,Bの濃度値を持つCCD−RAWデータ(CCDラインセンサから出力される1行分の撮像データ)であり、このCCD−RAWデータがDSP100に入力される。アナログ信号処理回路38にも、タイミングジェネレータ26からのタイミング信号が供給され、CCDイメージセンサ31から電荷が取り込みまれるタイミングと同期が取られている。
This image data is CCD-RAW data (image data for one row output from the CCD line sensor) having R, G, and B density values for each pixel, and this CCD-RAW data is input to the
DSP100は、AF回路36,AE/AWB回路37,画像入力インターフェース42,画像処理回路43,圧縮・伸長処理回路44,メディアコントローラ46,ビデオエンコーダ47からなるICチップであり、アナログ信号処理回路38から入力された画像データに対して、各種の信号処理を施した後、画像のLCDディスプレイ32への表示や画像データのメモリーカードへの書き込み処理を行う。
The
なお、AF回路36は、CCDイメージセンサ31によって撮像された画像データに基づいて、焦点位置を検出し、フォーカシングを行う。焦点検出方式としては、例えば、ピントが合った状態では画像のコントラストが高くなるという特徴を利用して合焦位置を検出するパッシブ方式が採用されている。
The
AE回路37は、画像データに基づいて、被写体輝度を測定し、絞り値やシャッタ速度等を決定する。同じくAWB回路37は、オートホワイトバランス回路であり、撮影時のホワイトバランスを自動調整する。
The
画像入力インタフェース42は、アナログ信号処理回路38からCCD−RAWデータを取り込み、これをメモリ110に書き込む。
The
また、画像処理回路43は、例えば、歪み補正、YC分離、縮小ズーム、画像回転、ポストフィルタ処理、JPEG圧縮、垂直方向の拡大といった各種の画像処理を行い、各々の処理に際し、適宜、メモリ110を利用する。
In addition, the
また、圧縮・伸長処理回路44は、画像入力インタフェース42からの画像データを適宜、圧縮し、また、画像処理回路43による各種の画像処理後の画像データを、必要に応じて圧縮し、その圧縮されたデータをメモリ110に書き込む。伸長処理の際も、圧縮の場合と同様に、メモリ110が利用される。
The compression /
メモリ110は、共有のメモリ空間を提供するDRAM等のLSIである。図1では、一つのメモリだけが記載されているが、複数のICを組み合わせて一つのメモリ空間を構成してもよい。
The
メモリ110によって提供されるメモリ空間は、多目的に使用される共有のメモリ空間であり、画像の一時保管に使用でき、また、各種の処理に伴う中間作業領域としても利用可能であり、あるいは、表示画像データを蓄積するフレームメモリとして使用することもできる。
The memory space provided by the
メモリ管理装置120は、本発明のシンプルかつローコストの構成にて、無駄の少ない効率的な動的メモリ管理を実現する部分である。メモリ領域確保・解放部122は、メモリ110により提供される共有のメモリ空間内には、1次元、2次元の画像データ(画像データ以外でもよい)を自由に格納することができる。
The
また、管理情報124は、メモリ110の共有メモリ空間の使用状況を常時管理すると共に、メモリ使用要求元(画像入力インタフェース42、画像処理回路43、圧縮・伸長回路44)からのメモリ使用要求(データサイズの通知を含む)を受け、そのデータサイズに基づいて、必要なサイズの格納先のメモリ領域を確保し、確保されたメモリ領域の先頭アドレスを要求元に返信する、という一連の動作を行う(この点は、図2を用いて説明する)。
The
図2は、図1のメモリ管理部の機能と、メモリ使用要求元の回路とメモリ管理部との間の情報授受の手順を説明するためのブロック図である。図2において、図1と共通する部分には同じ参照符号を付してある。 FIG. 2 is a block diagram for explaining the function of the memory management unit of FIG. 1 and the procedure for exchanging information between the memory use request source circuit and the memory management unit. In FIG. 2, the same reference numerals are given to the portions common to FIG.
図2に示されるように、メモリ110は、1次元のデータ、2次元のデータを問わず、また、その目的を問わず、多様なサイズの多様な目的のデータを自由に格納することができるメモリ(例えば、C言語においてはmalloc関数によりメモリ領域を確保し、そのメモリ領域をfree関数により解放する2次元のヒープメモリ)である。図示されるように、このメモリ110が提供する共有のメモリ空間には、一次元のデータを格納している領域112a、2次元の画像データを格納している領域112bが確保されている。図中、領域112は、メモリ使用要求元からのメモリ使用要求に応じて、新たに確保される領域である。
As shown in FIG. 2, the
先に説明したように、本発明のメモリ管理装置120には、メモリ領域確保・解放部122が設けられており、このメモリ領域確保・解放部122は、メモリ110の使用状況を監視して管理情報124を随時、更新する。
As described above, the
また、メモリ領域確保・解放部122は、メモリ使用要求元(図2の左側に示される、画像入力インタフェース42、画像処理回路43、圧縮・伸長処理回路44)からメモリ110の使用要求(データのサイズ情報を含む)を受けると(ステップP1)、管理情報124を参照しつつ、メモリ110の共有メモリ空間において、必要サイズ以上の大きさの未使用領域を検索し、そのデータを格納するためのメモリ領域(ここでは、領域112c)を確保する。
Further, the memory area securing / releasing
そして、メモリ領域確保・解放部122は、確保したそのデータの格納先アドレス(つまり、メモリ領域112cの先頭アドレスとサイズ等の情報)を、メモリ使用要求元の回路(ここでは、画像入力インタフェース42とする)に返信する(ステップP2)。
Then, the memory area securing / releasing
次に、画像入力インタフェース42は、メモリ110にアクセスして(ステップP3)、確保されたメモリ領域112cを自由に使用して所望の処理を行い、メモリ使用が終了すると、メモリ領域112cの解放指示をメモリ領域確保・解放部122に発出する(ステップP4)。
Next, the
次に、図3〜図7を用いて、メモリ領域確保・解放部122によるメモリ領域の確保と解放の手順について説明する。以下の例では、管理情報124として、未使用領域テーブルを使用するものとする。
Next, a procedure for securing and releasing a memory area by the memory area securing / releasing
図3は、管理情報としての未使用領域テーブルの内容の一例を示す図である。 FIG. 3 is a diagram illustrating an example of the contents of an unused area table as management information.
図示されるように、未使用領域テーブル125は、メモリ110内の未使用領域を、複数の矩形領域毎に管理するテーブルであり、各矩形領域に番号を付し、そして、各矩形領域を、スタートアドレス、Xサイズ(水平方向のサイズ)、Yサイズ(垂直方向のサイズ)によって定義している。
As shown in the figure, the unused area table 125 is a table for managing unused areas in the
図4(a),(b)は、メモリ領域確保・解放部による、必要なサイズのメモリ領域確保のための検索(サーチ)の概要を説明するための図である。 FIGS. 4A and 4B are diagrams for explaining an outline of search (search) for securing a memory area of a necessary size by the memory area securing / releasing unit.
図4(a)に示すように、まず、メモリ110内において、縦方向(第1の方向)にサーチを進める(手順FS)。 As shown in FIG. 4A, first, the search is advanced in the vertical direction (first direction) in the memory 110 (procedure FS).
そして、縦方向に必要なサイズの未使用領域が見つかると、図4(b)に示すように、その未使用領域の開始アドレスPxを起点として、横方向(第2の方向)にサーチを行い(手順SS)、必要なサイズの領域が横方向にも確保できるかを確認する。なお、図中、Pyは、横方向のサーチの結果として得られた未使用領域の終端のアドレスを示す。 When an unused area of the required size in the vertical direction is found, a search is performed in the horizontal direction (second direction) starting from the start address Px of the unused area as shown in FIG. 4B. (Procedure SS), it is confirmed whether a necessary size area can be secured in the horizontal direction. In the drawing, Py indicates the address of the end of the unused area obtained as a result of the horizontal search.
なお、発見された未使用領域を、データ格納先として選択する方法としては二通りの方法がある。一つは、最初に発見された未使用領域を確保対象とする方法であり(高速サーチが可能)、他の一つは、複数の候補の中から、必要サイズに近くかつメモリ断片化を極力抑制できるという条件の下で、適切な一つの領域を選択する方法である。 There are two methods for selecting a discovered unused area as a data storage destination. One is to secure the first unused area that is found (high-speed search is possible), and the other one is close to the required size from among multiple candidates and minimizes memory fragmentation as much as possible. This is a method of selecting an appropriate region under the condition that it can be suppressed.
図5(a),(b)は、必要なサイズのメモリ領域を確保する場合の具体例を説明するための図である。 FIGS. 5A and 5B are diagrams for explaining a specific example when a memory area of a necessary size is secured.
図5(b)に示すように、格納するデータの水平方向のサイズはxであり、垂直方向のサイズはyである。 As shown in FIG. 5B, the horizontal size of data to be stored is x, and the vertical size is y.
図5(a)において、DT1〜DT3ならびにDT5は使用中の領域であり、BL0〜BL3は、未使用の領域である。点線で示されるDT4は、今回のサーチの結果として新たに確保される領域である。新たに確保される領域DT4は、以下のようなサーチを経て決定される。 In FIG. 5A, DT1 to DT3 and DT5 are used areas, and BL0 to BL3 are unused areas. DT4 indicated by a dotted line is an area newly secured as a result of the current search. The newly secured area DT4 is determined through the following search.
まず、座標P0から縦方向にサーチを開始する。P1〜P2において、必要な縦方向のサイズは確保できるから、次に、P1を起点として横方向にサーチを進める。ここで、P1〜P3までのサイズは必要なサイズに達しないから、未使用領域BL2には、格納先のメモリ領域を確保できないことが判明する。同様にサーチを進めると、P4〜P5の縦方向のサイズは必要サイズを満たすが、P4〜P6の横方向のサイズは必要サイズを満たさないことから、未使用領域BL0にも格納先のメモリ領域を確保できないことがわかる。結果的に、未使用領域BL3にて、必要なサイズの格納先領域(DT4)を確保することができることが判明する。 First, a search is started in the vertical direction from the coordinate P0. Since the required vertical size can be secured in P1 and P2, next, the search is advanced in the horizontal direction starting from P1. Here, since the sizes from P1 to P3 do not reach the required size, it is found that the storage area memory area cannot be secured in the unused area BL2. Similarly, if the search is advanced, the vertical size of P4 to P5 satisfies the required size, but the horizontal size of P4 to P6 does not satisfy the required size. It can be seen that cannot be secured. As a result, it is found that the storage area (DT4) having a necessary size can be secured in the unused area BL3.
そこで、未使用領域BL3において、必要最小限のサイズの領域DT4を、使用中の領域DT3に密着させて隙間が生じないようにして、確保することになる。 Therefore, in the unused area BL3, the area DT4 having the minimum necessary size is secured in close contact with the area DT3 in use so that no gap is generated.
次に、メモリ領域確保後のメモリ管理情報の更新(特に、未使用ブロックの再設定)について説明する。 Next, update of the memory management information after the memory area is secured (especially, resetting of unused blocks) will be described.
図6(a)〜(c)は、メモリ領域確保後のメモリ管理情報の更新(未使用ブロックの再設定)の手順について説明するため図である。 FIGS. 6A to 6C are diagrams for explaining a procedure for updating memory management information (resetting unused blocks) after securing a memory area.
図6(a)は、新たなメモリ領域が確保される前の状態を示す。図中、DT6〜DT8は使用中の矩形ブロックであり、BL5〜BL6は、未使用の矩形ブロックである。。 FIG. 6A shows a state before a new memory area is secured. In the figure, DT6 to DT8 are rectangular blocks in use, and BL5 to BL6 are unused rectangular blocks. .
図6(b)では、新たにメモリ領域DT9が確保される。この結果、未使用のブロックBL6は、歪んだ多角形になってしまう。 In FIG. 6B, a new memory area DT9 is secured. As a result, the unused block BL6 becomes a distorted polygon.
そこで、図6(c)に示すように、より大きなサイズの矩形ブロックを設けるという視点に立って、矩形ブロック(BL7〜BL9)を再設定する。そして、再設定された(BL7〜BL9)の定義情報を、図3に示される未使用領域テーブル125に追加して、テーブル(すなわち、メモリ管理情報124)の更新を行う。 Therefore, as shown in FIG. 6C, the rectangular blocks (BL7 to BL9) are reset from the viewpoint of providing a rectangular block having a larger size. Then, the redefined definition information of (BL7 to BL9) is added to the unused area table 125 shown in FIG. 3, and the table (that is, the memory management information 124) is updated.
次に、メモリ領域の確保、確保後の矩形ブロックの再設定、メモリ領域の解放、メモリ領域解放後のメモリ管理情報の更新処理(隣接する未使用ブロック同士の結合処理を含む)の一連の処理について説明する。 Next, a series of processes for securing the memory area, resetting the rectangular block after securing, releasing the memory area, and updating the memory management information after releasing the memory area (including the process of joining adjacent unused blocks) Will be described.
図7(a)〜(e)は、メモリ領域の確保、確保後の矩形ブロックの再設定、メモリ領域の解放ならびにメモリ領域解放後のメモリ管理情報の更新処理(隣接する未使用ブロック同士の結合処理を含む)の一連の処理について説明する。 FIGS. 7A to 7E show how to secure a memory area, reset a rectangular block after securing, release the memory area, and update the memory management information after releasing the memory area (joining adjacent unused blocks together) A series of processing (including processing) will be described.
図7(a)に示すように、初期状態では、メモリ110(が提供するメモリ空間)は完全に未使用状態であり、全面が未使用領域BL0となっている。 As shown in FIG. 7A, in the initial state, the memory 110 (the memory space provided by the memory 110) is completely unused, and the entire surface is an unused area BL0.
次に、図7(b)に示すように、メモリ領域DT1が確保され、この結果、未使用領域の矩形ブロックBL2,BL3が再設定され、これに伴い、メモリ管理情報124(未使用領域テーブル125)が更新される。 Next, as shown in FIG. 7B, the memory area DT1 is secured. As a result, the rectangular blocks BL2 and BL3 of the unused area are reset, and the memory management information 124 (unused area table) is set accordingly. 125) is updated.
次に、図7(c)に示すように、メモリ領域DT2が確保され、この結果、未使用領域の矩形ブロックBL3,BL4が再設定され、これに伴い、メモリ管理情報124(未使用領域テーブル125)が更新される。 Next, as shown in FIG. 7C, the memory area DT2 is secured, and as a result, the rectangular blocks BL3 and BL4 of the unused area are reset, and accordingly, the memory management information 124 (unused area table) 125) is updated.
次に、図7(d)に示すように、メモリ領域DT2が解放される。ここで、注目すべき点は、解放された領域DT2に隣接して、未使用の矩形ブロックBL3とBL4が存在し、これらを相互に結合すれば、扁平率が低く、より大きな未使用の矩形ブロックを生成することができる点である。より大きな未使用の矩形ブロックを生成し、そのブロックを単位としてメモリの未使用状況を管理できれば、空き領域のサイズを簡単に把握することができ、以後の未使用領域のサーチが効率化される。 Next, as shown in FIG. 7D, the memory area DT2 is released. Here, it should be noted that there are unused rectangular blocks BL3 and BL4 adjacent to the released area DT2, and if these are connected to each other, the flatness is low, and a larger unused rectangle. The block can be generated. If a larger unused rectangular block is generated and the unused status of the memory can be managed in units of the block, the size of the free area can be easily grasped, and the subsequent search for the unused area becomes efficient. .
そこで、図7(e)に示すように、解放された領域DT2と、未使用の矩形ブロックBL3、BL4と、を結合してより大きな未使用の矩形ブロックBL5を生成し、これに伴い、メモリ管理情報124(未使用領域テーブル125)が更新される。 Therefore, as shown in FIG. 7E, the released area DT2 and the unused rectangular blocks BL3 and BL4 are combined to generate a larger unused rectangular block BL5. The management information 124 (unused area table 125) is updated.
以上説明した、新たなメモリ領域の確保までの手順をまとめると、図8のようになる。図8は、新たなメモリ領域の確保までの手順の概要を示すフロー図である。 The procedure up to securing a new memory area as described above is summarized as shown in FIG. FIG. 8 is a flowchart showing an outline of a procedure up to securing a new memory area.
すなわち、メモリ領域確保・解放部122は、未使用領域テーブル124を作成してメモリ空間の管理を開始し(ステップ10、以降はS10と略記する)、メモリ使用要求元から、メモリ確保要求があると(S11)、要求元からの、格納するデータのサイズ(xサイズ,yサイズ)の情報を受け取る(S12)。
That is, the memory area securing / releasing
そして、メモリ領域確保・解放部122が、未使用領域テーブル124を検索し、メモリ110が提供する共有メモリ空間内に、x,yの各サイズを満たす未使用領域が存在するかを検索(サーチ)する(S13)。
Then, the memory area securing / releasing
サーチの結果、最初に発見された領域を格納先のメモリ領域として決定してもよく、また、複数の候補を抽出し(S14)、その中から、必要サイズに近くかつメモリ断片化を抑制できるという条件の下で絞り込みを行ってもよく、これらの処理を経て、データ格納先のメモリ領域が確保される(S15)。 As a result of the search, an area that is found first may be determined as the memory area of the storage destination, and a plurality of candidates are extracted (S14), from which the required size is close and memory fragmentation can be suppressed. Narrowing may be performed under the above conditions, and through these processes, a memory area of a data storage destination is secured (S15).
そして、新たにメモリ領域が確保された後の未使用領域について、矩形ブロックを再設定し(S16)、未使用領域テーブルを更新し(S17)、確保したメモリ領域の先頭アドレスを要求元に通知する(S18)。 Then, a rectangular block is reset for the unused area after the new memory area is secured (S16), the unused area table is updated (S17), and the start address of the secured memory area is notified to the request source. (S18).
また、メモリ領域の解放の手順をまとめると、図9のようになる。図9は、メモリ領域の解放手順の概要を示す図である。 Also, the procedure for releasing the memory area is summarized as shown in FIG. FIG. 9 is a diagram showing an outline of a memory area release procedure.
まず、メモリ使用要求元から、解放指示と共に解放対象のメモリ領域を特定するための情報(先頭アドレス、x,yサイズ)が入力される(S20)。 First, information (head address, x, y size) for specifying a memory area to be released is input together with a release instruction from a memory use request source (S20).
メモリ領域確保・解放部122は、指定されたメモリ領域の解放を実施する(S21)。
The memory area securing /
次に、解放された領域に隣接して、空き領域が存在する場合には、それらの空き領域同士を結合してさらに大きな空き領域の矩形ブロックを形成できないかを検討し(S22)、そのような矩形ブロックの形成が可能ならば、空き領域同士を結合する(S23)。 Next, if there is an empty area adjacent to the released area, it is examined whether the empty areas can be combined to form a rectangular block with a larger empty area (S22). If a simple rectangular block can be formed, the empty areas are combined (S23).
そして、メモリ領域確保・解放部122は、未使用領域テーブル125(すなわち、メモリ管理情報124)を更新する(S24)。
Then, the memory area securing / releasing
このように、本実施形態のメモリ管理方法ならびにメモリ管理装置では、メモリ空間における使用領域・未使用領域をメモリ管理情報によって管理し、このメモリ情報を適宜、参照することによって、共通のメモリ空間において、多様なサイズの2次元のデータ(1次元のデータを含む)を自由に確保し、また、不要となったメモリ領域を解放することが可能な、メモリの動的管理方法を実現することが可能となる。 As described above, in the memory management method and the memory management device according to the present embodiment, the used / unused areas in the memory space are managed by the memory management information, and the memory information is referred to as appropriate, so that the common memory space can be used. It is possible to realize a dynamic memory management method that can freely secure two-dimensional data (including one-dimensional data) of various sizes and free a memory area that is no longer needed. It becomes possible.
本発明で用意されるメモリ空間は、従来技術に見られるようなラインメモリの集合体ではなく、多目的に、制限なく使用可能な一つのメモリ空間であるため、イメージセンサからの1行分のラインデータだけでなく、他のあらゆる形式のデータ(2次元、1次元を問わない)をそのメモリ空間に格納することができ、必要なサイズのメモリ領域を必要なときに確保し、また、不要となったメモリ領域は解放して再利用を可能とすることができ、メモリの無駄を省き、効率的なメモリ利用が可能となる。 The memory space prepared in the present invention is not a collection of line memories as found in the prior art, but is a single memory space that can be used without limitation for multiple purposes. Not only data, but all other types of data (whether two-dimensional or one-dimensional) can be stored in the memory space, and a memory area of the required size is secured when necessary. The memory area that has become available can be released and reused, and the memory is wasted and the memory can be used efficiently.
また、矩形状の画像データのブロックの矩形状を維持したまま、その画像データをそのまま格納できる矩形状のメモリ領域を確保することによって、一行分のラインデータは必ず一行のメモリ領域に確保でき、一行のラインデータの読み出しの途中で遅延が生じるのを防止できる。また、画像処理回路等は、その画像データをそのまま読み出して、すぐに処理、加工を行うことができ、画像の処理、加工に伴う余計な負担が生じることを防止することができる。 In addition, by securing a rectangular memory area that can store the image data as it is while maintaining the rectangular shape of the rectangular image data block, one line of line data can always be secured in one memory area, It is possible to prevent a delay from occurring during the reading of one line of line data. Further, the image processing circuit or the like can read out the image data as it is and immediately process and process the image data, thereby preventing an extra burden associated with image processing and processing.
また、未使用領域テーブル(使用領域テーブルでもよい)を用意し、そのテーブルにおいて、矩形領域(矩形ブロック)毎に、開始アドレスと、横方向のサイズならびに縦方向のサイズを定義することによって、メモリ空間上に、どのようなサイズの矩形ブロックがどの位置にあるのかをすぐに検索することができるようになる。また、メモリ領域の確保や解放に伴い、メモリ管理情報は適宜、更新することによって、そのテーブルによって、メモリ空間の使用(未使用)状況をリアルタイムで管理することが可能となる。 In addition, an unused area table (which may be a used area table) is prepared, and by defining a start address, a horizontal size, and a vertical size for each rectangular area (rectangular block) in the table, the memory It becomes possible to immediately search what size rectangular block is in which position in the space. In addition, by appropriately updating the memory management information as the memory area is secured or released, it is possible to manage the use (unused) status of the memory space in real time by using the table.
また、必要なサイズの矩形領域をメモリ空間上に確保する際、メモリ空間上を所定の場所から所定の方向に順番にサーチしていき、最初に発見できた、必要なサイズをもつ矩形状の未使用領域を、データの格納先のメモリ領域として確保するサーチ方法を採用することによって、高速なサーチが可能となる。 In addition, when securing a rectangular area of the required size in the memory space, the memory space is searched in order from a predetermined location in a predetermined direction, and the rectangular shape having the required size that was found first can be found. By adopting a search method that secures an unused area as a memory area for storing data, a high-speed search becomes possible.
また、メモリ空間上において、必要サイズ以上のサイズをもつ未使用領域の候補を複数、抽出し、その中から、そのサイズが必要サイズに近く、かつ、無駄な余白を抑制できるという条件の下で一つの矩形領域を選択し、確保するサーチ方法を採用することによって、無駄に大きなサイズの領域を確保することがなくなり、また、その領域を確保したことによって生じるメモリの断片化の問題を、生じにくくすることができる。 In addition, a plurality of unused area candidates having a size larger than the required size are extracted from the memory space, and the size is close to the required size and wasteful margins can be suppressed. By adopting a search method that selects and secures one rectangular area, it is possible to avoid unnecessarily securing an area of a large size and to cause the problem of memory fragmentation caused by securing the area. Can be difficult.
また、メモリ領域の確保の後、及び、メモリ領域の解放の後に、メモリ管理情報を更新することにより、そのメモリ管理情報を参照して、メモリ空間の使用状況(未使用状況)をリアルタイムで把握することが可能となる。 Also, after the memory area is secured and after the memory area is released, the memory management information is updated so that the memory space usage status (unused status) can be grasped in real time by referring to the memory management information. It becomes possible to do.
また、一つのメモリ領域が新規に確保されると、残余の未使用のメモリ領域について、新たに矩形領域を設定し直し、それらの矩形領域の各々についての定義情報を追加してテーブルの内容を更新することにより、メモリ管理情報としてのテーブル(矩形ブロックを単位としてメモリ領域を管理する形式のテーブル)を、常に最新の状態に保つことができる。 In addition, when a new memory area is newly allocated, a new rectangular area is newly set for the remaining unused memory area, and the definition information for each of the rectangular areas is added to change the contents of the table. By updating, the table as the memory management information (the table in the format for managing the memory area in units of rectangular blocks) can always be kept up-to-date.
また、メモリ領域を解放する際、その解放する領域に隣接して未使用の領域が存在し、かつ、解放される領域とその未使用の隣接領域との結合によって、より大きなサイズの矩形領域を形成できるのであれば、そのような結合を実行し、その結合をテーブル内容に反映させることによって、連続した未使用領域のサイズを簡単に把握できるようになり、効率的な未使用領域のサーチが可能となる。
(第2の実施形態)
In addition, when a memory area is released, there is an unused area adjacent to the area to be released, and a larger-sized rectangular area is formed by combining the released area and the unused adjacent area. If it can be formed, by executing such a join and reflecting the join in the table contents, it becomes possible to easily grasp the size of continuous unused areas, and an efficient search for unused areas can be performed. It becomes possible.
(Second Embodiment)
次に、本発明に係る動的メモリ管理方法の第2実施形態を説明する。
本実施形態では、メモリ管理情報として、テーブルではなくビットマップを使用する例について説明する。その他の点については、第1の実施形態と同じであるため、説明は省略する。
Next, a second embodiment of the dynamic memory management method according to the present invention will be described.
In the present embodiment, an example in which a bitmap is used as memory management information instead of a table will be described. Since the other points are the same as those in the first embodiment, description thereof is omitted.
図10(a),(b)は、メモリ管理情報としてのビットマップの生成方法を説明するための図である。 FIGS. 10A and 10B are diagrams for explaining a method of generating a bitmap as memory management information.
すなわち、図10(a)に示されるように、メモリ110を、m画素×n画素(m,nは共に2以上の自然数で、図示されるのは8画素×8画素の場合である)の矩形領域を単位として分割する。
That is, as shown in FIG. 10A, the
そして、図10(b)に示すように、分割された矩形領域の各々の使用/未使用を、各矩形領域を代表する代表ビットで表現し、これによって実メモリ空間を投影するビットマップ126を形成し、そのビットマップ126をメモリ管理情報124として使用する。
Then, as shown in FIG. 10B, the use / unuse of each of the divided rectangular areas is represented by representative bits representing each rectangular area, and thereby a
すなわち、図10(a),(b)では、8×8画素(合計64画素)のブロックを単位として、このブロック中の1画素でも使用中であるならば、そのブロックを代表するビットを、使用中を示す“1”に設定し、未使用の場合は“0”を設定する。このようにすれば、ビットマップの“1”,“0”の配列をチェックするだけで、どのようなサイズの未使用領域がどこに存在するのか、未使用領域がどの程度、連続して存在するのか、といった情報を簡単に取得することが可能となる。したがって、効率的な未使用領域のサーチが可能となる。 That is, in FIGS. 10A and 10B, if a block of 8 × 8 pixels (64 pixels in total) is used and even one pixel in this block is in use, a bit representing that block is Set to “1”, indicating that it is in use, and “0” if it is not used. In this way, just by checking the arrangement of “1” and “0” in the bitmap, what size of unused area exists, where is the unused area, and how many unused areas exist continuously. It becomes possible to easily acquire information such as. Therefore, it is possible to search for an unused area efficiently.
なお、8×8(合計64画素)のブロックは、画像圧縮のためのJPEG規格でも標準的に採用されているもので、実画像に即したブロックサイズとなり、画素対応がとりやすくなる。 Note that the 8 × 8 (64 pixels in total) block is also standardly adopted in the JPEG standard for image compression, has a block size that matches the actual image, and facilitates pixel correspondence.
図11(a),(b),(c)は各々、ビットマップを使用して未使用領域をサーチする場合の具体例を説明するための図である。 FIGS. 11A, 11B, and 11C are diagrams for explaining specific examples in the case where an unused area is searched using a bitmap.
図11(a)に示すように、メモリ110内には、DT10〜DT13の使用中の領域が存在する。このような状況下で、図11(b)に示すようなサイズのデータの格納先を検索するものとする。
As shown in FIG. 11A, there are areas in use of DT10 to DT13 in the
すなわち、図11(c)に示すように、ビットマップ126を参照しつつ、まず、縦方向(第1の方向)にサーチを行って、列方向において所定サイズ以上の空き領域を確認すると、次に横方向(第2の方向)にサーチを行って、必要サイズ以上の空き領域があるかを確認し、そのようにして空きが確認できた場合、その最初に発見された空き領域DT14を、図11(b)に示されるデータの格納先のメモリ領域として確保する。
That is, as shown in FIG. 11C, referring to the
ビットマップを使用してサーチを行うことにより、高速なサーチが可能となる。すなわち、どのようなサイズの未使用領域がどこに存在するのか、未使用領域がどの程度連続して存在するのか、といった情報を簡単に取得することが可能となり、効率的な未使用領域のサーチが可能となる。 By performing a search using a bitmap, a high-speed search is possible. In other words, it is possible to easily obtain information such as where the unused area of what size exists, how long the unused area exists, and efficient search of unused areas is possible. It becomes possible.
このように、本発明によれば、シンプルかつローコストの構成で、多様なサイズの二次元のデータも取り扱うことが可能な動的なメモリ管理を行うことができ、したがって、本発明は、共通のメモリ空間に、複数の異なるサイズのデータを格納して各種の処理を行う必要のある電子機器全般に広く使用可能である。 Thus, according to the present invention, it is possible to perform dynamic memory management that can handle two-dimensional data of various sizes with a simple and low-cost configuration. The present invention can be widely used for all electronic devices that need to store various data of different sizes in a memory space and perform various processes.
また、本発明は、電子スチルカメラ、ビデオカメラならびにカメラ付き携帯端末のような携帯機に広く利用することが可能である。近年は、標準モードやファインモード等をユーザが自由に設定できることから、撮像装置の内部で取り扱われる画像データのサイズが一律ではなく、このことは、メモリの有効利用を困難とする一因となっている。かといって、高級な動的メモリ管理手法は、低コスト化、小型軽量化が進展する撮像装置の分野ではむずかしい。 Further, the present invention can be widely used in portable devices such as electronic still cameras, video cameras, and camera-equipped portable terminals. In recent years, since the user can freely set the standard mode, the fine mode, and the like, the size of the image data handled inside the imaging apparatus is not uniform, and this makes it difficult to effectively use the memory. ing. However, a high-grade dynamic memory management method is difficult in the field of imaging devices where cost reduction and size reduction are progressing.
しかしながら、本発明によれば、画像入力インタフェース部、画像処理部、画像圧縮・伸長部等のメモリ使用要求元と、メモリ管理装置との間の手続が極めて簡単化され、また、動的メモリの管理も簡単かつ迅速に行える。したがって、本発明によれば、撮像装置に対する小型、軽量、低コストといった厳しい要請を満足しつつ、メモリ空間における無駄な領域の発生や断片化の問題を効果的に抑制しつつ、メモリ空間の有効利用を促進することができる。 However, according to the present invention, the procedure between the memory use request source such as the image input interface unit, the image processing unit, and the image compression / decompression unit and the memory management device is greatly simplified, and the dynamic memory Management is easy and quick. Therefore, according to the present invention, while satisfying the strict demands for small size, light weight, and low cost for the image pickup apparatus, the memory space is effectively suppressed while effectively preventing generation of unnecessary areas and fragmentation in the memory space. Use can be promoted.
以上説明したように、本発明によれば、メモリ空間における使用領域・未使用領域をメモリ管理情報によって管理し、このメモリ情報を適宜、参照することによって、共通のメモリ空間において、多様なサイズの2次元のデータ(1次元のデータを含む)を自由に確保し、また、不要となったメモリ領域を解放することが可能な、メモリの動的管理方法を実現することができる。 As described above, according to the present invention, the used / unused areas in the memory space are managed by the memory management information, and the memory information is referred to as appropriate so that various sizes can be obtained in the common memory space. It is possible to realize a dynamic memory management method capable of freely securing two-dimensional data (including one-dimensional data) and releasing a memory area that is no longer needed.
また、第1実施形態におけるテーブルの代わりに、実メモリ空間を投影するビットマップ情報を使用して、メモリ管理を行うことにより、どのようなサイズの未使用領域がどこに存在するのか、未使用領域がどの程度連続して存在するのか、といった情報を簡単に取得することが可能となり、効率的な未使用領域のサーチが可能となる。 In addition, by using the bitmap information that projects the real memory space instead of the table in the first embodiment, memory management is performed to determine what size of the unused area exists, where the unused area exists. It is possible to easily obtain information such as how long a continuity exists, and an efficient search for unused areas becomes possible.
また、ビットマップを使用して未使用領域をサーチする場合に、例えば、まず列方向において所定サイズ以上の空き領域を確認し、次に、行方向にサーチを行って、必要サイズ以上の空き領域があるかを確認し、そのようにして空きが確認できた場合に、その空き領域をデータ格納先のメモリ領域として確保する方式を採用することにより、高速なサーチが可能となる。 When searching for an unused area using a bitmap, for example, firstly, an empty area of a predetermined size or more is confirmed in the column direction, and then a search is performed in the row direction to make an empty area of a necessary size or more. If a vacancy is confirmed in this way, and a vacant area can be confirmed in this way, a method of securing the vacant area as a memory area of the data storage destination enables high-speed search.
本発明によって、1次元のデータだけではなく、2次元のデータを含めて自由に取り扱いでき、また、多様なサイズのデータを自由に取り扱いでき、かつ、無駄なメモリ領域の発生を抑制できる、新規なメモリ管理技術が実現される。 According to the present invention, not only one-dimensional data but also two-dimensional data can be handled freely, various sizes of data can be handled freely, and generation of useless memory areas can be suppressed. Memory management technology is realized.
10 レンズ
11 レンズ駆動部
12 CPU
13 システムメモリ
26 タイミングジェネレータ
31 CCD
32 LCDディスプレイ
36 AF回路
37 AE/AWB回路
38 アナログ信号処理回路(CDS/AGC/ADC)
42 画像入力インタフェース
43 画像処理回路
44 圧縮・伸長処理回路
46 メディアコントローラ
47 ビデオエンコーダ
49 メモリカード
55 システムバス
100 DSP
110 メモリ(シンクロナスDRAM等の2次元のメモリ空間をもつメモリ)
120 メモリ管理装置
122 メモリ領域確保・解放部
124 メモリ管理情報
125 未使用領域テーブル
126 ビットマップ
10
13
32
42
110 memory (memory with two-dimensional memory space such as synchronous DRAM)
120
Claims (12)
前記2次元のデータは矩形状の画像データであり、
前記第1のステップでは、前記画像データの矩形状を維持したまま格納可能な矩形メモリ領域を確保することを特徴とする動的メモリ管理方法。 When it becomes necessary to store two-dimensional data in the memory space, an unused area in the memory space is searched by referring to memory management information for managing the memory usage of the memory space, and the two-dimensional data is stored. A dynamic memory management method comprising: a first step of securing a possible two-dimensional memory area; and a second step of releasing the secured two-dimensional memory area when the secured two-dimensional memory area is no longer needed Because
The two-dimensional data is rectangular image data,
In the first step, a rectangular memory area that can be stored while maintaining a rectangular shape of the image data is secured.
前記メモリ管理情報として、前記メモリ空間上の使用領域又は未使用領域を判定するためのテーブルを使用し、該テーブルにおいて、開始アドレスと、第1の方向及び該第1の方向に直交する第2の方向のサイズによって定義される矩形領域を単位として、前記メモリ空間上の使用領域又は未使用領域を特定することを特徴とする動的メモリ管理方法。 The dynamic memory management method according to claim 1, comprising:
As the memory management information, a table for determining a used area or an unused area in the memory space is used. In the table, a start address, a second direction orthogonal to the first direction and the first direction are used. A dynamic memory management method characterized in that a used area or an unused area in the memory space is specified in units of a rectangular area defined by a size in the direction of the direction.
前記メモリ管理情報を参照して未使用領域を検索し、必要なメモリ領域を確保するに際し、
前記メモリ空間上において前記第1走査方向に検索する第1検索ステップと、
前記第1走査方向に必要サイズの未使用の部分があった場合に、前記第2走査方向に検索して必要サイズの未使用の部分があるかを検索する第2検索ステップと、
前記第2検索ステップによって、必要サイズ以上の矩形状の未使用領域を検出した場合に、この最初に検出した矩形状の未使用領域を前記2次元データの格納先として確保する格納先設定ステップと、
を有することを特徴とする動的メモリ管理方法。 A dynamic memory management method according to claim 2, comprising:
When searching for an unused area with reference to the memory management information and securing a necessary memory area,
A first search step for searching in the first scanning direction on the memory space;
A second search step of searching for an unused portion of the required size by searching in the second scan direction when there is an unused portion of the required size in the first scan direction;
A storage destination setting step for securing a rectangular unused area detected first as a storage destination of the two-dimensional data when a rectangular unused area larger than a necessary size is detected by the second search step; ,
A dynamic memory management method comprising:
前記メモリ管理情報を参照して未使用領域を検索し、必要なメモリ領域を確保するに際し、
前記メモリ空間上において前記第1走査方向に検索する第1検索ステップと、
前記第1走査方向に必要サイズの未使用の部分があった場合に、前記第2走査方向に検索して必要サイズの未使用の部分があるかを検索する第2検索ステップと、
前記第1及び第2検索ステップを繰り返し、必要サイズ以上の矩形状の未使用領域を全て検出する全未使用領域検出ステップと、
前記検出された未使用領域の中から、選択的にいずれか一つの矩形状の未使用領域を前記2次元データの格納先として確保する格納先選択設定ステップと、
を有することを特徴とする動的メモリ管理方法。 A dynamic memory management method according to claim 2, comprising:
When searching for an unused area with reference to the memory management information and securing a necessary memory area,
A first search step for searching in the first scanning direction on the memory space;
A second search step of searching for an unused portion of the required size by searching in the second scan direction when there is an unused portion of the required size in the first scan direction;
Repeating the first and second search steps to detect all unused areas having a rectangular shape larger than the required size,
A storage destination selection setting step for selectively securing any one of the rectangular unused areas as the storage destination of the two-dimensional data from the detected unused areas;
A dynamic memory management method comprising:
前記第1のステップと第2のステップの間で、前記2次元のメモリ領域の確保に伴う前記メモリ管理情報の更新を行う第3のステップと、
前記第2のステップの後で、前記2次元のメモリ領域の解放に伴う前記メモリ管理情報の更新を行う第4のステップと、
を有することを特徴とする動的メモリ管理方法。 The dynamic memory management method according to claim 1, wherein:
A third step of updating the memory management information accompanying the securing of the two-dimensional memory area between the first step and the second step;
A fourth step of updating the memory management information following the release of the two-dimensional memory area after the second step;
A dynamic memory management method comprising:
前記第3のステップは、前記2次元のメモリ領域が確保された後の、残余の未使用のメモリ領域に対して、新たに矩形領域を設定し直し、該設定された矩形領域の各々についての開始アドレスと水平及び垂直方向のサイズとの情報を前記テーブルに登録する処理であることを特徴とする動的メモリ管理方法。 The dynamic memory management method according to claim 5, comprising:
In the third step, a new rectangular area is newly set for the remaining unused memory area after the two-dimensional memory area is secured, and each of the set rectangular areas is set. A dynamic memory management method, which is a process of registering information on a start address and horizontal and vertical sizes in the table.
前記第4のステップは、解放されたメモリの矩形領域を、該矩形領域の周辺の未使用領域と結合することによって、より大きなサイズの矩形エリアを形成し、この結合によって新たに生じる大サイズの矩形領域に対し、その開始アドレスと、水平及び垂直方向のサイズとの情報を前記テーブルに登録する処理であることを特徴とする動的メモリ管理方法。 The dynamic memory management method according to claim 5, comprising:
The fourth step forms a larger-sized rectangular area by combining the rectangular area of the released memory with an unused area around the rectangular area, and a newly generated large-sized rectangular area. A dynamic memory management method, which is processing for registering information about a start address and horizontal and vertical sizes of a rectangular area in the table.
前記メモリ空間を、m画素×n画素(m,nは共に2以上の自然数)に対応する矩形領域を単位として分割し、それらの矩形領域の各々の使用状況を、各矩形領域を代表する代表ビットで表現し、該代表ビットを前記メモリ管理情報として使用することを特徴とする動的メモリ管理方法。 The dynamic memory management method according to claim 1, comprising:
The memory space is divided in units of rectangular areas corresponding to m pixels × n pixels (m and n are natural numbers of 2 or more), and the usage status of each of the rectangular areas is representative of each rectangular area. A dynamic memory management method, characterized in that the representative bits are expressed as bits and used as the memory management information.
前記メモリ管理情報を参照して未使用領域を検索し、必要なメモリ領域を確保するに際し、
前記メモリ空間上において前記第1走査方向に検索する第1検索ステップと、
前記第1走査方向に必要サイズの未使用の部分があった場合に、前記第2走査方向に検索して必要サイズの未使用の部分があるかを検索する第2検索ステップと、
前記第2検索ステップによって、必要サイズ以上の矩形状の未使用領域を検出した場合に、この検出した矩形状の未使用領域を前記2次元データの格納先として確保する格納先設定ステップと、
を有することを特徴とする動的メモリ管理方法。 9. The dynamic memory management method according to claim 8, wherein
When searching for an unused area with reference to the memory management information and securing a necessary memory area,
A first search step for searching in the first scanning direction on the memory space;
A second search step of searching for an unused portion of the required size by searching in the second scan direction when there is an unused portion of the required size in the first scan direction;
A storage location setting step for securing the detected rectangular unused area as a storage destination of the two-dimensional data when a rectangular unused area of a size larger than a necessary size is detected by the second search step;
A dynamic memory management method comprising:
前記メモリ管理情報を具備し、前記第1及び第2のステップを実施するメモリ領域確保・解放部を有することを特徴とするメモリ管理装置。 A memory management device that implements the dynamic memory management method according to any one of claims 1 to 9,
A memory management apparatus comprising the memory management information and having a memory area securing / releasing unit for executing the first and second steps.
前記画像データの生成の際に使用されるメモリと、
前記メモリを管理する請求項10記載のメモリ管理装置と、
を備えたことを特徴とする撮像装置。 A solid-state image sensor, an optical system that forms a subject image on the solid-state image sensor, a signal processing unit that processes a signal output from the solid-state image sensor and generates image data, and displays the generated image An imaging device including a display unit,
A memory used when generating the image data;
The memory management device according to claim 10 for managing the memory;
An imaging apparatus comprising:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005215307A JP2007034555A (en) | 2005-07-26 | 2005-07-26 | DYNAMIC MEMORY MANAGEMENT METHOD, MEMORY MANAGEMENT DEVICE, ELECTRONIC DEVICE, AND IMAGING DEVICE |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005215307A JP2007034555A (en) | 2005-07-26 | 2005-07-26 | DYNAMIC MEMORY MANAGEMENT METHOD, MEMORY MANAGEMENT DEVICE, ELECTRONIC DEVICE, AND IMAGING DEVICE |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2007034555A true JP2007034555A (en) | 2007-02-08 |
Family
ID=37793766
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005215307A Pending JP2007034555A (en) | 2005-07-26 | 2005-07-26 | DYNAMIC MEMORY MANAGEMENT METHOD, MEMORY MANAGEMENT DEVICE, ELECTRONIC DEVICE, AND IMAGING DEVICE |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2007034555A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016511904A (en) * | 2013-02-28 | 2016-04-21 | オラクル・インターナショナル・コーポレイション | System and method for supporting collaborative concurrency in a middleware machine environment |
| CN109089120A (en) * | 2011-09-06 | 2018-12-25 | 英特尔公司 | Analyze auxiliaring coding |
-
2005
- 2005-07-26 JP JP2005215307A patent/JP2007034555A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109089120A (en) * | 2011-09-06 | 2018-12-25 | 英特尔公司 | Analyze auxiliaring coding |
| CN109089120B (en) * | 2011-09-06 | 2024-05-17 | 英特尔公司 | Analysis-aided encoding |
| JP2016511904A (en) * | 2013-02-28 | 2016-04-21 | オラクル・インターナショナル・コーポレイション | System and method for supporting collaborative concurrency in a middleware machine environment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101584205B (en) | camera device | |
| JP4250543B2 (en) | Imaging apparatus, information processing apparatus, and control method thereof | |
| JP5431775B2 (en) | Portable imaging device for offloading image processing work | |
| US20090128644A1 (en) | System and method for generating a photograph | |
| US20200260007A1 (en) | Mobile device including multiple cameras | |
| JP6164317B2 (en) | Image display apparatus, image display method, and image display program | |
| JP4380740B2 (en) | Image processing device | |
| JP2009260814A (en) | Image capturing apparatus | |
| JP2007034555A (en) | DYNAMIC MEMORY MANAGEMENT METHOD, MEMORY MANAGEMENT DEVICE, ELECTRONIC DEVICE, AND IMAGING DEVICE | |
| US20240430568A1 (en) | Imaging element including processor configured to receive vibration information related to a vibration exerted on the imaging element, imaging apparatus, operation method of imaging element, and program | |
| JP2010028758A (en) | Image processing apparatus and method, program, and imaging apparatus | |
| JP2007034556A (en) | Dynamic memory management method and apparatus, and electronic apparatus using the same | |
| KR102400009B1 (en) | Mobile device including multiple cameras | |
| JP5777649B2 (en) | Information processing device | |
| JP4461991B2 (en) | Image transfer apparatus and program | |
| JP5843168B2 (en) | Image processing apparatus, image processing method, and program | |
| WO2010082374A1 (en) | Display device and display method | |
| JP5641352B2 (en) | Image processing apparatus, image processing method, and program | |
| JP2009033438A (en) | Imaging device | |
| JP2008177838A (en) | Digital camera, image processing apparatus, and image control program | |
| JP5267047B2 (en) | Imaging apparatus, information processing apparatus, and confirmation display image creation method | |
| JP6288601B2 (en) | Imaging device | |
| JP2007049632A (en) | Digital camera | |
| TW202446086A (en) | Image processing device, image processing method, and storage medium | |
| CN117376699A (en) | Image processing method, device and equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20061127 |
|
| RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20071109 |
|
| RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20071116 |
|
| RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20071126 |