IMAGE ENCODING APPARATUS AND CONTROL METHOD THEREOF

Abstract
This invention generates encoded data including lossless- and lossy-encoded data together within a unit time period while fully using the lossy encoding processing capability, by appropriately setting a threshold associated with the number of tiles. To this end, an image encoding apparatus of this invention has a lossless encoding processing unit and a lossy encoding processing unit. The lossless encoding processing unit outputs one of lossless-encoded data and non-encoded data from a selection unit to a memory based on the attribute information for each tile. Every time the total data size of non-encoded data output from the selection unit exceeds a predetermined threshold, a resolution converting unit executes processing for decreasing the resolution of the non-encoded data in the memory. Upon completion of storage of data for one page in the memory (111), a lossy encoding unit begins to generate lossy-encoded data from the non-encoded data.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.



FIG. 1 is a block diagram of an image encoding apparatus according to the first embodiment;



FIG. 2 is a block diagram of an image encoding apparatus according to the second embodiment;



FIG. 3 is a block diagram of an image encoding apparatus according to the third embodiment;



FIG. 4 is a block diagram showing an example of the arrangement of a conventional image processing apparatus;



FIG. 5 is a block diagram showing another example of the arrangement of a conventional image processing apparatus;



FIG. 6 is a timing chart of encoding processing in one embodiment;



FIGS. 7A and 7B show examples of layouts of regions which are determined to undergo lossy encoding;



FIG. 8 shows a state of an increase/decrease in non-encoded data and an increase in lossy-encoded data without resolution conversion;



FIGS. 9A to 9D show an increase/decrease in non-encoded data of respective resolutions as a result of resolution conversion (once);



FIGS. 10A to 10C show an increase/decrease in non-encoded data of respective resolutions as a result of resolution conversion (twice);



FIG. 11 shows lossless-encoded data sizes of a plurality of resolutions for two different types of images;



FIG. 12 shows a code size obtained by adding a lossy code size as a predicted value or actually measured value to a lossless code size;



FIG. 13 shows lossless-encoded data sizes of a plurality of resolutions according to the third embodiment;



FIG. 14 is a block diagram of an image encoding apparatus according to the fourth embodiment;



FIG. 15 shows transition of increases in non-encoded data size of respective resolutions on a memory;



FIG. 16 is a block diagram of an apparatus for decoding encoded data obtained by the first embodiment;



FIG. 17 is a block diagram of an apparatus for decoding encoded data obtained by the second to fourth embodiments;



FIG. 18 is a timing chart of decoding processing;



FIG. 19 is a flowchart for explaining the processing sequence of a lossless encoding phase in the first embodiment;



FIG. 20 is a flowchart for explaining the processing sequence of the lossless encoding phase in the first embodiment;



FIG. 21 is a flowchart for explaining the processing sequence of the lossless encoding phase in the first embodiment; and



FIG. 22 is a flowchart for explaining the processing sequence of a lossy encoding phase in the first embodiment.


Claims
  • 1. An image encoding apparatus comprising: determination means for determining for respective tiles whether image data of a page of interest is to be lossless-encoded or lossy-encoded;lossless encoding means for lossless-encoding tile image data which is determined by said determination means to be lossless-encoded;storage means for temporarily storing tile image data which is determined by said determination means to be lossy-encoded;resolution converting means for reducing the number of pixels of non-compressed tile image data held in said storage means so that a data size of the non-compressed tile image data held in said storage means becomes not more than a predetermined size, during lossless encoding of the image data of the page of interest; andlossy encoding means for lossy-encoding the non-compressed tile image data of the page of interest held in said storage means after completion of the lossless encoding of the image data of the page of interest.
  • 2. The apparatus according to claim 1, wherein said resolution converting means recursively applies resolution conversion to non-compressed data stored in said storage means every time a tile image data size of non-compressed data held in said storage means exceeds the predetermined size.
  • 3. The apparatus according to claim 1, wherein the predetermined size is determined depending on an encoding processing capability of said lossy encoding means.
  • 4. The apparatus according to claim 1, wherein said lossless encoding means includes: a buffer memory for temporarily storing non-compressed tile image data;second resolution converting means for reducing the number of pixels of the tile image data stored in said buffer memory in accordance with input setting information;selection means for, when said determination means determines that tile image data of interest is to be lossless-encoded, selecting lossless-encoded data generated from the tile image data of interest, for, when said determination means determines that the tile image data of interest is to be lossy-encoded, selecting the tile image data before compression stored in said buffer memory, and for outputting the selected data to said storage means;counting means for counting the number of times of selection of the tile image data stored in said buffer memory by said selection means; andupdating means for updating the setting information to be set in said second resolution converting means every time the number of times counted by said counting means exceeds one of a plurality of thresholds determined according to the predetermined size.
  • 5. A method of controlling an image encoding apparatus, comprising: a determination step of determining for respective tiles whether image data of a page of interest is to be lossless-encoded or lossy-encoded;a lossless encoding step of lossless-encoding tile image data which is determined in the determination step to be lossless-encoded;a storage step of temporarily storing tile image data which is determined in the determination step to be lossy-encoded in storage means;a resolution converting step of reducing the number of pixels of non-compressed tile image data held in the storage means so that a data size of the non-compressed tile image data held in the storage means becomes not more than a predetermined size, during lossless encoding of the image data of the page of interest; anda lossy encoding step of lossy-encoding the non-compressed tile image data of the page of interest held in the storage means after completion of the lossless encoding of the image data of the page of interest.
  • 6. An image encoding apparatus for encoding image data, comprising: lossless encoding processing means for executing lossless encoding processing for image data;lossy encoding processing means for lossy-encoding non-encoded data which are excluded from data to be encoded after completion of the lossless encoding processing for one page by said lossless encoding processing means;output means for outputting lossless-encoded data and lossy-encoded data obtained by said lossless encoding processing means and said lossy encoding processing means; andcontrol means for controlling said lossless encoding processing means and said lossy encoding processing means,wherein said lossless encoding processing means comprises:lossless encoding means for receiving image data to be encoded for each tile, and lossless-encoding tile image data of each tile;tile data holding means for temporarily holding image data of the tile to be encoded by said lossless encoding means as non-encoded data;first resolution converting means for executing resolution conversion by reducing the number of pixels of image data as non-encoded data held in said tile data holding means in accordance with a set ratio; andselection means for selecting one of the lossless-encoded data generated by said lossless encoding means and the non-encoded data stored in said tile data holding means based on attribute information of a tile of interest, and outputting the selected data to said lossy encoding processing means,said lossy encoding processing means comprises:storage means for storing non-encoded image data and lossless-encoded data which are selected by and output from said selection means;second resolution converting means for converting a resolution by reducing the number of pixels of the non-encoded image data stored in said storage means according to a ratio set in advance, and storing non-encoded image data after the resolution conversion in said storage means in place of the non-encoded image data before the resolution conversion; andlossy encoding means for lossy-encoding the non-encoded image data, andsaid control means comprises:counting means for counting the number of tiles of the non-encoded image data output from said selection means during the lossless encoding processing for one page by said lossless encoding processing means; andresolution setting means for controlling said second resolution converting means to execute resolution conversion processing every time the number of tiles counted by said counting means exceeds one of a plurality of different thresholds, setting a ratio corresponding to the number of times that the number of tiles exceeds the plurality of thresholds in said first resolution converting means, and controlling said first resolution converting means to execute resolution conversion.
  • 7. The apparatus according to claim 6, wherein said second resolution converting means halves the numbers of pixels in horizontal and vertical directions of the non-encoded image data stored in said storage means, and said resolution setting means sets (½)k in said first resolution converting means as a resolution conversion ratio (where k is the number of times that the number of tiles exceeds the threshold).
  • 8. The apparatus according to claim 6, wherein when said lossless encoding means is defined as first lossless encoding means, and said storage means is defined as first storage means, said lossless encoding processing apparatus includes:third resolution converting means for converting image data to be encoded into image data of a plurality of resolutions lower than a resolution of the image data, and outputting the image data of the plurality of resolutions; andsecond lossless encoding means for lossless-encoding the image data of the plurality of resolutions obtained by said third resolution converting means for respective tiles, and generating lossless-encoded data for respective resolutions,said lossy encoding processing means includes:second storage means for storing the lossless-encoded data for respective resolutions generated by said second lossless encoding means; andre-encoding means for re-encoding the lossy-encoded data generated by said lossy encoding means in accordance with a set parameter and generating lossy-encoded data, andsaid control means includes:lossless-encoded data determination means for determining based on a total data size of the non-encoded data stored in said first storage means and a target encoded data size which of lossless-encoded data stored in said first storage means and said second storage means are to be selected and output; andlossy encoding control means for determining a target lossy-encoded data size based on a data size of the lossless-encoded data determined by said lossless-encoded data determination means and the target encoded data size, and controlling said lossy encoding means and said re-encoding means to generate lossy-encoded data to have a size not more than the target lossy-encoded data size.
  • 9. The apparatus according to claim 8, wherein said lossless encoding processing means includes: resolution determination means for determining one of a higher resolution and a lower resolution of two different types of resolutions based on an attribute of a tile of interest; anda plurality of lossless-encoded data selection means for inputting the lossless-encoded data respectively generated by said first lossless encoding means and said second lossless encoding means, inputting two lossless-encoded data having a smallest resolution difference, and selecting one of the two lossless-encoded data based on a determination result of said resolution determination means,said lossy encoding processing means includes:third storage means for respectively storing the lossless-encoded data selected by said plurality of lossless-encoded data selection means, andsaid lossless-encoded data determination means determines the lossless-encoded data to be selected and output with also reference to said third storage means.
  • 10. The apparatus according to claim 6, wherein when said lossy encoding means starts the lossy encoding processing, said lossless encoding processing means starts lossless encoding processing for image data of a next page.
  • 11. A method of controlling an image encoding apparatus for encoding image data, comprising: a lossless encoding processing step of executing lossless encoding processing for image data;a lossy encoding processing step of lossy-encoding non-encoded data which are excluded from data to be encoded after completion of the lossless encoding processing for one page in the lossless encoding processing step;an output step of outputting lossless-encoded data and lossy-encoded data obtained in the lossless encoding processing step and the lossy encoding processing step; anda control step of controlling the lossless encoding processing step and the lossy encoding processing step,wherein the lossless encoding processing step includes:a lossless encoding step of receiving image data to be encoded for each tile, and lossless-encoding tile image data of each tile;a step of temporarily storing image data of the tile to be encoded in the lossless encoding step as non-encoded data in tile data holding means;a first resolution converting step of executing resolution conversion by reducing the number of pixels of image data as non-encoded data held in the tile data holding means in accordance with a set ratio; anda selection step of selecting one of the lossless-encoded data generated in the lossless encoding step and the non-encoded data stored in the tile data holding means based on attribute information of a tile of interest, and outputting the selected data to the lossy encoding processing step,the lossy encoding processing step includes:a step of storing non-encoded image data and lossless-encoded data which are selected by and output from the selection step in storage means;a second resolution converting step of converting a resolution by reducing the number of pixels of the non-encoded image data stored in the storage means according to a ratio set in advance, and storing non-encoded image data after the resolution conversion in the storage means in place of the non-encoded image data before the resolution conversion; anda lossy encoding step of lossy-encoding the non-encoded image data, andthe control step includes:a counting step of counting the number of tiles of the non-encoded image data output from the selection step during the lossless encoding processing for one page in the lossless encoding processing step; anda resolution setting step of controlling the second resolution converting step to execute resolution conversion processing every time the number of tiles counted in the counting step exceeds one of a plurality of different thresholds, setting a ratio according to the number of times that the number of tiles exceeds the plurality of thresholds in the first resolution converting step, and controlling the first resolution converting step to execute resolution conversion.
  • 12. An image encoding apparatus for encoding image data, comprising: lossless encoding processing means for executing lossless encoding processing for image data;lossy encoding processing means for lossy-encoding non-encoded data which are excluded from data to be encoded after completion of the lossless encoding processing for one page by said lossless encoding processing means;output means for outputting lossless-encoded data and lossy-encoded data obtained by said lossless encoding processing means and said lossy encoding processing means; andcontrol means for controlling said lossless encoding processing means and said lossy encoding processing means,wherein said lossless encoding processing means includes:lossless encoding means for receiving tile image data from image data to be encoded having a reference resolution, and lossless-encoding the tile image data;resolution converting means for generating tile image data of a plurality of different resolutions by reducing the number of pixels of the tile image data of the reference resolution, and outputting the generated tile image data as a non-encoded data group together with the tile image data of the reference resolution;selection means for selecting one of the lossless-encoded data generated by said lossless encoding means and the non-encoded data group based on attribute information of a tile, and outputting the selected data to said lossy encoding processing means,said lossy encoding processing means includes:storage means for storing the non-encoded image data group and the lossless-encoded data selected by and output from said selection means; andlossy encoding means for lossy-encoding tile image data corresponding to a resolution designated by said control means, andsaid control means includes:counting means for counting a total tile image data size of respective resolutions output from said selection means during the lossless encoding processing for one page by said lossless encoding processing means; anddetermination means for determining a resolution to be set in said lossless encoding processing means based on the total tile image data size of the respective resolutions counted by said counting means upon completion of the processing for one page by said lossless encoding processing means.
  • 13. The apparatus according to claim 12, wherein said determination means determines the reference resolution as an initial candidate resolution to be set in said lossy encoding means, and reduces a candidate resolution to be set in said lossy encoding means stepwise every time the total tile image data size of the respective resolutions counted by said counting means exceeds a pre-set threshold.
  • 14. A method of controlling an image encoding apparatus for encoding image data, comprising: a lossless encoding processing step of executing lossless encoding processing for image data;a lossy encoding processing step of lossy-encoding non-encoded data which are excluded from data to be encoded after completion of the lossless encoding processing for one page in the lossless encoding processing step;an output step of outputting lossless-encoded data and lossy-encoded data obtained in the lossless encoding processing step and the lossy encoding processing step; anda control step of controlling the lossless encoding processing step and the lossy encoding processing step,wherein the lossless encoding processing step includes:a lossless encoding step of receiving tile image data from image data to be encoded having a reference resolution, and lossless-encoding the tile image data;a resolution converting step of generating tile image data of a plurality of different resolutions by reducing the number of pixels of the tile image data of the reference resolution, and outputting the generated tile image data as a non-encoded data group together with the tile image data of the reference resolution;a selection step of selecting one of the lossless-encoded data generated in the lossless encoding step and the non-encoded data group based on attribute information of a tile, and outputting the selected data to the lossy encoding processing step,the lossy encoding processing step includes:a step of storing, in storage means, the non-encoded image data group and the lossless-encoded data selected by and output from the selection step; anda lossy encoding step of lossy-encoding tile image data corresponding to a resolution designated in the control step, andthe control step includes:a counting step of counting a total tile image data size of respective resolutions output from the selection step during the lossless encoding processing for one page in the lossless encoding processing step;a determination step of determining a resolution to be set in the lossless encoding processing step based on the total tile image data size of the respective resolutions counted in the counting step upon completion of the processing for one page in the lossless encoding processing step.
Priority Claims (1)
Number Date Country Kind
2006-056904 Mar 2006 JP national