Japanese Patent Application No. 2007-59901, filed on Mar. 9, 2007, is hereby incorporated by reference in its entirety.
The present invention relates to an encoding device and an image recording device.
Technology is known which reduces the amount of information by compressing data in order to efficiently process data with a large amount of information such as an image and sound. As the data compression technology, encoding technology utilizing a variable-length code table is known.
According to the variable-length encoding technology, the amount of information after encoding may differ depending on the applied code table. The amount of information after encoding can be minimized by applying a code table optimum for the encoding target data (e.g., image data of one frame). Various methods such as a Huffman code method and an arithmetic code method have been proposed as encoding technology which creates a code table optimum for the encoding target data.
A code table optimum for the encoding target data generally differs depending on the encoding target data. Therefore, the amount of information after encoding can be reduced by creating a code table for each piece of the encoding target data. However, the processing load increases when creating a code table for all pieces of the encoding target data, thereby making it difficult to process the data in real time.
A de-facto variable-length code table may be defined depending on the encoding technology. Data can be encoded utilizing such a de-facto variable-length code table without creating a variable-length code table. For example, JPEG data may be encoded utilizing a typical variable-length code table described in ISO/IEC 10918-1 Annex K.
However, a code table defined in advance is rarely optimum for all pieces of the encoding target data. It may be difficult to encode data at a high compression rate when utilizing a code table defined in advance.
According to a first aspect of the invention, there is provided an encoding device comprising:
a variable-length code table generation section generating a variable-length code table based on first image data acquired by a first imaging section; and
an encoded information generation section generating encoded information by encoding second image data acquired by a second imaging section based on the variable-length code table generated by the variable-length code table generation section.
According to a second aspect of the invention, there is provided an image recording device comprising:
the above-described encoding device;
the first imaging section;
the second imaging section; and
a storage section storing the encoded information.
The invention may provide an encoding device and an image recording device, both of which can efficiently generate encoded data at a high compression rate.
(1) According to one embodiment of the invention, there is provided an encoding device comprising:
a variable-length code table generation section generating a variable-length code table based on first image data acquired by a first imaging section; and
an encoded information generation section generating encoded information by encoding second image data acquired by a second imaging section based on the variable-length code table generated by the variable-length code table generation section.
According to this embodiment, the second image data can be encoded without generating a variable-length code table based on the second image data. Therefore, the second image data can be efficiently encoded. According to this embodiment, the second image data is encoded utilizing the variable-length code table generated based on the first image data (i.e., variable-length code table optimum for the first image data) instead of a de-facto code table. Therefore, the second image data can be encoded at a high compression rate as compared with the case of utilizing a de-facto code table.
According to this embodiment, an encoding device can be provided which can efficiently encode the second image data at a high compression rate.
(2) In this encoding device,
the first imaging section may acquire a plurality of pieces of the first image data in time series; and
the variable-length code table generation section may generate a plurality of the variable-length code tables, each of the variable-length code tables being generated based on one of the pieces of the first image data.
(3) In this encoding device,
the encoded information generation section may encode the second image data based on one of the variable-length code tables generated based on one of the pieces of
the first image data having an acquisition time closest to an acquisition time of the second image data.
This enables the second image data to be encoded based on the variable-length code table generated based on the first image data which has a feature similar to that of the second image data. Therefore, the second image data can be encoded at a high compression rate.
(4) In this encoding device,
the encoded information generation section may encode the second image data based on one of the variable-length code tables generated based on one of the pieces of the first image data having an acquisition time immediately before an acquisition time of the second image data.
This enables the second image data to be encoded based on the variable-length code table generated based on the first image data which has a feature similar to that of the second image data. Therefore, the second image data can be encoded at a high compression rate.
(5) The encoding device may further comprise:
a holding section holding the variable-length code table,
wherein the encoded information generation section may encode at least two pieces of the second image data based on the variable-length code table held in the holding section.
(6) The encoding device may further comprise:
an update event detection section detecting occurrence of a predetermined variable-length code table update event; and
an updating section updating the variable-length code table held in the holding section when the update event detection section has detected the occurrence of the predetermined variable-length code table update event.
This enables the second image data to be encoded based on the variable-length code table optimum for encoding the second image data, whereby the second image data can be encoded at a high compression rate.
(7) In this encoding device,
the update event detection section may detect the occurrence of the predetermined variable-length code table update event when the amount of the encoded information has exceeded a predetermined value.
According to this embodiment, whether or not the variable-length code table is data optimum for encoding the second image data is determined based on the amount of encoded information.
This enables the second image data to be encoded based on the variable-length code table optimum for encoding the second image data, whereby the second image data can be encoded at a high compression rate.
(8) In this encoding device,
the update event detection section may detect the occurrence of the predetermined variable-length code table update event when a predetermined period of time has expired after the acquisition of the first image data.
According to this embodiment, whether or not the variable-length code table is data optimum for encoding the second image data is determined based on the elapsed time from the acquisition time of the first image data. Specifically, the variable-length code table used to encode the second image data is updated corresponding to a change in environment with the passage of time.
This enables the second image data to be encoded based on the variable-length code table optimum for encoding the second image data, whereby the second image data can be encoded at a high compression rate.
(9) In this encoding device,
the update event detection section may detect the occurrence of the predetermined variable-length code table update event when a predetermined period of time has expired after the variable-length code table has been held in the holding section.
According to this embodiment, whether or not the variable-length code table is data optimum for encoding the second image data is determined based on the elapsed time from the generation time of the variable-length code table. Specifically, the variable-length code table used to encode the second image data is updated corresponding to a change in environment with the passage of time.
This enables the second image data to be encoded based on the variable-length code table optimum for encoding the second image data, whereby the second image data can be encoded at a high compression rate.
(10) In this encoding device,
the update event detection section may detect the occurrence of the predetermined variable-length code table update event when a predetermined update time is reached.
According to this embodiment, whether or not the variable-length code table is data optimum for encoding the second image data is determined based on the present time. Specifically, the variable-length code table used to encode the second image data is updated corresponding to a change in environment (e.g., morning, daytime, and night) depending on the time.
This enables the second image data to be encoded based on the variable-length code table optimum for encoding the second image data, whereby the second image data can be encoded at a high compression rate.
(11) In this encoding device,
the update event detection section may detect the occurrence of the predetermined variable-length code table update event when the first image data or the second image data satisfies a predetermined condition.
According to this embodiment, whether or not the variable-length code table is data optimum for encoding the second image data is determined based on the image data before being processed. For example, whether or not the variable-length code table is data optimum for encoding the second image data may be determined based on the total luminance of the first image data and the second image data.
This enables the second image data to be encoded based on the variable-length code table optimum for encoding the second image data, whereby the second image data can be encoded at a high compression rate.
(12) In this encoding device,
the updating section may cause the first imaging section to newly acquire the first image data when the update event detection section has detected the occurrence of the predetermined variable-length code table update event.
Specifically, the encoding device according to this embodiment may be configured to acquire the first image data only when the variable-length code table held in the holding section is updated.
(13) In this encoding device, a resolution of the first image data may be lower than a resolution of the second image data.
Even if the first image data has a resolution lower than that of the second image data, the second image data can be encoded based on the variable-length code table generated based on the first image data.
Moreover, the variable-length code table can be efficiently generated by utilizing image data with a low resolution as the first image data.
(14) The encoding device may further comprise a first image data encoding section encoding the first image data to generate encoded information.
(15) In this encoding device, the first image data encoding section may encode the first image data based on the variable-length code table.
(16) In this encoding device,
the variable-length code table generation section may generate the variable-length code table so that the amount of information of the first image data is equal to or less than a predetermined value after encoding the first image data based on the variable-length code table.
This enables the second image data to be encoded at a high compression rate.
(17) According to one embodiment of the invention, there is provided an image recording device comprising:
the above-described encoding device;
the first imaging section;
the second imaging section; and
a storage section storing the encoded information.
According to this embodiment, the second image data can be encoded without generating a variable-length code table based on the second image data. Therefore, the second image data can be efficiently encoded. According to this embodiment, the second image data is encoded utilizing the variable-length code table generated based on the first image data (i.e., variable-length code table optimum for the first image data) instead of a de-facto code table. Therefore, the second image data can be encoded at a high compression rate as compared with the case of utilizing a de-facto code table.
According to this embodiment, an image recording device can be provided which can efficiently encode the second image data at a high compression rate.
(18) In this image recording device,
the first imaging section and the second imaging section may be disposed adjacently and face in an identical direction.
According to this configuration, the first image data and the second image data are similar types of data. Therefore, the second image data can be encoded at a high compression rate based on the variable-length code table generated based on the first image data.
(19) In this image recording device,
the first image data and the second image data may be acquired by performing an identical process on light incident on the first imaging section and the second imaging section.
Specifically, the first and second imaging sections may have an identical setting relating to a sharpening function, a smoothing feature, or a color filter. The first and second imaging sections may have an identical setting relating to a focal length.
According to this configuration, the degree of similarity of the first image data and the second image data can be increased. This enables the second image data to be encoded at a higher compression rate.
The first and second imaging sections may include a light-receiving element which photoelectrically converts incident light, an optical element (optical system) which causes light to be incident on the light-receiving element, and a processing section which performs a predetermined process on an electrical signal obtained by the light-receiving element. The first and second imaging sections may include identical optical elements (e.g., lenses). The first and second imaging sections may have an identical setting relating to the processing section (e.g., filter).
(20) In this image recording device, the first imaging section and the second imaging section may be provided in one vehicle.
Specifically, the image recording device may be configured as a drive recorder.
Embodiments of the invention will be described below with reference to the drawings. Note that the invention is not limited to the following embodiments. The invention includes configuration in which the elements in the following embodiments and modifications are arbitrarily combined.
1. Configuration of Encoding Device 1
The configuration of an encoding device I according to an embodiment to which the invention is applied is described below.
As shown in
The first image data 102 may be information expressed by a set of pixel values of each pixel (matrix having pixel values as components). The term “pixel value” refers to a value which indicates the intensity of each component of image data. For example, when image data is decomposed into Y/Cr/Cb components, the pixel value indicates the intensities of the Y component, the Cr component, and the Cb component of each pixel. Or, when image data is decomposed into RGB components, the pixel value indicates the intensities of the R component, the G component, and the B component of each pixel. Each process given below may be performed on only one component of image data, or may be performed on a plurality of components of image data.
The variable-length code table generation section 10 is described in detail below.
As shown in
The block division process may be considered to be a preprocess of a DCT conversion process described later. In general, the number of calculations of the DCT conversion process increases along with an increase in the number of pixels contained in the processing target image data by about the second power of the increase in the number of pixels. Therefore, when performing the DCT conversion process on image data containing a large number of pixels, the number of calculations can be reduced by dividing the image data into a plurality of pieces of block data and performing the DCT conversion process in units of pieces of block data. Note that the encoding device 1 may not include the block division section 12.
As shown in
As shown in
As shown in
The symbol data generation section 18 converts the quantized DCT coefficients 108 so that the statistical bias of the symbols increases. A specific process of the symbol data generation section 18 is not particularly limited. A process applied to a known method such as differential encoding or predictive encoding may be applied.
The symbol data generation section 18 may generate the symbol data (A) by calculating the difference in DC component between the quantized DCT coefficients 108 obtained from the adjacent pieces of the block data 104, for example. The symbol data generation section 18 may generate the symbol data (A) by scanning AC components of the quantized DCT coefficients 108 contained in the single block data 104 and combining the run length of an invalid coefficient with the value of the subsequent valid coefficient.
As shown in
The variable-length code table generation section 10 according to this embodiment may be configured as described above. Note that the encoding device according to the invention is not limited to the above configuration. In particular, the processing section (i.e., processing section which generates data (symbol data (A)) to which a code word is assigned) upstream of the variable-length code table generation section 20 may be modified in various ways. A processing section which performs a process appropriate for the encoding method (data compression method) employed may be applied.
As shown in
As shown in
The encoding section 24 may generate the encoded information (C) based on the variable-length code table (B) held in the holding section 22. For example, when the encoding device 1 is configured to sequentially generate code tables based on a plurality of pieces of the first image data 102 acquired in time series, the generated variable-length code table (B) may be held in the holding section 22, and the first image data 102 (symbol data (A)) subsequently acquired may be encoded based on the variable-length code table (B) held in the holding section 22. The encoding section 24 may generate the encoded information (C) based on a predetermined de-facto code table (variable-length code table).
When the encoding device 1 includes the encoding section 24, the block division section 12, the DCT conversion section 14, the quantization section 16, the symbol data generation section 18, and the encoding section 24 may be collectively referred to as a first JPEG encoder 25. Note that the encoding device 1 may not include the encoding section 24.
The configuration of the encoding device 1 according to this embodiment for processing the second image data 202 is described below.
As shown in
The block division processing section 32 divides the second image data 202 acquired using the second imaging section to generate block data 204 (see
The DCT conversion section 34 performs a DCT conversion process on each piece of the block data 204 to generate DCT coefficients 206 (see
The quantization section 36 quantizes the DCT coefficients 206 to generate quantized DCT coefficients 208 (see
The symbol data generation section 38 converts the quantized DCT coefficients 208 (or DCT coefficients 206) to generate symbol data (D).
Each process of generating the symbol data (D) from the second image data 202 may be the same as each process of generating the symbol data (A) from the first image data 102.
The encoding section 40 encodes the symbol data (D) based on the variable-length code table (B) to generate the encoded information (E). Specifically, the encoding section 40 may generate the encoded information (E) by associating the code word assigned in the variable-length code table (B) with each symbol generated by the symbol data generation section 38. The encoded information generation section 30 may be referred to as a second JPEG encoder 35.
As shown in
The update event detection section 26 may be configured to detect that the amount of encoded information (E) generated by the encoding section 40 has exceeded a predetermined value and output the detection signal (F), for example.
The update event detection section 26 may be configured to detect that a predetermined period of time has expired after the first image data 102 from which the variable-length code table (B) held in the holding section 22 has been generated has been acquired and output the detection signal (F).
The update event detection section 26 may be configured to detect that a predetermined period of time has expired after the variable-length code table (B) has been written into the holding section 22 and output the detection signal (F).
The update event detection section 26 may be configured to detect that an update time set in advance has been reached using a built-in timer and output the detection signal (F), for example.
The update event detection section 26 may be configured to detect that new first image data 102 (new symbol data (A) or variable-length code table (B)) has been generated and output the detection signal (F).
The update event detection section 26 may be configured to detect that the first image data 102 or the second image data 202 satisfies a predetermined condition and output the detection signal (F). Specifically, the update event detection section 26 may determine whether or not to update the variable-length code table (B) held in the holding section 22 based on the image data before being encoded. The update event detection section 26 may determine whether or not to update the variable-length code table (B) based on the luminances (total luminance) of the first image data 102 and the second image data 202, for example.
As shown in
The updating section 28 may be configured to be able to control the operation of the first imaging section. Specifically, the updating section 28 may generate a control signal that controls the first imaging section to cause the first imaging section to acquire new first image data 102, and may hold a variable-length code table (B) generated based on the acquired first image data 102 in the holding section 22. The first imaging section may be configured to acquire the first image data 102 at predetermined time intervals irrespective of the operation of the updating section 28.
The encoding device I according to this embodiment may be configured as described above. The encoding device I may be implemented by dedicated hardware, or may be implemented by causing a microcomputer including a CPU or an MPU to execute a predetermined program.
The encoding device 1 may be configured as part of the image recording device 2. The configuration of the image recording device 2 including the encoding device 1 is described below with reference to
As shown in
The image recording device 2 may be configured as a drive recorder, for example. In this case, the first and second imaging sections 52 and 54 may be provided in one vehicle.
As shown in
As shown in
The image recording device 2 may include a control section (not shown) which controls the operation of the image recording device 2. The control section may be implemented by causing a microcomputer including a CPU or an MPU to execute a predetermined program, or may be implemented by a dedicated circuit, for example.
The control section may store data written into the first storage section 56 in the second storage section 58 (data storage process). The control section may be configured to receive a detection signal from a data storage event detection section (not shown) and then start the data storage process. The data storage event detection section may include a vibration detection sensor such as an acceleration sensor or an angular speed sensor. The data storage event detection section may be configured to generate the detection signal when the vibration detection sensor has detected predetermined vibrations.
The control section may control the imaging operations of the first and second imaging sections 52 and 54. The control section may control the operations of the first and second imaging sections 52 and 54 by setting the imaging time intervals of the first and second imaging sections 52 and 54. The control section may generate a control signal which causes the first imaging section 52 to acquire the first image data 102 when the update event detection section 26 has detected an update event. The control section may adjust the directions and the focal lengths of the first and second imaging sections 52 and 54.
2. Operation of Encoding Device 1
The operation of the encoding device 1 according to this embodiment is described below.
The encoding device 1 generates the variable-length code table (B).
The encoding device 1 divides the first image data 102 into N blocks to generate the block data 104 (step S10).
The encoding device 1 performs the DCT conversion process on the block data 104 to generate the DCT coefficients 106 (step S12).
The encoding device 1 quantizes the DCT coefficients 106 to generate the quantized DCT coefficients 108 (step S14).
The encoding device 1 converts the quantized DCT coefficients 108 to generate the symbol data (A) (step S16), and increments the symbols (step S18) to generate the statistical information which indicates the occurrence rates of the symbols.
When the symbol incrementing operation has been completed for all (N) pieces of block data 104 (Yes in step S20), the encoding device 1 determines the code word assigned to each symbol based on the generated statistical information to generate the variable-length code table (B) shown in
The encoding device 1 encodes the second image data 202 based on the generated variable-length code table (B).
The encoding device 1 divides the second image data 202 into N blocks to generate the block data 204 (step S30).
The encoding device 1 performs the DCT conversion process on the block data 204 to generate the DCT coefficients 206 (step S32).
The encoding device 1 quantizes the DCT coefficients 206 to generate the quantized DCT coefficients 208 (step S34).
The encoding device 1 converts the quantized DCT coefficients 208 into symbol information based on the variable-length code table (B) to generate the encoded information (E) (step S36).
The second image data 202 can be encoded by performing each process on all pieces of the block data 204 (Yes in step S38).
3. Effects
Effects of the encoding device 1 (image recording device 2) according to this embodiment are described below.
As described above, the encoding device 1 encodes the second image data 202 based on the variable-length code table (B) generated based on the first image data 102. This enables the second image data 202 to be encoded without generating a variable-length code table based on the second image data 202. Therefore, the second image data 202 can be efficiently encoded in real time. Since the second image data 202 is encoded based on the variable-length code table (B) generated based on the first image data 102, the second image data 202 can be encoded at a high compression rate as compared with the case of using a de-facto code table. Specifically, the encoding device 1 can encode the second image data 202 in real time at a high compression rate. For example, even when the second imaging section 54 acquires the second image data 202 at a rate of about 30 frames per second, the encoding device 1 can encode the second image data 202 in real time at a high compression rate.
When the first image data 102 and the second image data 202 are similar types of image data and the variable-length code table generation section 10 generates a code table optimum for encoding the first image data 102 (i.e., the amount of the first image data 102 becomes equal to or less than a predetermined value after encoding), the second image data 202 can be encoded at a higher compression rate.
In general, variable-length code tables (symbol statistical information) generated based on pieces of image data having similar features contain similar types of data. Therefore, when the first image data 102 and the second image data 202 are similar types of data, the variable-length code table (B) optimum for the first image data 102 is optimum for encoding the second image data 202. Therefore, when the first image data 102 and the second image data 202 are similar types of image data, the second image data 202 can be encoded at a higher compression rate by encoding the second image data 202 based on the variable-length code table (B) optimum for the first image data 102.
In the invention, similar types of first image data 102 and second image data 202 can be acquired by adjacently disposing the first imaging section 52 and the second imaging section 54 to face an identical direction and acquiring the first image data 102 and the second image data 202 at close timing, for example. Therefore, the second image data 202 can be encoded at a high compression rate by setting the first and second imaging sections 52 and 54 as described above.
Note that the second image data 202 can be encoded at a high compression rate based on the variable-length code table (B) generated based on the first image data 102 even if the first and second imaging sections 52 and 54 are not adjacently disposed or disposed to face different directions. For example, when the encoding device 1 (image recording device 2) is configured as a drive recorder and the first and second imaging sections 52 and 54 are provided in one vehicle, the first image data 102 and the second image data 202 may contain components showing similar features (e.g., DC components of the Y component) even if the first and second imaging sections 52 and 54 are disposed to face different directions. Therefore, the second image data 202 can be encoded in real time at a high compression rate by utilizing the variable-length code table (B) of similar components.
The encoding device 1 (image recording device 2) may be configured so that the first imaging section 52 and the second imaging section 54 acquire (image) image data at (almost) the same timing. The first and second imaging sections 52 and 54 may be configured to acquire image data at identical time intervals, as shown in
As shown in
When the imaging time interval of the first imaging section 52 may be longer than the imaging time interval of the second imaging section 54, the encoding section 40 may generate the encoded information (E) based on the variable-length code table (B) generated based on the first image data 102 acquired immediately before the encoding target second image data 202 and held in the holding section 22, as shown in
The first imaging section 52 may be configured to acquire the first image data 102 only when the update event detection section 26 has detected that an update event has occurred, without setting the imaging time interval of the first imaging section 52. The update event detection section 26 may be configured to generate the update event detection signal when the amount of encoded information (E) has exceeded a predetermined value, for example. When the amount of encoded information (E) has exceeded a predetermined value, it may be determined that the second image data 202 has been encoded based on an inappropriate code table. Specifically, when the amount of encoded information (E) has exceeded a predetermined value, it may be determined that the environment of the encoding device 1 has changed (i.e., scene change has occurred) as compared with the time at which the variable-length code table (B) held in the holding section 22 has been generated. Therefore, if the variable-length code table (B) held in the holding section 22 is updated based on the newly acquired first image data 102 when the amount of encoded information (E) has exceeded a predetermined value, the second image data 202 subsequently acquired can be encoded at a high compression rate.
When the encoding device 1 (image recording device 2) includes the encoding section 24 which encodes the first image data 102, the encoding section 24 may encode the first image data 102 based on the variable-length code table (B) generated based on the first image data 102 which has been acquired, as shown in
4. Modifications
The invention is not limited to the above-described embodiments, and various modifications can be made. For example, the invention includes various other configurations substantially the same as the configurations described in the embodiments (in function, method and result, or in objective and result, for example). The invention also includes a configuration in which an unsubstantial portion in the described embodiments is replaced. The invention also includes a configuration having the same effects as the configurations described in the embodiments, or a configuration able to achieve the same objective. Further, the invention includes a configuration in which a publicly known technique is added to the configurations in the embodiments.
For example, the encoding device 1 may hold the symbol statistical information in the holding section 22, and the encoding section 40 may generate a variable-length code table based on the statistical information held in the holding section 22 and encode the second image data 202.
The image recording device 2 (encoding device 1) may include three or more imaging sections. The image recording device 2 (encoding device 1) may generate a code table based on image data acquired by one imaging section, and encode image data acquired by the remaining imaging sections based on the generated code table.
The resolution of the first imaging section 52 may be set to be lower than that of the second imaging section 54. Since the load of processing the first image data 102 is reduced by decreasing the resolution of the first imaging section 52, the variable-length code table (B) can be efficiently generated. Since pieces of image data may contain a common feature even when using an imaging section with a low resolution, the second image data 202 can be encoded at a high compression rate based on the variable-length code table (B) generated based on the first image data 102.
Although only some embodiments of this invention have been described in detail above, those skilled in the art will readily appreciate that many modifications are possible in the embodiments without materially departing from the novel teachings and advantages of this invention. Accordingly, all such modifications are intended to be included within the scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2007-59901 | Mar 2007 | JP | national |