Embodiments disclosed herein relate generally to video processing.
Image sensors may write pixel data into a buffer used by a image processor. The rates of outputting pixel data from an image sensor and inputting the pixel data to a buffer are typically fixed and equal (i.e., determined by the characteristics of the system). The rate at which the pixel data can be overwritten in the buffer, without losing the stored pixel data that is still being used for processing, is also typically fixed. When new pixel data is written to the buffer, the memory usage of the buffer increases. When the stored pixel data is no longer needed for processing and therefore can be overwritten without losing needed data, the memory usage of the buffer decreases. The rates of these changes are herein referred to as the input rate and discard rate, respectively.
Processing of pixel data may involve creating each line of output data based on data from multiple lines of the input image. The number of lines of input data from which each line of output data is produced may not be constant from line to line, resulting in a varying discard rate. The buffer must store at least the maximum amount of data used to create any one line of output pixel data. This is referred to as the “fundamental requirement.”
Further buffering may be required due to the timing characteristics of the video standards, or if the input rate exceeds the discard rate due to the nature of the transformation. For instance, with a large fundamental requirement that occurs both at the top and bottom of the image, it may be necessary to begin inputting data for the next frame before the current frame has been completely output. Alternatively, the variable discard rate may be less than the fixed input rate, resulting in a backlog of data which may exceed the size of the fundamental requirement. Any extra buffering beyond the fundamental requirement is referred to as the “timing requirement.” In a hardware application the amount of buffering has a direct area and cost implication. It is therefore desirable to reduce the size of the timing requirement.
The accompanying drawings illustrate specific embodiments of the invention, which are provided to enable those of ordinary skill in the art to make and use them. It should be understood that the claimed invention is not limited to the disclosed embodiments as structural, logical, or procedural changes may be made.
The buffer 211 may also be arranged as part of a processing system and receive the pixel data from input signal SIGin directly from the image sensor 101 (see e.g., the second processing system 201B of
In spatial transformation, the values of pixels from one line of an image are replaced by the values of pixels from other lines of the image, such that a new sequence of pixels is thereby generated to form a new line of an output image (as modified).
A processing rate controller 231 transmits a first control signal CON1 to an address generator 221, which instructs the address generator 221 when and which pixel of the stored pixel data will be read from the buffer 211 as the next pixel of the new pixel data, i.e., will be read from the buffer 211 as the next pixel of the output signal SIGout. In turn, the address generator 211 outputs a second control signal CON2 to the buffer 211, which instructs the buffer 211 (or, more particularly, instructs an input/output device for reading out data from the buffer 211) to read out a particular pixel of the stored pixel data as the next pixel for the output signal SIGout.
The above process is repeated, pixel-by-pixel, to read out a new line of pixel data. Based on the timing of the first control signal CON1, each line of pixel data can be read out from the buffer 211 in accordance with the timing requirements of the processing system 201B. After a line of pixel data in the buffer 211 is no longer needed, it may be overwritten with another line of pixel data from the image sensor 101. In this manner, pixel data within the buffer 211 is overwritten, line-by-line, when it is no longer needed for generating output pixel data. Because the buffer 211 receives new pixel data from the image sensor 101 (
As shown by the input signal valid SIGin_valid, the pixel data of the entire first image is written to the buffer 211 during a first active period Tia1. No pixel data is input to the buffer during the subsequent vertical blanking period Tib2. The pixel data of the entire second image is written to the buffer 211 during a second active period Tia2 (partially shown). As shown by the processing timeline of the first image and by the output valid signal SIGout_valid, the pixel data of the first output image is not read out until the buffer 211 fills with sufficient pixel data, during time period Tf1, to meet the fundamental requirement (arrow 401). When the fundamental requirement is met at the end of time period TF1, the second processing system 201B starts reading out the output signal SIGout and continues doing so for the duration of time period Tp1.
Pixel data of the second image is written to the buffer 211 while the pixel data of the first image still remains in the buffer 211. Thus, the time period Tf2 (during which the fundamental requirement (line 401) of pixel data of the second image is being stored to the buffer 211) overlaps the time Tp1 (during which the new modified pixel data of the first image is being read out from the buffer 211 as the output signal SIGout). The time period Tp2, which represents the duration of processing for the second image, begins at the end of time period Tf2 when enough lines of the second image pixel data have been written to the buffer 211 to begin processing of the second image. The above operations and their effect on the memory usage (line 404) of the second processing system 201B is now described with reference to time periods T1 to T5.
During time period T1, which spans from time A to time B and corresponds to time Tf1, the buffer 211 fills with pixel data (as indicated by the high input signal SIGin) of the first image, at the input rate (line 403), until the fundamental requirement (line 401) is met. At time B, which corresponds to the end of time Tf1, enough lines of the pixel data of the first image are stored in the buffer 211 to satisfy the fundamental requirement. Consequently, outputting of the new pixel data (as indicated by the high output signal SIGout) of the first image begins at time B.
During time period T2, which spans from B to C, the buffer 211 continues to receive pixel data (as indicated by the high input valid signal SIGin_valid) of the first image at the input rate (which is the slope of line 403, from A to B). The system is outputting data, thus there is a discard rate. In this example, we have assumed that the discard rate from B to E is constant, with a rate shown by the slope of line 402 from C to D. Because the input rate is greater than the discard rate, the memory usage increases at a rate equal to the difference between the input rate and discard rate, as shown by the slope of input rate, which allows some more space in the buffer, thus buffer continues to fill, but at a slower rate equal to the difference of the input rate and the discard rate, until it reaches a peak at point C, as shown by the slope of the memory usage line 404 from B to C.
At time C, the entire first image of pixel data has been received by the buffer 211. Thus, during time period T3, which spans from time C to time D, the buffer 211 has stopped receiving pixel data (as indicated by the low input valid signal SIGin_valid) of the first image. However, the new pixel data of the first image continues to be read out from the buffer 211 as output signal SIGout (as indicated by the high output valid signal SIGout_valid). Consequently, the memory usage (line 404) of the second processing system 201B decreases at the conversion rate (line 402) from time C to time D.
At time D, while still reading out the pixel data of the first image (as indicated by the high output valid signal SIGout_valid), the buffer 211 begins to receive pixel data of the second image (as indicated by the high input valid signal SIGin_valid). Therefore, during time period T4, which spans from time D to time E, pixel data of the first image is being read out from the buffer 211 (as indicated by the high output valid signal SIGout_valid) while pixel data of the second image is being input to the buffer 211 (as indicated by the high input valid signal SIGin_valid) at the input rate (line 403). As a result, the memory usage (line 404) again increases at a rate equal to the difference between the input rate (line 403) and discard rate (line 402).
At time E, the new pixel data of the first image has been completely read out from the buffer 211 (as indicated by the low output valid signal SIGout_valid) while pixel data of the second image continues to be input (as indicated by the high input valid signal SIGin_valid). Consequently, the pixel data of the first image that remains stored within the buffer 211, which is an amount of data equal to the fundamental requirement (line 401), is no longer needed and is therefore immediately available for overwriting by the pixel data of the second image. Thus, the memory usage (line 404) of the second processing system 201B precipitously drops at time E to the amount of pixel data of the second image stored in the buffer 211 at that time.
As noted, the minimum size of the buffer 211 is equal to the highest memory usage (line 404), which may occur at time C or time E depending on the particular implementation. Because the memory usage rises at a rate determined by the sum of the input rate (line 403) and discard rate (line 402), the minimum size of the buffer 211 may be reduced by decreasing the fixed input rate or by increasing the fixed discard rate. However, an increase in the discard rate may be unobtainable, e.g., due to standard industry constraints on the frequency rate of the output signal SIGout. A decrease of the fixed input rate may also be unobtainable, e.g., the input rate is dictated by a desired length of time for outputting an image from the image sensor 101.
The third processing system 301 is analogous to first and second processing systems 101, 201, with SIGin and SIGout having rates constrained as before, and performs an operation with the same fundamental requirements. Within the buffer 361, the fundamental buffer 311 has been split from the timing buffer 351, and these are controlled by separate signals CON4 and CON5. The input image is received line-by-line by a fundamental buffer 311. The conversion rate of SIGconv is variable, controlled by CON4, such that the discard rate prevents a backlog of data accumulating in the fundamental buffer 311. Instead, this backlog is passed into Timing Buffer 351.
A processing rate controller 331, address generator 321, and the fundamental buffer 311 of
The buffer 211 of
The rate at which the pixel data is input to the timing buffer 351 is controlled by the processing rate controller 331 (as described above), which more particularly controls the rate at which the pixel data is read out from the fundamental buffer 311. The rate at which the pixel data is read out from the timing buffer 351 is controlled by the timing generator 341, which transmits a fifth control signal CON5 instructing the timing buffer 351 (or, more particularly, instructs an input/output device associated with the timing buffer 351) when and which pixels to read out as a line of pixel data carried by the output signal SIGout.
The conversion rate of the fundamental buffer 311 is maintained low enough to prevent overwriting of needed pixel data within the timing buffer 351, whilst being fast enough that the discard rate prevents a backlog of unprocessed data in the input buffer 311 above the fundamental requirement. The rates at which the pixel data is read out from the fundamental buffer 311 and the timing buffer 351 may be coordinated to prevent the overwriting of pixel data in the timing buffer 351 that has yet to be output by the third processing system 301. Such coordination may be achieved, for example, by communication between the processing rate controller 331 and timing generator 341; or, for example, by a shared lookup table correlating the respective readout rates of the fundamental buffer 311 and timing buffer 351. A signal line 371 used for communication between the processing rate controller 331 and timing generator 341 is shown in
As shown in
As shown above, the total buffer requirements of the second and third processing systems 201B, 301 result from a fundamental requirement imposed by spatial considerations of the processing operation, and a timing requirement imposed by constraints on the video input and output formats. Unlike the processing system of 201B of
The example spatial transformation used requires the fundamental requirement of data to be present in the fundamental buffer 311 for creating the first line of the output image, and for creating the last line of the output image. It is assumed that creating each and every line of the output image data uses the same amount of input data; i.e., the discard rate is constant with the processing rate.
As collectively indicated by the processing timeline of the first image and the output valid signal SiGout_valid, the output of pixel data of the first image does not commence until the fundamental buffer 311 fills with sufficient pixel data, during time period Tf1, to meet the fundamental requirement (line 701). After the fundamental requirement is met at the end of time period Tf1, the new pixel data of the first image is read out from the fundamental buffer 311 to the timing buffer 351. This processing of the first image continues for the duration of time period Tp1. Time period Tf2 (during which the fundamental requirement of pixel data of the second image is being stored to the fundamental buffer 311) does not overlap time period Tp1. Time period Tp2, which represents the duration for processing the new pixel data of the second image, begins at the end of time period Tf2 when enough lines of pixel data of the second image have to been written to the fundamental buffer 311 to begin the processing operation. Time period Toa1 is the time interval during which the output is active, i.e., data of the first image is being output from the timing buffer 351; similarly, time period Toa2 is the output active period for the second image.
The memory usage (lines 404, 704) of the second and third processing systems 201B, 301 are identical during time period T1, which spans from time A (
During time period T2, which spans from time B (
The processing rate is faster than the required output rate. This causes a backlog of data to build up in the timing buffer 351, as shown by line 705. Because the format of the data storage in the timing buffer 351 is smaller than the format of the data storage in the fundamental buffer 311 (half size in this example), the rate of memory increase (slope of line 705), is less than the discard rate (which is being controlled to be equal to the input rate).
At time C (
During time period T3, which spans from time C (
At time D (
At time F (
The total buffer requirement of the system 361 is shown by solid line 704. Note that the maximum occurs at time C, and that this is less than the total required by the second processing system 201.
The example illustrated in
It should be appreciated that invention processes data between a larger format buffer and a smaller format buffer at a varying rate depending on the spatial requirements of the image processing being performed, so as not to increase the amount of buffering required in the larger storage format, putting the overflowing data from said varying rate when compared with a constant output rate into a second buffer with a smaller format, thereby reducing the overall size of the buffering. It should also be appreciated that replacing a first pixel with a second pixel from a different position may include the case when said second pixel is itself interpolated according to known methods from stored pixels near the aforesaid different position if the different position has sub-pixel accuracy.
In addition to the saving from the output format being smaller than the input format, further savings in silicon area from the embodiments of the invention may be realized if the timing and fundamental buffers are physically not part of the same memory, since the timing buffer need only have a simple first-in first-out structure, whereas the fundamental buffer must have at least a random access read port.
It should be understood that though various embodiments have been discussed and illustrated, the claimed invention is not limited to the disclosed embodiments. Various changes can be made thereto.