KR-20260065872-A - Use buffer
Abstract
A method is provided for writing an image data sample received in a first array to a buffer and reading an image data sample from a buffer to create a second array. The first array is different from the second array. The method comprises: during a first stage: writing each image data sample of a first data portion of an image data sample received in a first array to a buffer; during a second stage: reading each image data sample from a first data portion of an image data sample from a buffer by determining a corresponding second stage buffer address for each reading operation based on the first array and the second array so that each image data sample of the first data portion is read according to the second array; writing each image data sample of a second data portion of an image data sample to a buffer by determining a corresponding buffer address for each writing operation as the second stage buffer address used to read the image data sample corresponding to the first data portion; the writing is after the reading by at least one buffer address; And during the third stage: the step of reading each image data sample from the second data portion of the image data sample from the buffer by determining a corresponding third stage buffer address based on the second stage determination, the first array, and the second array, so that each image data sample of the second data portion is read according to the second array of image data samples.
Inventors
- 알라비 니우샤
Assignees
- 브이-노바 인터내셔널 리미티드
Dates
- Publication Date
- 20260511
- Application Date
- 20240903
- Priority Date
- 20230905
Claims (16)
- A method for writing an image data sample received in a first array to a buffer and reading the image data sample from the buffer to generate a second array, wherein the first array is different from the second array, and the method comprises: During Stage 1: A step of writing each image data sample of the first data portion of the image data sample received in the first array to the above buffer; During Stage 2: A step of reading each image data sample from the first data portion of the image data sample from the buffer by determining a corresponding second stage buffer address for each reading operation based on the first array and the second array so that each image data sample of the first data portion is read according to the second array; A step of writing each image data sample of the second data portion of the image data sample to the buffer by determining the corresponding buffer address for each recording operation as the second stage buffer address used to read the image data sample corresponding to the first data portion; - The above record is at least one buffer address behind the above read -; and During Stage 3: A method comprising the step of reading each image data sample from the second data portion of the image data sample from the buffer by determining a second stage and a corresponding third stage buffer address based on the first array and the second array so that each image data sample of the second data portion is read according to the second array of the image data sample.
- In claim 1, the method wherein the first array is based on a block-based raster scan order.
- In paragraph 2, the method wherein the second array is based on a line-based raster scan sequence.
- In paragraph 3, the step of determining a corresponding second stage buffer address for each of the above read operations depends on the block dimensions of the block-based raster scan order and the line dimensions of the line-based raster scan order.
- A method according to claim 4, wherein, for a read operation immediately following a read operation that completes a line in a line-based raster scan sequence of the second array during the second stage, the corresponding second stage buffer address is determined to be a block width extending from the corresponding buffer address used in the first read operation for the line.
- A method according to claim 4 or 5, wherein, during the second stage, for a read operation that completes a sequence of read operations equal to the block width in a line of the line-based raster scan sequence but does not complete the line, the corresponding buffer address for the read operation is determined to be a block that follows from the corresponding buffer address of the first read operation of the sequence of read operations.
- A method according to any one of claims 4 to 6, wherein the step of determining the corresponding third stage buffer address for each read operation depends on block dimensions and line dimensions.
- A method according to claim 7, wherein, during the third stage, for a read operation immediately following a read operation that completes a line in the line-based raster scan sequence of the second array, the corresponding third stage buffer address is determined to be a block from the corresponding buffer address for the first read operation of the line in the line-based raster scan sequence.
- A method according to claim 7 or 8, wherein, during the third stage, for a read operation that completes a sequence of read operations equivalent to a block width in a line of the line-based raster scan sequence but does not complete the line, the corresponding third stage buffer address for the read operation is half a block from the corresponding buffer address of the first read operation of the sequence of read operations.
- A method according to claim 1, wherein the first array is based on a line-based raster scan order and the second array is based on a block-based raster scan order.
- A method according to any one of claims 1 to 10, wherein, during the second stage, the corresponding second stage buffer address for the first reading operation is determined to be the first buffer address used to write an image data sample to the first stage.
- A method according to any one of claims 1 to 11, wherein, during the third stage, the corresponding third stage buffer address for the first reading operation is determined to be the first buffer address used to write an image data sample to the second stage.
- A method according to any one of claims 1 to 12, wherein the reading and recording in the second stage are performed simultaneously.
- A method according to any one of claims 1 to 13, wherein during the first stage, the recording step comprises the step of recording each image data sample of the first data portion received in the first array into the buffer in raster scan order.
- A hardware module comprising a buffer, write logic and read logic, wherein the hardware module is configured to perform the method of any one of claims 1 to 14.
- A computer-readable storage medium comprising instructions that, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 14.
Description
Use buffer The present invention relates to a method for recording an image data sample and reading an image data sample from a buffer. A ping-pong buffer uses two buffers, and writing to the other buffer is performed while reading from one buffer is being performed. By alternating the roles of the buffers, data can be written to one buffer and read from another buffer simultaneously, preventing unwanted overwriting of data within the buffers, thereby enabling a smooth flow of data. Despite these advantages, the ping-pong buffer has several significant disadvantages. Primarily, the need for two separate buffers requires additional memory resources, which poses a significant drawback in environments with limited memory capacity. Therefore, there is a strong need for a method to address at least one of the inherent disadvantages of the ping-pong buffer while maintaining its advantages. A method for writing an image data sample received in a first array to a buffer and reading an image data sample from the buffer to create a second array is provided herein. The writing and reading of the image data sample are performed using a plurality of stages, each comprising a stage and an optional address assignment dependent on the first and second arrays. According to a first aspect of the present invention, a method is provided for writing an image data sample received in a first array to a buffer and reading an image data sample from the buffer to generate a second array. The first array is different from the second array. The method comprises: during a first stage: writing each image data sample of a first data portion of an image data sample received in a first array to a buffer; during a second stage: reading each image data sample from a first data portion of an image data sample from a buffer by determining a corresponding second stage buffer address for each reading operation based on the first array and the second array so that each image data sample of the first data portion is read according to the second array; writing each image data sample of a second data portion of an image data sample to a buffer by determining a corresponding buffer address for each writing operation as a second stage buffer address used to read the image data sample corresponding to the first data portion; the writing is after the reading by at least one buffer address; And during the third stage: the step of reading each image data sample from the second data portion of the image data sample from the buffer by determining a corresponding third stage buffer address based on the second stage determination, the first array, and the second array, so that each image data sample of the second data portion is read according to the second array of image data samples. In this way, improved buffer utilization is provided compared to the 2-buffer solution of the ping-pong buffer, while mitigating the previously highlighted disadvantages, such as additional memory resource requirements, while maintaining the throughput of the ping-pong buffer array. Preferably, the first array is based on a block-based raster scan order. In this way, the invention disclosed herein can be used with image processing applications that output image data samples in a block-based raster scan order. Preferably, the second array is based on a line-based raster scan order. In this way, the invention disclosed herein can be used with image processing applications that require image data samples to be in a line-based raster scan order. Preferably, determining the corresponding second stage buffer address for each read operation depends on the block dimensions of the block-based raster scan order and the line dimensions of the line-based raster scan order. Preferably, during the second stage, for a read operation immediately following a read operation that completes a line in a line-based raster scan sequence of the second array, the corresponding second stage buffer address is determined to be a block width extending from the corresponding buffer address used in the first read operation for the line. Preferably, during the second stage, for a read operation that follows a read operation that completes a sequence of read operations equal to the block width in a line of a line-based raster scan order but does not complete a line, the corresponding buffer address for the read operation is determined to be a block that follows from the corresponding buffer address of the first read operation of the sequence of read operations. Preferably, the step of determining the third stage buffer address corresponding to each read operation depends on the block dimensions and line dimensions. Preferably, during the third stage, for a read operation immediately following a read operation that completes a line in a line-based raster scan sequence of the second array, the corresponding third stage buffer address is determined to be a block from the buffer address corresponding to the first