WO2012029208A1 - 画像符号化方法、画像復号化方法、画像符号化装置及び画像復号化装置 - Google Patents

画像符号化方法、画像復号化方法、画像符号化装置及び画像復号化装置 Download PDF

Info

Publication number
WO2012029208A1
WO2012029208A1 PCT/JP2011/002286 JP2011002286W WO2012029208A1 WO 2012029208 A1 WO2012029208 A1 WO 2012029208A1 JP 2011002286 W JP2011002286 W JP 2011002286W WO 2012029208 A1 WO2012029208 A1 WO 2012029208A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
quantization
value
quantization width
unit
Prior art date
Application number
PCT/JP2011/002286
Other languages
English (en)
French (fr)
Inventor
小川真由
北村臣二
Original Assignee
パナソニック株式会社
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by パナソニック株式会社 filed Critical パナソニック株式会社
Priority to CN201180041297.0A priority Critical patent/CN103081469B/zh
Publication of WO2012029208A1 publication Critical patent/WO2012029208A1/ja
Priority to US13/778,663 priority patent/US10223811B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/008Vector quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof

Definitions

  • the present invention relates to an image encoding method and apparatus for the purpose of speeding up data transfer by image compression and reducing the amount of memory used in an apparatus that handles images such as a digital still camera and a network camera.
  • an imaging device such as a digital camera or a digital video camera
  • the image is recorded in an external recording device such as an SD card.
  • the image to be recorded is compressed, and a larger image size and a larger number of image data are stored in an external recording device having the same capacity as compared with the case of non-compression.
  • an encoding method such as JPEG or MPEG is used for the compression processing.
  • Patent Document 1 when image data compression processing is also applied to pixel signals (RAW data) input from an image sensor, the number of pixels in the image sensor increases and the load of signal processing increases.
  • RAW data pixel signals
  • an object is to reduce the bus bandwidth required for writing to and reading from the memory and to enable high-speed operation.
  • a fixed-length encoding method is employed to guarantee the bus bandwidth and reduce the amount of compression processing.
  • the maximum value and the minimum value are calculated from the pixel data of an arbitrary image area, the local dynamic range in the area is obtained, and the calculated minimum value is subtracted from all the pixels in the area.
  • the image data is fixed-length encoded by quantizing the value with a quantization width corresponding to the obtained dynamic range.
  • the number of continuous shots generally depends on the number of RAW data that can be stored in the buffer memory. Therefore, by compressing the RAW data, the amount of memory used can be suppressed and the number of continuous shots can be increased. It is an object. Also in Patent Document 2, fixed-length encoding is adopted to guarantee the number of continuous shots, and the mounting method is determined by determining a quantization width from a difference value with an adjacent pixel, and uniquely from the quantization width. An image code that realizes compression processing without requiring a memory and securing a low coding processing load in order to determine the quantization processing value by subtracting the obtained offset value from the pixel value to be compressed. An encoding device and a decoding device are provided.
  • Patent Document 3 also describes compression of RAW data, and the problem is how to handle defective pixels of an image sensor.
  • Patent Document 3 provides an image encoding device that performs encoding so that defective pixels can be correctly detected and corrected in subsequent image processing even when pixel data including information indicating defective pixels is input. .
  • the mounting method if it is a defective pixel, it is assigned to a specific quantization representative value, and if it is not a defective pixel, it is assigned to a quantization value excluding the specific quantization representative value and encoded.
  • Information that is a defective pixel is reversibly encoded and decoded, and can be reliably restored in subsequent processing to be corrected correctly.
  • the difference value from the minimum value in the same region is quantized, and the quantization width increases as the dynamic range in the region increases.
  • This uses the visual characteristic that when the dynamic range in the region is wide, there is a high possibility that the image is greatly changed, and a fine level change is difficult to visually detect.
  • a defective pixel of an image sensor such as a white scratch is present in a dark image
  • the difference between the maximum value and the minimum value becomes extremely large in a region including the defective pixel.
  • the region including the defective pixel is determined to have a wide dynamic range regardless of the change of the subject. Then, all the pixels included in the region are uniformly quantized using a large quantization width, and there is a problem that it is visually perceived as a large deterioration.
  • the quantization width is determined by the maximum value of the difference value between the compression target pixel and the immediately preceding pixel, and the quantization is performed.
  • FIG. 1 is a block diagram showing a configuration of a digital signal processing circuit 100 including an image encoding / decoding device disclosed in Patent Document 3.
  • Patent Document 3 aims to speed up processing by reducing the bus bandwidth when writing and reading RAW data into the memory. Accordingly, the pixel data preprocessed by the preprocessing unit 103 is compressed by the image encoding device 101 and stored in the memory 105, and the image decoding device 102 decompresses the pixel data stored in the memory 105. The signal is sent to the signal processing unit 104.
  • Patent Document 3 if the pixel value is a specific pixel value in the image encoding device 101, it is determined that the pixel is a defective pixel, and is encoded by being assigned to a specific quantized representative value. Then, in the image decoding apparatus 102, when the encoded quantized representative value is a specific quantized representative value, the image decoding apparatus 102 assigns a specific pixel value as a defective pixel and decodes the defective pixel. Is reversibly encoded and decoded. However, in Patent Document 3, it is assumed that the position of the defective pixel in the image is detected in advance in the pre-processing unit 103, and the pixel value is assigned to a specific pixel value. No mention is made of the case where the image is input to the image encoding apparatus 101 as it is.
  • pixel data input from an image sensor is temporarily stored in a memory such as SDRAM (Synchronous Dynamic Random Access Memory). Then, predetermined image processing, YC signal generation, zoom processing such as enlargement / reduction, and the like are performed on the temporarily stored pixel data, and the processed pixel data is temporarily stored in the SDRAM again. At that time, it is often required to read out pixel data of an arbitrary region from a memory, for example, when an arbitrary region of an image is cut out or when image signal processing that requires reference / correlation between upper and lower pixels is performed.
  • SDRAM Synchronous Dynamic Random Access Memory
  • the present invention has been made in view of the above-described problems, and the object of the present invention is to reduce the quantization width in a pixel unit in a quantization process while maintaining random accessibility by an image coding method employing fixed-length coding. By adaptively switching, the influence of the occurrence of defective pixels or steep edges is prevented from propagating to a flat region.
  • an image encoding method of the present invention is an image encoding method for inputting pixel data of a pixel to be compressed and compressing the input pixel data.
  • a quantization step for compressing the pixel data into the quantization value by quantizing the quantization value into a quantization value having a smaller number of bits than the pixel data, and determining a quantization width in the quantization step A quantization width determining step, wherein the quantization width determining step determines whether a flat portion and an edge portion are mixed in a group unit composed of a plurality of the pixels. And, characterized by adaptively switching that the quantization width in the quantization step in a pixel unit based on the determination result.
  • the quantization width in the quantization processing is adaptively switched on a pixel basis based on the determination result. Even in a region where a sharp edge is generated, it is possible to suppress the propagation of the quantization error to a flat region.
  • the image coding method can be realized even by fixed-length coding. Therefore, even when a plurality of generated fixed-length coded data is stored in, for example, a memory or the like, a specific image in the image is also recorded.
  • the encoded data corresponding to the pixel at the location can be easily specified, and as a result, the random accessibility to the encoded data can be maintained. That is, according to the present invention, it is possible to suppress deterioration in image quality in a region where defective pixels or steep edges are generated, while maintaining random accessibility to the memory.
  • the image coding method of the present invention it is possible to suppress the propagation of a quantization error to a flat region even in a region where a defective pixel or a steep edge occurs. is there.
  • FIG. 1 is a block diagram illustrating a digital signal processing circuit disclosed in Patent Document 3.
  • FIG. 2 is a flowchart showing an image encoding method according to the first embodiment of the present invention.
  • FIG. 3 is a block diagram showing the configuration of the image coding apparatus according to the embodiment.
  • FIG. 4 is a flowchart showing a quantization width determination method in the image coding method according to the embodiment.
  • FIG. 5 is a diagram illustrating a prediction formula in a prediction pixel generation unit provided in the image encoding device.
  • FIG. 6A is a diagram showing an example of image encoding processing and each calculation result in the embodiment.
  • FIG. 6B is a diagram showing a conventional image encoding process example to which the embodiment is not applied and each calculation result.
  • FIG. 7 shows a bit image of the difference value and the quantized value in the image encoding process
  • FIG. 7A shows the difference corresponding to the encoding target pixel determined that the flat portion and the edge portion are not mixed in the same group.
  • the figure which shows the bit image of value D and a quantization value is a figure which shows the bit image of an edge pixel
  • the figure (c) is a figure which shows the bit image of pixels other than an edge pixel.
  • FIG. 8 is a diagram showing quantization information in the embodiment.
  • FIG. 9A shows a bit image before image encoding
  • FIG. 9B shows a bit image after image encoding.
  • FIG. 10 is a flowchart showing image decoding processing in the embodiment.
  • FIG. 10 is a flowchart showing image decoding processing in the embodiment.
  • FIG. 11 is a block diagram showing the configuration of the image decoding apparatus in the embodiment.
  • FIG. 12 is a diagram showing an example of image decoding processing and each calculation result in the embodiment.
  • FIG. 13 is a diagram showing a selection pattern of the edge portion quantization width and the flat portion quantization width in the second embodiment of the present invention.
  • FIG. 14 shows a bit image of a difference value and a quantization value in the embodiment
  • FIG. 14A shows a bit image of an edge pixel
  • FIG. 14B shows a bit image of a pixel other than the edge pixel.
  • FIG. FIG. 15 is a diagram showing quantization information in the embodiment.
  • FIG. 16 is a block diagram showing a configuration of a digital still camera according to Embodiment 3 of the present invention.
  • FIG. 17 is a block diagram showing a configuration of a digital still camera according to Embodiment 4 of the present invention.
  • FIG. 18 is a block diagram showing a configuration of a surveillance camera according to Embodiment 5 of the present invention.
  • FIG. 19 is a block diagram showing a configuration of a surveillance camera according to Embodiment 6 of the present invention.
  • FIG. 20 is a flowchart showing a quantization width determination method in the image decoding method according to the first embodiment of the present invention.
  • the image encoding device 300 shown in FIG. 3 is provided in a solid-state image sensor, for example.
  • FIG. 2 is a flowchart showing an image encoding method according to the first embodiment of the present invention.
  • FIG. 3 is a block diagram showing the configuration of the image coding apparatus according to Embodiment 1 of the present invention.
  • Pixels to be encoded are input to the processing target pixel value input unit 301.
  • each pixel data is N-bit digital data
  • pixel data after quantization corresponding to each pixel data (hereinafter referred to as a quantized value) is M-bit length.
  • a code representing the pixel value (hereinafter referred to as initial pixel value) of the first encoding target pixel of at least one pixel, the quantization value corresponding to a plurality of pixel data, and the quantization width information of the quantization value (Hereinafter referred to as quantization information) is packed into an S bit length by the packing unit 305. Then, the packed packing data is output from the image encoding device 300.
  • the pixel data input to the processing target pixel value input unit 301 is output from the processing target pixel value input unit 301 to the prediction pixel generation unit 302 and the difference calculation unit 303 at an appropriate timing.
  • the processing target pixel value input unit 301 omits the quantization process and receives the received code.
  • the conversion target pixel is directly output to the packing unit 305 as an N-bit long initial pixel value.
  • the initial pixel value is a reference value for calculating the difference. In the present embodiment, at least one initial pixel value is inserted for each S-bit-length packing data.
  • the process proceeds to the predicted pixel generation process.
  • the pixel data input to the prediction pixel generation unit 302 is the initial pixel value input before the target encoding target pixel, or the previous encoding target pixel or the previous encoding target pixel. Or any of the pixel data that has been sent to an image decoding apparatus (to be described later) and decoded.
  • the predicted pixel generation unit 302 generates a predicted value of the target encoding target pixel using the input pixel data (step (predicted pixel generation step) S102 in FIG. 2).
  • predictive encoding is an encoding method for pixel data.
  • Predictive coding is a coding method in which a prediction value for a pixel to be coded is generated and a difference value between the pixel value of the pixel to be coded and the prediction value is coded.
  • predictive coding when the input is pixel data, neighboring pixel data is based on the fact that the value of the target pixel to be focused on and the value of a neighboring pixel are the same or close to each other.
  • FIG. 5 is a diagram illustrating an arrangement of adjacent pixels used for calculation of a predicted value.
  • “X” in FIG. 5 indicates the pixel value of the target pixel to be encoded.
  • “A”, “b”, and “c” are pixel values of three adjacent pixels for obtaining the predicted value “y” of the encoding target pixel.
  • commonly used prediction formulas (1) to (7) are shown.
  • the prediction pixel generation unit 302 calculates a prediction value using any one of the prediction formulas (1) to (7) used in the prediction encoding described above, and outputs the prediction value to the difference value calculation unit 303. If the internal memory buffer that can be used in the compression process is not limited to the prediction formula described above, peripheral pixels other than the pixels adjacent to the encoding target pixel are also held in the memory buffer, By using it for prediction, it is possible to improve prediction accuracy. In the present embodiment, as an example, the prediction formula (1) is used in step S102.
  • the difference value calculation unit 303 calculates a difference value D between the pixel value of the encoding target pixel received from the processing target pixel value input unit 301 and the prediction value received from the prediction pixel generation unit 302, and obtains a prediction error.
  • the difference value calculated in step S103 of FIG. 2 is output to the quantization width determination unit 306 and the quantization processing unit (quantization unit) 304.
  • the quantization width determination unit 306 based on the difference value D corresponding to each encoding target pixel received from the difference value calculation unit 303, the quantization width (hereinafter referred to as the quantization value D) of the encoding target pixel of interest. , Called unit quantization width Q).
  • the unit quantization width Q is a bit of the quantized value from a value obtained by adding 1 to the number of digits (bit number) when the absolute value of the difference value D (hereinafter referred to as the difference absolute value) is expressed in binary code.
  • the value obtained by subtracting the length M That is, it is equal to the difference between the number of bits required for the signed integer binary representation of the difference value D and the bit length M of the quantized value.
  • Q is a positive integer, and when the number of bits of the difference value D is smaller than M, Q is set to “0” (step S104 in FIG. 1).
  • the unit quantization width Q is a value for determining a substantial quantization width, and is not the quantization width itself in the quantization process.
  • the calculated unit quantization width Q is input to the initial quantization width calculation unit 307, the edge portion quantization width calculation unit 308, the edge determination unit 309, and the edge pixel determination unit 310 in the quantization width determination unit 306. .
  • step S105 the quantization width determination unit 306 determines whether or not all the unit quantization widths Q have been determined for pixel data (a plurality of encoding target pixels) having a predetermined number of pixels Pix_G. .
  • step S105 If the determination result of this determination is NO in step S105, the process proceeds to step S102, and at least the process from step S102 to step S104 is performed on the encoding target pixel received by the processing target pixel value input unit 301. Execute one process. On the other hand, if the decision result in the step S105 is YES, the process moves to a step S106.
  • FIG. 4 is a flowchart showing a quantization width determination method according to the present embodiment, and shows details of the processing in step (quantization width determination step) S106. With reference to FIG. 4, the quantization width determination process in step S106 will be described.
  • step S106 in the quantization width determination unit 306, the quantization width selection unit 311 sets the quantization width corresponding to the encoding target pixel to the initial quantization width that is the output result of the initial quantization width calculation unit 307.
  • the edge quantization width and the flat quantization width which are output results of the edge quantization width calculation unit 308 are selected.
  • step S201 the initial quantization width calculation unit 307 is a group unit composed of the number of pixels Pix_G, and is used for quantization of any encoding target pixel of the group. Is calculated and determined as an initial quantization width (first quantization width). Specifically, the quantization width Q_MAX which is the maximum width among the Pix_G unit quantization widths Q corresponding to the Pix_G encoding target pixels in the group is set as the initial quantization width.
  • step S202 the initial quantization width is determined in step S201.
  • step (edge part quantization width calculation step) S202 the edge part quantization width calculation unit 308 calculates the quantization width to be used when the flat pattern and the edge part are mixed in the pattern of the group. That is, the edge portion quantization width calculation unit 308 has an edge portion quantization width (second quantization width) that is a quantization width in the edge portion quantization processing and a quantization width in the flat portion quantization processing. Two quantization widths, the flat portion quantization width (third quantization width), are calculated. Specifically, the edge quantization width calculation unit 308 sets the quantization width obtained by adding 1 to the initial quantization width as the edge quantization width, and sets a value smaller than the initial quantization width as the flat portion quantization width. Set. When the edge part quantization width and the flat part quantization width are determined in step S202, the process proceeds to step S203.
  • step (edge determination step) S203 the edge determination unit 309 determines whether or not the pattern of the group to which the encoding target pixel belongs includes a flat portion and an edge portion.
  • the edge determination unit 309 includes a quantization width Q_MAX that is the maximum width of the Pix_G unit quantization widths Q corresponding to the Pix_G encoding target pixels in the group, and a quantization width Q_MIN that is the minimum width. Take the difference. If the difference is equal to or greater than a predetermined threshold (first threshold) TH1, it is determined that the flat part and the edge part are mixed in the pattern in the group of interest.
  • first threshold predetermined threshold
  • step S203 If it is determined in step S203 whether or not the flat portion and the edge portion are mixed, the process proceeds to step S204.
  • step (edge pixel determination step) S204 the edge pixel determination unit 310 determines whether each pixel to be encoded in the group is a pixel in which an edge is generated (hereinafter referred to as an edge pixel).
  • an edge pixel since the difference value between the pixel value of the encoding target pixel and the predicted value is sufficiently large, the value of the unit quantization width Q corresponding to the encoding target pixel is a predetermined threshold (fourth threshold). When it is equal to or higher than TH2, it is determined as an edge pixel.
  • the edge pixel in the group is determined, the process proceeds to step S205.
  • steps S201 to S204 may be performed in parallel.
  • step S205 when it is determined from the determination result of the edge determination unit 309 that the pattern of the group to which the pixel to be encoded belongs includes a flat portion and an edge portion (YES in step S205). ), The process proceeds to step S207. On the other hand, if the determination result is NO in Step S205, the process proceeds to Step S206 described later.
  • step S207 if the encoding target pixel of interest is an edge pixel based on the determination result of the edge pixel determination unit 310, the process proceeds to step S208.
  • step S208 since the encoding target pixel of interest is an edge pixel, the edge quantization width calculated by the edge quantization width calculation unit 308 is selected as the quantization width corresponding to the encoding target pixel. To do. If the determination result of this determination is NO in Step S207, the process proceeds to Step S209.
  • step S209 since the encoding target pixel of interest can be determined to be a flat portion in which the edge is close based on the determination result of the edge determination unit 309 and the determination result of the edge pixel determination unit 310, the encoding target pixel
  • the flat portion quantization width calculated by the edge portion quantization width calculation unit 308 is selected as the quantization width corresponding to.
  • step S205 If the determination result in step S205 is NO, the pattern of the group to which the encoding target pixel belongs is entirely flat, or the difference value between the prediction value and the pixel value of the encoding target pixel is large. It can be determined that such a change is a complicated picture that occurs in a plurality of areas. That is, since the initial quantization width is originally a small quantization width or the picture is complicated, even if all the pixels to be encoded in the group are uniformly quantized with a large quantization width, It can be said that this is a condition in which deterioration is hardly detected. For this reason, in step S206, all the quantization widths corresponding to the encoding target pixels in the group are set to the initial quantization width calculated by the initial quantization width calculation unit 307.
  • step S107 When the quantization width corresponding to each pixel is determined, the process proceeds to step S107.
  • step (quantization step) S107 the quantization processing unit 304 performs quantization processing.
  • the quantization processing unit 304 quantizes the difference value D between the pixel value of the encoding target pixel received from the difference value calculation unit 303 and the predicted value based on the quantization width determined by the quantization width selection unit 311. Quantization processing is performed.
  • the quantization process is a process of bit-shifting the difference value D by the number of quantization widths.
  • the quantization processing unit 304 does not perform quantization when the quantization width is “0”.
  • the quantized value output from the quantization processing unit 304 is sent to the packing unit 305.
  • step S108 it is determined whether or not all the quantization processing has been completed for the pixel number Pix_G of the encoding target pixels in the group. If NO in step S108, the process proceeds to step S107, and the quantization process in step S107 is performed on the next pixel to be encoded in the same group. On the other hand, if YES in step S108, the process proceeds to step S109.
  • step (packing step) S109 the packing unit 305 combines at least one initial pixel value, a plurality of quantized values, and at least one J-bit length (J is a natural number) quantization information. And packing into S bits. Further, when it is determined by the determination result in the edge determination unit 309 that the flat portion and the edge portion are mixed, an edge flag is embedded in the quantized value by 1 bit.
  • the packing unit 305 outputs the packed packing data to an external memory such as an SDRAM or an image decoding device described later.
  • the fixed bit length S to be set may be the same number of bits as the number of bits of the data transfer bus width of the integrated circuit to be used. If unused bits remain in the rear part of the packing data bits, dummy data is recorded so as to reach the S bits.
  • FIG. 6 is a diagram for explaining the image encoding processing in the present embodiment.
  • FIG. 6A is an example of an image encoding process according to the present embodiment
  • FIG. 6B is an example of a conventional image encoding process to which the present embodiment is not applied.
  • the fixed bit length S to be set is 48 bits.
  • the number of pixels Pix_G constituting one group is “5”, for example.
  • FIG. 6A shows pixel data of six encoding target pixels (hereinafter referred to as encoding target pixel data) input to the processing target pixel value input unit 301 as an example. It is assumed that 10-bit pixel data corresponding to each pixel is input to the processing target pixel value input unit 301 in the order of the pixels P1, P2,. Numerical values (150, etc.) shown in the pixels P1 to P6 are signal levels indicated by the pixel data. Note that the pixel data corresponding to the pixel P1 is the first pixel to be encoded, and the pixel value is the initial pixel value.
  • the prediction value of the encoding target pixel is calculated by the prediction pixel generation unit 302 using the prediction formula (1) as an example.
  • the calculated predicted value of the encoding target pixel is the value of the pixel adjacent to the left of the encoding target pixel (a in FIG. 5). That is, the predicted pixel generation unit 302 predicts that there is a high possibility that the pixel value of the encoding target pixel will be the same pixel value (signal level) as the pixel input immediately before.
  • step S101 the processing target pixel value input unit 301 determines whether or not the input encoding target pixel data is an initial pixel value. If the determination is YES in step S101, the processing target pixel value input unit 101 stores the received pixel data in an internal buffer, and the processing target pixel value input unit 301 stores the input pixel data in the packing unit 305. Send to. And a process transfers to step S109 mentioned later. On the other hand, if the determination is NO in step S101, the process proceeds to step S102.
  • the processing target pixel value input unit 301 receives pixel data corresponding to the pixel P1 as an initial pixel value.
  • the processing target pixel value input unit 301 stores the input pixel data in an internal buffer, and the processing target pixel value input unit 301 transmits the received pixel data to the packing unit 305.
  • the processing target pixel value input unit 301 overwrites and stores the received pixel data in the internal buffer.
  • the processing target pixel value input unit 301 has received the encoding target pixel data corresponding to the pixel P2. It is assumed that the pixel value indicated by the encoding target pixel data is “1023” (see FIG. 6A). In this case, since the received pixel data is not the initial pixel value (NO in step S101), the processing target pixel value input unit 301 transmits the received pixel data to the difference value calculation unit 303.
  • step S101 the processing target pixel value input unit 301 transmits the pixel data stored in the internal buffer to the predicted value pixel generation unit 302.
  • the transmitted pixel data indicates the pixel value “150” of the pixel P1.
  • processing target pixel value input unit 301 overwrites and stores the received pixel data in an internal buffer. Then, the process proceeds to step S102.
  • the predicted value pixel generation unit 302 calculates the predicted value of the encoding target pixel. Specifically, as described above, the predicted value pixel generation unit 302 calculates a predicted value using, for example, the prediction formula (1). In this case, the pixel value (“150”) of the pixel P1 received from the processing target pixel value input unit 301 by the predicted value pixel generation unit 302 is calculated as the predicted value. The predicted value pixel generation unit 302 transmits the calculated predicted value “150” to the difference value calculation unit 303.
  • the difference value calculation unit 303 performs a difference value calculation process. Specifically, the difference value calculation unit 303 subtracts the prediction value received from the prediction value pixel generation unit 302 from the encoding target pixel data received from the processing target pixel value input unit 301 to calculate the difference value D. .
  • the pixel value of the received encoding target pixel data is “1023” and the predicted value is “150”.
  • a difference value D “873” is calculated by subtracting the prediction value (“150”) from the encoding target pixel data (“1023”).
  • the difference value calculation unit 303 transmits the calculated difference value D to the quantization processing unit 304 and the quantization width determination unit 306, respectively.
  • the quantization width determination unit 306 obtains a unit quantization width Q for each input pixel.
  • the quantization width determination unit 306 obtains a value obtained by adding 1 to the number of digits when the difference absolute value of the difference value D is expressed in binary code, that is, the number of bits of the difference value D.
  • a value obtained by subtracting the bit length M of the quantized value from the number of bits of the difference value D is defined as a unit quantization width Q.
  • the difference value D is “873”.
  • the absolute difference value is “873”, and the number of bits is 10 bits.
  • Q 10 + 1 ⁇ 7 and the unit quantization width Q of the pixel P2 is “4”.
  • the quantization width determination unit 306 converts the obtained unit quantization width Q into an initial quantization width calculation unit 307 in the quantization width determination unit 306, an edge portion quantization width calculation unit 308, an edge determination unit 309, and an edge pixel. Each is transmitted to the determination unit 310.
  • step S105 the quantization width determination unit 306 determines whether or not all the unit quantization widths Q have been determined for the pixel data of the number of pixels Pix_G constituting the group.
  • the target encoding target pixel is the pixel P2 and the number of pixels Pix_G is “5”.
  • the determination result is NO, and the process proceeds to step S102.
  • the processing from step S102 to step S104 is performed on the pixel data of the pixel (P3) received by the processing target pixel value input unit 301.
  • the determination in step S105 is YES, and the process proceeds to step S106.
  • step S106 in the quantization width determination unit 306, the quantization width selection unit 311 determines the quantization width corresponding to the encoding target pixel as the initial quantization width, the edge portion quantization width, and the flat portion quantization width. From this, selection is made based on edge presence / absence information and an edge flag.
  • step S106 first, the process of step S201 is performed.
  • the initial quantization width calculation unit 307 calculates the maximum quantization width from the Pix_G unit quantization widths Q corresponding to the Pix_G pixels in the group. Calculated as Q_MAX.
  • the maximum quantization width Q_MAX is “4”. “Become.
  • the maximum quantization width Q_MAX calculated here is set by the quantization width determination unit 306 as an initial quantization width that is a common quantization width for all the pixels in the group. That is, the initial quantization width of any of the encoding target pixels belonging to the group is the maximum quantization width Q_MAX.
  • the edge portion quantization width calculation unit 308 causes the edge portion quantization width that is the quantization width in the edge portion quantization processing and the flat portion that is the quantization width in the flat portion quantization processing.
  • the quantization width is calculated.
  • the edge quantization width is a quantization width obtained by adding 1 to the initial quantization width.
  • the edge portion quantization width is “5”.
  • the flat portion quantization width is a quantization width in the quantization processing of the flat portion, and is a quantization width used in the quantization processing of the encoding target pixel other than the edge pixel. Whether or not the pixel is an edge pixel is determined by the edge pixel determination unit 310 by a process described later. As a determination method at that time, when the value of the unit quantization width Q is equal to or larger than a predetermined threshold (fourth threshold) TH2, it is determined as an edge pixel.
  • the flat part quantization width is set to a quantization width smaller than the initial quantization width for the purpose of reducing the quantization error in the region other than the edge pixel. For example, the quantization width is set to “2”.
  • the edge determination unit 309 determines whether or not the pattern of the group includes a flat portion and an edge portion.
  • the edge determination unit 309 calculates a difference between a quantization width Q_MAX that is the maximum width of the Pix_G unit quantization widths Q in the group and a quantization width Q_MIN that is the minimum width, and the difference is a predetermined threshold value. If (first threshold) TH1 or more, it is determined that the pattern in the group of interest contains a mixture of flat areas and edges.
  • the maximum quantization width Q_MAX in the group is “4” and the minimum quantization width Q_MIN is “0”.
  • the value of the threshold value TH1 for determining the edge is “3”.
  • a threshold (second threshold) TH3 and a threshold corresponding to the maximum quantization width Q_MAX and the minimum quantization width Q_MIN in the group may be set in advance.
  • the threshold value TH3 represents the threshold value of the difference value D for defining the edge portion
  • the threshold value TH4 represents the threshold value of the difference value D for defining the flat portion. Therefore, when the maximum quantization width Q_MAX is equal to or greater than the threshold value TH3 and the minimum quantization width Q_MIN is equal to or less than the threshold value TH4, it can be determined that the flat portion and the edge portion are mixed.
  • the edge determination unit 309 transmits edge presence / absence information to the quantization width selection unit 311.
  • the edge pixel determination unit 310 determines whether or not the target pixel to be encoded is an edge pixel.
  • the edge pixel determination unit 310 determines that the pixel is an edge pixel, and transmits the determination result to the quantization width selection unit 311 as an edge flag.
  • the edge flag is set to “1” when the pixel is an edge pixel, and is set to “0” when the pixel is not an edge pixel.
  • the value of the threshold value TH2 is “2”. In FIG.
  • the unit quantization widths Q of the pixels P2 to P6 are “4”, “4”, “0”, “0”, “0”, and therefore the threshold value TH2 is “2”.
  • a pixel to be encoded having a threshold value TH2 or more is determined as an edge pixel, and the values of the edge flags are “1”, “1”, “0”, “0”, “0”.
  • the edge pixel determination unit 310 transmits the calculated edge flag to the quantization width selection unit 311, the process proceeds to step S205.
  • steps S201 to S204 is an executable process if all the unit quantization widths Q corresponding to the encoding target pixels in the group are calculated, and therefore, the initial quantization width calculation unit 307, When all the unit quantization widths Q are input to the edge quantization width calculation unit 308, the edge determination unit 309, and the edge pixel determination unit 310, they may be performed in parallel.
  • step S205 based on the determination result of the edge determination unit 309 in step S203 described above, it is determined whether or not the flat portion and the edge portion are mixed in the pattern of the group to which the encoding target pixel belongs.
  • the quantization width selection unit 311 receives the initial quantization width “4”, the edge portion quantization width “5”, and the flat portion quantization width “2”. Further, it is assumed that the edge determination unit 309 determines that the flat portion and the edge portion are mixed in the pattern of the group to which the pixel to be encoded belongs. Further, it is assumed that the value of the edge flag received from the edge pixel determination unit 310 by the quantization width selection unit 311 is “1”.
  • step S205 since it is determined that the flat portion and the edge portion are mixed, YES is determined in step S205, and the process proceeds to step S207.
  • step S207 since the value of the edge flag is “1”, it is determined YES, and the process proceeds to step S208.
  • step S208 the quantization width “5”, which is the edge quantization width, is selected as the quantization width corresponding to the encoding target pixel, and the quantization width determination process for the pixel P2 ends.
  • step S107 the quantization processor 304 quantizes the difference value D received from the difference value calculator 303 using the quantization width determined by the quantization width selector 311.
  • the quantization width received by the quantization processor 304 from the quantization width selector 311 is Q_Fixed
  • the difference value D is bit-shifted downward by the number of the quantization width Q_Fixed. Is equivalent to the process of dividing the difference value D by 2 to the power of Q_Fixed.
  • the difference value D is “873” and the quantization width is “5”.
  • the quantization processing unit 304 performs the quantization processing by dividing “873” by 2 to the fifth power, and calculates the quantization value “5”.
  • the circuit scale of the image encoding device 300 can be reduced by using a bit shifter.
  • the prediction pixel generation process (step S102 in FIG. 2) in the prediction pixel generation unit 302 calculates the prediction value again, and performs encoding.
  • the target difference value may be obtained and corrected. Specifically, when the predicted value of the h-th encoding target pixel is calculated, if the (h-1) -th pixel data is the initial pixel value, the (h-1) -th pixel data indicates The value itself is the predicted value.
  • the image encoding device 300 causes the encoded (h ⁇ 1) th data to be input to the image decoding device described later.
  • the pixel value indicated by the pixel data obtained by decoding may be used as the predicted value.
  • the predicted pixel generation unit 302 represents a difference value when pixel data obtained by the image decoding process is used as a predicted value as a compression target value, and transmits it to the quantization processing unit 304.
  • the compression target value illustrated in FIG. 6A is a value that is a target for the quantization processing unit 304 to execute the quantization process in step S107, and a decoding result and an input value (encoding target pixel). Data) and the difference value.
  • step S108 it is determined whether or not all the quantization processes have been completed for the number of pixels Pix_G in the group.
  • the encoding target pixel of interest is the pixel P2.
  • step S108 NO is determined, and the process proceeds to step S107.
  • Subsequent processing is image coding processing of the pixel P3 and overlaps with the processing described above, and thus detailed description will not be repeated.
  • the initial quantization width, the edge portion quantization width, the flat portion quantization width, and the information on the presence / absence of the edge are values common to the group, and are not changed.
  • the value of the edge flag received by the quantization width selection unit 311 from the edge pixel determination unit 310 is “0”.
  • step S205 since it is determined that the flat portion and the edge portion are mixed, it is determined YES, and the process proceeds to step S207.
  • step S207 since the value of the edge flag is “0”, it is determined as NO, and the process proceeds to step S209.
  • the quantization width “2” that is the flat portion quantization width is selected as the quantization width corresponding to the encoding target pixel, and the quantization width determination process for the pixel P4 ends.
  • the quantization width determination unit 306 determines the quantization width corresponding to each encoding target pixel for the encoding target pixels having the number of pixels Pix_G in the group. Execute quantization processing.
  • step S109 when the packing unit 305 determines that the flat part and the edge part are mixed by the edge determination unit 309, the packing part 305 embeds one bit of the edge flag in the quantized value. Then, an initial pixel value of at least one pixel, a plurality of quantized values, and at least one quantized information are combined and packed into S bits. Further, the packing unit 305 encodes the quantization width information received from the quantization width determination unit 306 and generates quantization information having a bit length J.
  • FIG. 7 is a diagram illustrating a bit image of the difference value D and the quantization value in the image encoding process of the present embodiment. Then, the quantization processing unit 304 executes the quantization process to indicate in which bit position the bit data of the difference value D is stored as the bit data of the quantization value.
  • FIG. 7A shows a bit image of the difference value D and the quantized value corresponding to the pixel to be encoded, which is determined by the edge determination unit 309 that the flat part and the edge part are not mixed in the same group.
  • FIG. 7B shows an edge pixel of this embodiment
  • FIG. 7C shows a bit image of a pixel other than the edge pixel of this embodiment.
  • bit length N of the pixel data input by the processing target pixel value input unit 301 is 10 bits
  • bit length necessary for the binary representation of the signed integer of the difference value D is 11 bits.
  • the most significant bit (“b10”) in 11 bits of the difference value D is bit data representing a positive / negative sign.
  • the bit length M of the quantized value is 7 bits
  • the most significant bit (“b6”) of the quantized value in FIG. 7 stores bit data representing the sign of the difference value D. That is, the information of the most significant bit (“b10”) of the difference value D is stored as it is in the most significant bit (“b6”) of the quantized value.
  • the quantization processing unit 304 determines the highest value of the quantization value. “0” is set in the bit, and “1” is set in the case of a negative number.
  • the edge determination unit 309 determines that the flat portion and the edge portion are not mixed, the bit data b4 to b9 of the difference value D are stored in the bits b0 to b5 of the quantized value (FIG. 7A )reference).
  • the quantization processing unit 304 performs the quantization process with the initial quantization width (“4”).
  • the quantized value of the edge pixel has the bit data b5 to b9 of the difference value D as the quantized value. It is stored in bits b1 to b5 (see FIG. 7B). This corresponds to the quantization processing unit 304 performing the quantization process with the edge portion quantization width (“5”).
  • the edge flag discriminated by the edge pixel discriminating unit 310 described above is stored in the bit b0. That is, of the M-bit bit data obtained by encoding the quantized value, the bit length that can store the information about the difference value D is (M ⁇ 1) bits.
  • the edge determination unit 309 determines that the flat portion and the edge portion are mixed, the difference value D as shown in FIG. Are stored in the bits b1 to b5 of the quantized value. This corresponds to the quantization processing unit 304 performing the quantization process with the flat part quantization width (“2”). Also in the pixels other than the edge pixel, since the edge flag needs to be stored in the bit b0 as in the edge pixel, the bit length representing the information about the difference value D among the quantized values is (M ⁇ 1). ) Bit.
  • the threshold value of the unit quantization width Q when the edge pixel determination unit 310 determines whether or not there is an edge pixel is TH2.
  • the bit length of the quantization value that can store the information about the difference value D is (M ⁇ 1) bits. is there. For this reason, if the bit length of the difference value D is equal to or greater than the bit length L obtained by the following equation (8), the edge pixel determination unit 310 is equivalent to determining that the pixel is an edge pixel.
  • the encoding target pixel data in which the bit length of the difference value D is L bits or more is subjected to quantization processing by the edge quantization width as shown in FIG. 7B, and is encoded smaller than L bits. It is determined that the target pixel data is not an edge pixel, and quantization processing is performed with a flat portion quantization width as shown in FIG.
  • the flat part quantization width is a quantization width for reducing the quantization error in the flat region, it is desirable to set it as small as possible.
  • the threshold value TH2 leads to a threshold value for determining the edge pixel as shown in Expression (8). For this reason, if the threshold value TH2 is set so that the bit length L becomes extremely small according to the equation (8), the threshold value for determining that the pixel is an edge pixel becomes low. There is a possibility that most of the target pixel data is lost.
  • the flat portion and the edge portion are mixed by assigning 1 bit as the flag bit for the edge pixel of this embodiment.
  • the quantization width takes a larger value than the case where there is no.
  • the quantization width is suppressed in the quantization width corresponding to the encoding target pixel other than the edge pixel. It has been. Therefore, when the quantization process is performed, it is possible to suppress the deterioration of the image quality of the flat portion that is easily perceived as a large deterioration visually.
  • FIG. 8 is a diagram in which the bit length necessary for the binary representation of the signed integer of the difference value D, the determination result by the edge determination unit 309, and the 3-bit quantization information determined by the quantization width are associated with each other. is there.
  • the determination result by the edge determination unit 309 in the drawing indicates “1” when it is determined that the flat portion and the edge portion are mixed, and “0” otherwise. For example, when the edge determination unit 309 determines that a flat portion and an edge portion are mixed, the packing unit 305 generates “101” as quantization information according to FIG.
  • the edge determination unit 309 determines that the flat portion and the edge portion are not mixed, and the quantization width received from the quantization width determination unit 306 is “3”.
  • the packing unit 305 generates “011” as the quantization information.
  • the packing unit 305 stores the pixel data of the pixel P1, which is the initial pixel value received from the processing target pixel value input unit 301, in an S-bit buffer memory. Thereafter, the quantization width received from the quantization width determination unit 306 and the J-bit length quantization information obtained by encoding the edge presence / absence information determined by the edge determination unit 309, from the quantization processing unit 304 The received quantized value of the encoding target pixel P2 is stored in the buffer memory.
  • the fixed bit length S is “48”
  • the bit length N of the input pixel data to be encoded is “10”
  • the bit length J of the quantization information is “3”. Since the bit length M of the quantized value is 7 bits, encoded data of 20 bits from the beginning of the 48-bit buffer memory is stored.
  • step S110 it is determined whether or not the image encoding process has been completed for the number of pixels Pix packed into S bits.
  • Pix is calculated in advance.
  • the bit length N of the input pixel data to be encoded is “10”
  • the bit length J of the quantization information is “3”
  • the quantization value is 7 bits
  • the S-bit packing data includes an initial pixel value of one pixel and a group of encoding target pixels including five pixels.
  • the number of groups in the S bit need not be limited to one group.
  • Step S110 the process proceeds to Step S101, and at least one of Step S101 to Step S109 is next performed on the encoding target pixel data received by the processing target pixel value input unit 301. Execute the process.
  • the processing from step S101 to step S109 is repeatedly performed on the pixels P3 to P6, and sequentially stored in the buffer memory.
  • step S110 the encoded data in the buffer memory is output from the image encoding device 300 in units of S bits, and the process proceeds to step S111.
  • step S111 it is determined whether the encoding process for one image has been completed with the output encoded data. If YES, the encoding process ends. If NO, the process proceeds to step S101. ⁇ At least one process of step S110 is executed.
  • FIG. 6A shows an error with respect to (target pixel data).
  • FIG. 9A shows a bit image of S-bit packing data when the image encoding process is not applied, that is, when the quantization width is always assumed to be “0”. Note that this bit image is not a bit image actually generated by the image encoding device 300.
  • FIG. 9B shows a bit image that is applied to the image encoding process, actually stored in the buffer memory by the packing unit 305, and output from the image encoding apparatus 300.
  • FIG. 9B shows that the first input pixel P1 is input to the packing unit 107 with N (“10”) bits as an initial pixel value by 10 bits from the left end. Thereafter, the quantized information is J (“3”) bit, and the quantized values corresponding to the subsequent pixels P2 to P6 are encoded data of M (“7”) bits, after the first 10 bits of data. It has the following structure. By encoding pixels P2 to P6, the number of pixels that can be stored with the same bit length S is increased to a larger number of pixels.
  • the bit length S of data to be packed by the packing unit 305 is set to the bus width of the data transfer of the integrated circuit to be used, the number of pixels that can be transmitted in one transfer increases, and the bus width is fixed. Can be guaranteed to be long. Therefore, when data access to certain compressed pixel data is required, it is only necessary to access the packed data packed for each bus width. At this time, if the bus width does not match the bit length of the packing data and there are unused bits, the unused bits may be replaced with dummy data as shown in FIG.
  • FIG. 6B is an example of a conventional image encoding process that does not implement this embodiment.
  • the processing from step S101 to step S105 is executed as in the present embodiment.
  • the initial quantization width calculation unit 307 performs initial quantization on a common quantization width that is used for quantization of any encoding target pixel in the group in units of groups each including the number of pixels Pix_G.
  • the width is determined (step S201 in FIG. 4).
  • the initial quantization width obtained in step S201 becomes the common quantization width of the group, and all the encoding target pixels belonging to the group are uniformly quantized with the initial quantization width. Become. Therefore, in the conventional image encoding process, when the process in step S201 is completed, the process in step (quantization width determination step) S106 is terminated, and the process proceeds to step S107.
  • FIG. 6B shows an error between each calculation result of the encoding target pixels P1 to P6 calculated in the process and calculation at that time, and a quantization value, a decoding result, and an input value (encoding target pixel data). Indicated. As is clear from comparison between the decoding result shown in FIG. 6A and the error between the decoding result and the input value (encoding target pixel data), the error increases in the flat region of the pixels P4 to P6. ing.
  • the quantization process is performed with a large quantization width in the flat region of the pixels P4 to P6.
  • the errors occur as “ ⁇ 4”, “ ⁇ 5”, and “8”, whereas in the embodiment (FIG. 6A) in which the present embodiment is implemented, the quantization width is suppressed. It can be seen that the occurrence of errors such as “0”, “ ⁇ 1”, and “0” can be suppressed.
  • the image encoding processing method is predictive encoding using the prediction formula (1), and prediction value pixel generation is performed from the encoding target pixel data received from the processing target pixel value input unit 301.
  • the difference value was calculated by subtracting the predicted value received from the unit 302.
  • the encoding method is not limited to this, and a predicted value that approximates the pixel value of the target encoding target pixel data is obtained, a value that represents a difference from the predicted value is calculated, and the quantization target and
  • any method that performs quantization processing can be applied to the present invention.
  • the conventional image encoding processing deteriorates to the image quality of the flat portion where the deterioration is visually noticeable. It can be seen that the deterioration of the flat portion can be suppressed.
  • the present embodiment even when a flat portion and an edge portion are mixed, such as when a defective pixel or a steep edge occurs in a relatively flat region, it is applied in units of pixels.
  • a flat portion and an edge portion are mixed, such as when a defective pixel or a steep edge occurs in a relatively flat region, it is applied in units of pixels.
  • by switching the quantization width in the quantization process it is possible to reduce the degree of image quality deterioration of a flat portion where deterioration is visually noticeable while maintaining random accessibility.
  • FIG. 10 is a flowchart of the image decoding process according to the first embodiment of the present invention.
  • FIG. 11 is a block diagram showing the configuration of the image decoding device 110 according to Embodiment 1 of the present invention.
  • the encoded data input to the unpacking unit 111 is encoded data necessary for restoring the pixels P1 to P6 shown in FIG.
  • the unpacking unit 111 analyzes the S-bit fixed length encoded data sent from the packing unit 305 or a memory such as SDRAM, and separates the fixed length encoded data into a plurality of data. That is, the unpacking unit 111 transmits the fixed-length encoded data that has been sent to the N-bit length initial pixel value, or the quantization information in which the J-bit length quantization width information is stored, and the M-bit length decoding.
  • the quantization value corresponding to the target pixel (hereinafter referred to as a decoding target pixel) is separated (step S301 in FIG. 10).
  • the encoded data analyzed by the unpacking unit 111 is transmitted to the quantization width determining unit 112 and the output unit 116 at an appropriate timing.
  • the encoded data of interest is input as an initial pixel value (YES in step S302 in FIG. 10)
  • the encoded data is sent as pixel data holding the dynamic range before encoding of N bits.
  • the unpacking unit 111 omits the inverse quantization process for the encoded data of interest and transmits the encoded data directly to the output unit 116.
  • the unpacking unit 111 uses the J-bit encoded data or quantization value in which the quantization information is stored. Is transmitted to the quantization width determination unit 112, and the process proceeds to a quantization width determination process in the inverse quantization process (step S303 in FIG. 10).
  • step (quantization width determination step) S303 in the quantization width determination unit 112, the quantization width selection unit 119 performs the analysis of the quantization information analysis unit 117 and the edge flag separated by the edge flag separation unit 118. Based on the above, the quantization width in the inverse quantization process is determined for each pixel, and is output to the inverse quantization processing unit 113 together with the corresponding quantization value. And a process transfers to a dequantization process.
  • FIG. 20 is a flowchart showing a method for determining the quantization width in the inverse quantization process, and shows details of the process in step S303.
  • the quantization width determination process in the inverse quantization process of step S303 will be described.
  • the quantization width determination unit 112 determines the quantization width determination unit 112. Analyzes the quantization width information in the inverse quantization process from the encoded data received from the unpacking unit 111 (step S402 in FIG. 20). Specifically, the quantization information analysis unit 117 in the quantization width determination unit 112 analyzes the J-bit length quantization information generated by the packing unit 305 in the image encoding process performed by the image encoding device 300. To do.
  • the quantization information analysis unit 117 transmits the edge presence / absence determination result by the edge determination unit 309 to the edge flag separation unit 118, and transmits quantization width information to the quantization width selection unit 119.
  • the encoded data received from the unpacking unit 111 by the quantization width determination unit 112 is encoded data having an M-bit length in which the quantization value is stored (NO in step S401 in FIG. 20).
  • the pattern of the group to which the target decoding target pixel belongs includes a flat portion and an edge portion (in the case of YES in step S403 in FIG. 20)
  • the edge flag separation portion 118 starts from the unpacking portion 111.
  • the edge flag embedded in the quantized value corresponding to the received decoding target pixel is separated. Then, when the separation processing ends, the edge flag separation unit 118 transmits the separated edge flag information to the quantization width selection unit 119, and transmits the quantization value information to the inverse quantization processing unit (inverse quantization unit). ) 113 (step S405 in FIG. 20).
  • the quantization width selection unit 119 determines whether or not the target pixel to be decoded is an edge pixel from the information (step S406 in FIG. 20). When the decoding target pixel focused on by the edge flag is an edge pixel, the process proceeds to step S407.
  • step S407 since the target pixel to be decoded is an edge pixel, an edge part quantization width is selected from the analysis result of the quantization information analysis unit 117 as a corresponding quantization width. If the determination result of this determination is NO in Step S406, the process proceeds to Step S408.
  • step S408 based on the analysis result of the quantization information analysis unit 117 and the information on the edge flag received from the edge flag separation unit 118, it is determined that the target decoding target pixel is a flat part in which the edges are close to each other. Therefore, the flat portion quantization width is selected as the corresponding quantization width.
  • the quantization width selection unit 119 can determine that the pattern of the group to which the decoding target pixel belongs is entirely flat or a complex pattern.
  • the quantization width corresponding to all the decoding target pixels in the group is the initial quantization width obtained from the analysis result of the quantization information analysis unit 117.
  • the edge flag separation unit 118 does nothing, and transmits the quantized value received from the unpacking unit 111 to the inverse quantization processing unit 113 as it is.
  • the quantization width determination process in the inverse quantization process ends, and the process proceeds to the inverse quantization process.
  • the inverse quantization processing unit 113 receives the M-bit length encoded data in which the quantization width and the quantization value transmitted by the quantization width determination unit 112 are stored, and the received quantization width.
  • the inverse quantization process is performed by
  • the inverse quantization process based on the quantization width is a process of bit-shifting the encoded data having an M-bit length representing the quantization value received from the quantization width determination unit 112 by the number of quantization widths.
  • the inverse quantization processing unit 113 calculates a difference value D ′ of pixel values between the decoding target pixel expressed in N bits and the predicted pixel by inverse quantization processing.
  • the inverse quantization processing unit 113 does not perform the inverse quantization when the quantization width is “0” (step (inverse quantization step) S304 in FIG. 10).
  • step (prediction pixel generation step) S305 the prediction pixel generation unit 114 calculates a prediction value corresponding to the decoding target pixel.
  • the data input to the prediction pixel generation unit 114 is the initial pixel value input before the target decoding target pixel and output from the output unit 116, or is decoded and output from the output unit 116.
  • the predicted pixel generation unit 114 generates a predicted value represented by N bits using the input pixel data.
  • the prediction value generation method is any one of the above-described prediction formulas (1) to (7), and the same prediction formula as that used in the prediction pixel generation unit 302 of the image encoding device 300 is used.
  • the predicted pixel generation unit 114 calculates a predicted value.
  • the prediction pixel generation unit 114 transmits the calculated prediction value to the decoded value generation unit 115.
  • step S306 the decoded value generation unit 115 adds the inverse quantization result received from the inverse quantization processing unit 113 and the prediction value corresponding to the decoding target pixel received from the prediction pixel generation unit 114. Then, a decoding value corresponding to the decoding target pixel is generated and transmitted to the output unit 116.
  • FIG. 12 is a diagram for explaining the image decoding process in the present embodiment.
  • FIG. 12 is a diagram illustrating, as an example, image encoding processing results of the six pieces of pixel data (pixels P1 to P6) illustrated in FIG. 6A as input data to the image decoding apparatus 110.
  • a plurality of encoded data stored in an external memory are continuously input to the unpacking unit 111 as shown in FIG. 9B. Since the pixel data corresponding to the pixel P1 is an initial pixel value, it is assumed to be represented by 10 bits. Further, since the data corresponding to each of the pixels P2 to P6 is, for example, encoded data including the quantization value and the edge flag shown in FIG. 7B or FIG. Shown in code.
  • step S301 the unpacking unit 111 separates the encoded data into predetermined bits as shown in FIG. 9B, and proceeds to step S302.
  • step S302 the unpacking unit 111 determines whether or not the separated encoded data is an initial pixel value. In step S ⁇ b> 302, if the determination result is YES, the unpacking unit 111 transmits the received pixel data to the output unit 116. And a process transfers to step S307 mentioned later. On the other hand, if the determination result is NO in Step S302, the process proceeds to Step S303.
  • the unpacking unit 111 receives pixel data corresponding to the pixel P1 as an initial pixel value. Assume that the initial pixel value is “150”. In this case, the unpacking unit 111 transmits the input pixel value “150” to the output unit 116. The output unit 116 transmits the received initial pixel value to the predicted pixel generation unit 114.
  • the quantization width determination unit 112 determines the quantization width in the inverse quantization process corresponding to each decoding target pixel. First, the quantization width determination unit 112 determines whether or not the encoded data received from the unpacking unit 111 is quantization information (step S401 in FIG. 20). If the determination result is NO in Step S401, the process proceeds to Step S403 described later. If the determination result is YES, the process proceeds to step S402.
  • the encoded data received by the quantization width determination unit 112 from the unpacking unit 111 is quantization information having a J-bit length.
  • the bit length J of the quantization information is 3 bits, and the value indicated by the quantization information is “101”.
  • the process proceeds to step S402, the quantization information analysis unit 117 analyzes the quantization information received by the quantization width determination unit 112, the determination result by the edge determination unit 309, the quantization width in the inverse quantization process, and Ask for. Since the quantization width needs to match the quantization width used by the quantization processing unit 304 in the image encoding process, the quantization width is calculated based on the correspondence relationship in the table of FIG.
  • the quantization information received by the quantization width determination unit 112 is “101”.
  • the quantization information analysis unit 117 includes the edge flag separation unit 118. To send “edge present” information.
  • the quantization width in the inverse quantization process is the flat portion quantization width “2” or the edge portion quantization width “5”, and the quantization information analysis unit 117 selects the quantization width information for the quantization width. To the unit 119.
  • the encoded data received by the quantization width determination unit 112 from the unpacking unit 111 is a quantization value corresponding to the decoding target pixel P2 having an M-bit length.
  • the process proceeds to step S403.
  • step S403 for example, whether the flat part and the edge part are mixed in the pattern of the group to which the target decoding target pixel belongs using the result analyzed by the quantization information analysis part 117 in step S402. Determine. If they are mixed (YES in step S403), the process proceeds to step S405.
  • step S402 it is determined that the flat part and the edge part are mixed in the pattern of the group based on the analysis result output from the quantization information analysis unit 117 (YES in step S403). Further, as shown in FIGS. 7B and 7C, the edge flag is stored in the least significant bit of the quantization value received by the quantization width determining unit 112.
  • step S405 the edge flag separation unit 118 separates the edge flag embedded in the quantization value corresponding to the target decoding target pixel. Then, the edge flag separation unit 118 transmits information on the separated edge flag to the quantization width selection unit 119, and transmits information on the quantization value to the inverse quantization processing unit 113. Since the least significant bit of the quantization value (“0110111”) of the decoding target pixel P2 is “1”, the edge flag separation unit 118 identifies the pixel P2 as an edge pixel. Then, the edge flag separation unit 118 separates the edge flag (the least significant bit “1” of the quantization value) embedded in the quantization value (“0110111”) from the quantization value.
  • the edge flag separating unit 118 receives the edge flag (“1”) indicating whether or not the quantization value of the decoding target pixel P2 received by the quantization width determining unit 112 is an edge pixel, and the quantization value (“ 010111 "). Upon completion of the separation process, the edge flag separation unit 118 transmits the separated edge flag information (“1”) to the quantization width selection unit 119, and dequantizes the quantization value information (“011011”). The process proceeds to step S406.
  • step S407 the process proceeds to step S407.
  • the quantization information analysis unit 117 determines that the quantization width of the group to which the pixel to be decoded belongs is the flat part quantization width “2” or the edge part quantization width “5”. Suppose you have decided. In this case, in step S407, the quantization width of the pixel P2 is determined to be “5”, which is the edge portion quantization width, and the quantization width determination process ends.
  • the quantization width selection unit 119 transmits the determined quantization width to the inverse quantization processing unit 113, and the process proceeds to step S304.
  • step S304 the inverse quantization processing unit 113 performs an inverse quantization process.
  • the inverse quantization processing unit 113 uses the quantization value of each pixel to be decoded received from the quantization width determination unit 112 as the quantization width in the inverse quantization received from the quantization width determination unit 112. Is dequantized by bit-shifting upward by the number of.
  • the data calculated by inverse quantization is assumed to be a difference value D ′ expressed by N + 1 (“11”) bits.
  • the quantization width received by the inverse quantization processing unit 113 from the quantization width determination unit 112 is “5” and the binary code of the received quantization value is “011011”.
  • the inverse quantization processing unit 113 performs inverse quantization by bit-shifting “011011” to the upper 5 bits.
  • “01101100000” which is a signed integer binary representation of the difference value D ′ of N + 1 (“11”) bits, is calculated.
  • the difference value D ′ is calculated as a positive number “1101100000”, that is, “864”, and the calculated result is an inverse quantum.
  • the conversion processing unit 113 transmits the decoded value generation unit 115.
  • the inverse quantization processing unit 113 transmits the quantization value as it is to the decoded value generation unit 115 without performing the inverse quantization. .
  • step S305 the prediction value pixel generation unit 114 calculates the prediction value of the decoding target pixel. Specifically, since the prediction value pixel generation unit 114 takes the same prediction method as the prediction value generation processing step S102 of the image encoding process in the image encoding device 300, the prediction value is calculated using the prediction expression (1). Is calculated. Here, it is assumed that the predicted value pixel generation unit 114 calculates the predicted value of the decoding target pixel P2. From the prediction equation (1), in order to use the pixel data of the pixel P1 which is the previous pixel to be decoded as the prediction value, the pixel value “150” of the pixel P1 is received from the output unit 116 and Calculated.
  • the decoded value generation unit 115 calculates a decoded value from the predicted value received from the predicted value pixel generating unit 114 and the difference value D ′ received from the inverse quantization processing unit 113. Specifically, as illustrated in FIG. 12, the decoded value generation unit 115 adds the prediction value received from the prediction pixel generation unit 114 and the difference value D ′ received from the inverse quantization processing unit 113. Thus, a decoded value is generated.
  • the value indicated by the prediction value received from the prediction pixel generation unit 114 is “150”.
  • the difference value D ′ received from the inverse quantization processing unit 113 is “864”. In this case, by adding “150” and “864”, a decoded value “1014” having an N (“10”) bit length is calculated. The obtained decoded value is transmitted to the output unit 116.
  • the image encoding processing method is predictive encoding using the prediction formula (1). Therefore, in the image decoding process, the decoded value is calculated by adding the inverse quantized value and the predicted value.
  • the difference value calculation method of the difference value calculation unit 303 in the present embodiment is not limited to the subtraction process between the predicted value and the encoding target pixel.
  • the present invention is applicable to any process that can extract change information from a predicted value, such as an exclusive OR operation between a predicted value and a pixel to be encoded.
  • the output unit 116 stores the decoded pixel data in, for example, an external memory and the predicted pixel generation unit 114. Further, as described above, when the image encoding device 300 calculates the predicted value of the h-th pixel to be encoded, it is once encoded and then decoded by the image decoding device 110 (h It is also possible to use the -1) th decoded pixel data. In that case, the decoded pixel data transmitted by the output unit 116 may be stored in the prediction pixel generation unit 302 in the image encoding device 300. Note that the output unit 116 may output to an external image processing circuit or the like instead of being stored in an external memory.
  • step S307 the packing unit 305 of the image encoding device 300 determines whether or not the image decoding process has been completed for the number of pixels Pix packed in the fixed bit length S bits.
  • Pix is calculated in advance as in the image encoding process.
  • step S307 if the above determination result for the pixel number Pix is NO, the process proceeds to step S302, and the image decoding apparatus 110 next performs the next encoded data received by the unpacking unit 111. , At least one of steps S302 to S306 is executed. Then, the image decoding device 110 repeatedly performs the processing from step S302 to step S306 on the pixels P3 to P6, and sequentially outputs the obtained pixel data after decoding from the image decoding device 110. .
  • step S307 if the determination result for the pixel number Pix is YES in step S307, the process proceeds to step S308.
  • step S308 the unpacking unit 111 determines whether or not the decoding process for one image has been completed with the decoded pixel data output from the output unit 116. If the determination result is YES, the decoding process is terminated. If the determination result is NO, the process proceeds to step S301, and at least one of steps S301 to S307 is executed.
  • the calculation result corresponding to the pixel P1 that is the initial pixel value does not exist when the pixel to be encoded is input as the initial pixel value in the image encoding process (in the case of YES in step S101 in FIG. 2). ) Omits the quantization process and directly inputs it to the packing unit 305 (step S109 in FIG. 2). Therefore, even in the image decoding process, when the pixel data is received as the initial pixel value by the unpacking unit 111, This is because the input pixel data is directly transmitted to the output unit 116.
  • FIG. 13 shows a selection pattern of the edge portion quantization width and the flat portion quantization width of the edge portion quantization width calculation unit 308 in the second embodiment
  • FIG. 14 shows a case where the second embodiment is applied.
  • An example of a bit image of a difference value D and a quantized value is shown.
  • FIG. 15 is a diagram illustrating an example of quantization information generated by the packing unit 305 in the second embodiment.
  • the edge portion quantization width calculation unit 308 when it is determined that the pattern of the group to which the pixel to be encoded belongs includes a flat portion and an edge portion, the edge portion quantization width calculation unit 308 is used. Selects an appropriate quantization width from a combination pattern of a plurality of edge portion quantization widths and flat portion quantization widths. Specifically, the edge quantization width calculation unit 308 switches the values of the edge quantization width and the flat quantization width to be calculated according to the values of the maximum quantization width Q_MAX and the minimum quantization width Q_MIN of the group. Thereby, since the value of the quantization width is obtained according to the level of the difference value D between the pixel value of the encoding target pixel and the predicted value, a more appropriate quantization width can be selected for each pixel.
  • FIG. 13 a pattern as shown in FIG. 13 is prepared in advance.
  • the upper part of FIG. 13 is a combination pattern of the edge part quantization width and the flat part quantization width described in the first embodiment, and the lower part is a combination pattern added in the present embodiment.
  • the edge quantization width calculation unit 308 obtains a maximum quantization width Q_MAX and a minimum quantization width Q_MIN from among Pix_G unit quantization widths Q corresponding to Pix_G pixels in the group. Then, a comparison is made as to which of the relationships shown in the upper and lower stages of FIG.
  • the maximum quantization width Q_MAX and the minimum quantization width Q_MIN are “3” and “0”, respectively.
  • the maximum quantization width Q_MAX is “3”
  • the maximum number of bits of the absolute difference value is 9 bits. That is, as shown in FIG. 14A, if the bit data of the difference value D is excluded from the bit representing the sign of the most significant bit, the bit data that is valid only up to the ninth bit (“b8”) is stored. It has not been.
  • the group pattern has a flat portion and an edge portion mixed, but the difference value D of the edge portion is relatively small. Although the edge is close to a flat region, the steepness of the edge portion is moderate as compared with the first embodiment.
  • the value of the threshold TH2 is “2” in the first embodiment, but is set to “1”.
  • the bit length M of the quantized value is “7”
  • TH2 + (M ⁇ 1) 7 according to the equation (8)
  • bit data up to the sixth bit of the difference value D must be stored as quantized values, and as shown in FIG. b5 is stored in bits b1 to b5 of the quantized value.
  • the flat part quantization width value at this time is the same value (“1”) as the threshold value TH2.
  • the threshold value TH2 derives the value of the bit length L of the difference value D when determining the edge pixel. For this reason, also in the second embodiment, if the threshold value TH2 is set such that the bit length L becomes extremely small, most of the information of the encoding target pixel data is lost when it is determined as an edge pixel. . Therefore, in the second embodiment, when preparing a combination pattern of a plurality of edge portion quantization widths and flat portion quantization widths, the difference between the bit length L calculated by Equation (8) and the edge portion quantization width is The threshold value TH2 may be obtained so as to be always constant.
  • the quantization information generated by the packing unit 305 is as shown in FIG. Compared with FIG. 8, it can be seen that quantization information “110” is added. Thereby, also in the image decoding apparatus 110, even when there are a plurality of combinations of the edge quantization width and the flat quantization width, the quantization information analysis unit 117 analyzes the quantization information. It is.
  • the flat part quantization width value is reduced from “2” to “1” even in comparison with the first embodiment (upper stage in FIG. 13), and a relatively gradual change in the flat region.
  • the edges are close to each other, it is possible to further suppress the image quality deterioration of the flat portion.
  • a plurality of combination patterns of the edge quantization width and the flat portion quantization width prepared in advance can be prepared according to the bit data of the difference value D that can be generated. As a result, it is possible to deal with a plurality of edge generation patterns, and it is possible to further suppress deterioration in image quality of the flat portion.
  • FIG. 16 is a block diagram illustrating a configuration of a digital still camera 1600 according to the third embodiment.
  • the digital still camera 1600 includes an image encoding device 300 and an image decoding device 110. Since the configurations and functions of the image encoding device 300 and the image decoding device 110 have been described in the first embodiment, detailed description thereof will not be repeated.
  • the digital still camera 1600 further includes an imaging unit 1610, an image processing unit 1620, a display unit 1630, a compression conversion unit 1640, a recording storage unit 1650, and an SDRAM 1660.
  • the imaging unit 1610 images a subject and outputs digital image data (RAW data) corresponding to a captured image of the subject.
  • the imaging unit 1610 includes an optical system 1611, an imaging element 1612, an analog front end 1613 (abbreviated as AFE in the drawing), and a timing generator 1614 (abbreviated as TG in the drawing).
  • the optical system 1611 includes a lens or the like, and forms an image of a subject on the image sensor 1612.
  • the image sensor 1612 converts light incident from the optical system 1611 into an electrical signal.
  • various image pickup devices such as an image pickup device using a CCD (Charge-Coupled Device) and an image pickup device using a CMOS can be adopted.
  • CCD Charge-Coupled Device
  • the analog front end 1613 performs signal processing such as noise removal, signal amplification, and A / D conversion on the analog signal output from the image sensor 1612, and outputs the signal-processed data as image data.
  • the timing generator 1614 supplies a clock signal serving as a reference for the operation timing of the image sensor 1612 and the analog front end 1613 to them.
  • the image processing unit 1620 performs predetermined image processing on the pixel data (RAW data) input from the imaging unit 1610, and outputs the image-processed data to the image encoding device 300.
  • the image processing unit 1620 includes a flaw correction circuit 1621, a luminance signal generation circuit 1622, a color separation circuit 1623, an aperture correction processing circuit 1624 (abbreviated as AP in the figure), a matrix processing circuit. 1625, and a zoom circuit 1626 (abbreviated as ZOM in the drawing) for enlarging / reducing an image.
  • the flaw correction circuit 1621 detects the defective pixel by obtaining the light shielding data of the image sensor 1612 when the power is turned on, and holds the detected positional information of the defective pixel in a storage unit such as a register or a memory. . Then, based on the position information held at the time of imaging, an interpolation value is calculated using a plurality of pixel data arranged around the defective pixel in the imaging element 1612, and the interpolation value and the value of the defective pixel are replaced. Circuit.
  • the luminance signal generation circuit 1622 generates a luminance signal (Y signal) from the RAW data.
  • the color separation circuit 1623 generates a color difference signal (Cr / Cb signal) from the RAW data.
  • the aperture correction processing circuit 1624 performs processing for adding a high frequency component to the luminance signal generated by the luminance signal generation circuit 1622 to make the resolution appear high.
  • the matrix processing circuit 1625 adjusts the spectral characteristics of the image sensor and the hue balance that has been corrupted by image processing on the output of the color separation circuit 1623.
  • the image processing unit 1620 temporarily stores pixel data to be processed in a memory such as an SDRAM, and performs predetermined image processing, YC signal generation, zoom processing, and the like on the temporarily stored data. In many cases, the processed data is temporarily stored in the SDRAM again. For this reason, in the image processing unit 1620, it is considered that both the output to the image encoding device 300 and the input from the image decoding device 110 occur.
  • Display unit 1630 displays the output of image decoding device 110 (image data after the image decoding process).
  • the compression conversion unit 1640 outputs image data obtained by compressing and converting the output of the image decoding device 110 according to a predetermined standard such as JPEG to the recording storage unit 1650, and the compression conversion unit 1640 reads out by the recording storage unit 1650.
  • the expanded image data is expanded and converted, and the expanded and converted image data is input to the image encoding apparatus 300. That is, the compression conversion unit 1640 can process data based on the JPEG standard.
  • Such a compression conversion unit 1640 is generally mounted on a digital still camera.
  • the recording storage unit 1650 receives the compressed image data and records it on a recording medium (for example, a non-volatile memory).
  • the recording storage unit 1650 reads the compressed image data recorded on the recording medium, and outputs the read image data to the compression conversion unit 1640.
  • Examples of input signals in the image encoding device 300 and the image decoding device 110 according to the third embodiment include RAW data input from the imaging unit 1610.
  • the input signal of the image coding apparatus 300 is not limited to RAW data.
  • the pixel data to be processed by the image encoding device 300 and the image decoding device 110 may be YC signal (luminance signal or color difference signal) data generated from RAW data by the image processing unit 1620, or It may be data (luminance signal or color difference signal data) obtained by expanding JPEG image data that has been compressed and converted into JPEG.
  • the digital still camera 1600 according to the third embodiment in addition to the compression conversion unit 1640 generally mounted on a digital still camera, the image encoding apparatus 300 and the image decoding that process RAW data and YC signals as processing targets.
  • the apparatus 110 is provided.
  • the digital still camera 1600 according to the third embodiment can perform a high-speed imaging operation in which the number of continuous shots having the same resolution is increased with the same memory capacity such as SDRAM.
  • the digital still camera 1600 it is possible to increase the resolution of a moving image stored in a memory such as an SDRAM having the same capacity.
  • the configuration of the digital still camera 1600 shown in the third embodiment is similar to the digital still camera 1600 in that the digital video camera includes an imaging unit, an image processing unit, a display unit, a compression conversion unit, a recording storage unit, and an SDRAM. It is also possible to apply to this configuration.
  • FIG. 17 is a block diagram illustrating a configuration of a digital still camera 1700 according to the fourth embodiment.
  • the digital still camera 1700 includes an imaging unit 1710 instead of the imaging unit 1610 and an image processing unit instead of the image processing unit 1620, as compared to the digital still camera 1600 of FIG. 1720 is different. Since the other configuration is the same as that of digital still camera 1600, detailed description will not be repeated.
  • the imaging unit 1710 is different from the imaging unit 1610 of FIG. 16 in that it includes an imaging device 1712 instead of the imaging device 1612 and omits the analog front end 1613. Other than that, it is the same as imaging unit 1610, and thus detailed description will not be repeated.
  • This is an example in which a CMOS sensor is used for the imaging element 1712, for example, and has an amplifier and an A / D conversion circuit in the pixel and outputs a digital signal. For this reason, it becomes possible to mount the image coding apparatus 300 of FIG.
  • the image processing unit 1720 is different from the image processing unit 1620 in FIG. 16 in that it further includes the image decoding device 110 in FIG. Since the other configuration is the same as that of image processing unit 1620, detailed description will not be repeated.
  • the image encoding device 300 included in the image sensor 1712 encodes a pixel signal (RAW data) imaged by the image sensor 1712 and the image decoding device 110 in the image processing unit 1720 uses the data obtained by the encoding. Send to.
  • RAW data pixel signal
  • the image decoding device 110 in the image processing unit 1720 decodes the data received from the image encoding device 300. With this processing, it is possible to improve the data transfer efficiency between the image sensor 1712 and the image processing unit 1720 in the integrated circuit.
  • the digital still camera 1700 of the fourth embodiment it is possible to increase the number of continuous shots of the same resolution and the resolution of moving images with the same memory capacity as compared with the digital still camera 1600 of the third embodiment. Become.
  • the image code is placed before the flaw correction circuit 1621 in the image processing unit 1720. Will be executed. That is, when a defective pixel occurs in the image sensor 1712, it means that the pixel value of the defective pixel is not corrected and is input to the image encoding device 300 with the pixel value (signal level) as it is.
  • examples of defective pixels include black scratches that output only low pixel values without reacting to sensitivity, and white scratches that output only pixel values close to the saturation level. Therefore, when the pixel value of the defective pixel is not corrected and is input to the image encoding apparatus 300 with the pixel value as it is, a steep edge may occur in a flat region regardless of the subject image. There is. Therefore, a region including a defective pixel is quantized using a large quantization width, and may be perceived as a large deterioration visually.
  • the image encoding device 300 even when a steep edge is generated due to a defective pixel on the pixel data input to the image encoding device 300, the influence of the quantization process is propagated to surrounding flat pixels. In order to prevent this, even if the image encoding device 300 is installed in the previous stage of the flaw correction circuit 1621, the image encoding process can be performed without any problem. Therefore, it is possible to incorporate the image encoding device 300 in the imaging unit 1710, which is effective in improving data transfer efficiency between the imaging unit 1710 and the image processing unit 1720.
  • FIG. 18 is a diagram showing the configuration of the surveillance camera 1800.
  • the surveillance camera 1800 ensures security on the transmission path so that image data transmitted from the surveillance camera 1800 is not stolen on the transmission path by a third party.
  • the image data is encrypted.
  • image data that has been subjected to predetermined image processing by the image processing unit 1801 in the surveillance camera signal processing unit 1810 is converted into JPEG, MPEG4, H.264 by the compression conversion unit 1802.
  • the data is compressed and converted according to a predetermined standard such as H.264, further encrypted by the encryption unit 1803, and the encrypted data is transmitted from the communication unit 1804 to the Internet, thereby protecting the privacy of the individual.
  • the output from the imaging unit 1710 including the above-described image encoding device 300 is input to the surveillance camera signal processing unit 1810, and the image decoding mounted in the surveillance camera signal processing unit 1810 is performed.
  • the encoded data is decoded by the device 110.
  • the image data captured by the image capturing unit 1710 can be pseudo-encrypted, so that the data transfer efficiency between the image capturing unit 1710 and the surveillance camera signal processing unit 1810 can be improved and the transmission path can be improved. Security can be ensured, and it is possible to further improve the security compared to the prior art.
  • the image encoding device 300 and the image decoding device 110 on the surveillance camera, it is possible to improve the data transfer efficiency of the surveillance camera and realize an imaging operation such as increasing the resolution of the moving image. Further, by pseudo-encrypting image data, it is possible to improve security such as preventing leakage of image data and protecting privacy.
  • FIG. 19 is a diagram illustrating a configuration of the monitoring camera 1900 according to the sixth embodiment.
  • an image processing unit 1901 and a signal input unit 1902 for performing predetermined camera image processing on an input image from the imaging unit 1610 are mounted.
  • the surveillance camera signal processing unit 1910 that receives the image data transmitted by the image processing unit 1901, performs compression conversion, encrypts, and transmits the image data from the communication unit 1804 to the Internet is realized by a separate LSI. There is a form to do.
  • the image encoding device 300 is mounted on the image processing unit 1901, and the image decoding device 110 is mounted on the surveillance camera signal processing unit 1910.
  • the image data transmitted by the image processing unit 1901 can be pseudo-encrypted.
  • the data transfer efficiency between the image processing unit 1901 and the surveillance camera signal processing unit 1910 is improved, and the security on the transmission path is ensured, and the security can be further improved than before.
  • the quantization width is adaptively switched in units of pixels while maintaining random accessibility, thereby affecting the influence of defective pixels and steep edges. The problem of propagation to a flat region is solved.
  • the embodiment shown in the above description is merely an example. That is, the concept of the object for which the right is claimed is a superordinate concept obtained by abstracting the embodiment described above. And this superordinate concept may be implemented (implemented and realized) by the embodiment shown above as an example, or by another embodiment partially or entirely different from the embodiment shown above. Of course, it may be implemented (implemented, realized).
  • the image encoding method and apparatus and the image decoding method and apparatus according to the present invention compress the image data while guaranteeing a fixed length for the data transfer bus width and the like of the integrated circuit. Is possible.
  • the quantization width in the quantization process is adaptively switched on a pixel-by-pixel basis based on the determination result, resulting in defective pixels and steep edges It is possible to suppress the propagation of the quantization error to the flat region even in the region where the current is applied. Therefore, in devices that handle images, such as digital still cameras and network cameras, image data can be encoded and decoded while minimizing image quality degradation during image compression while maintaining random accessibility. become. Therefore, it is useful for catching up to an increase in the amount of image data processing in recent years.
  • DESCRIPTION OF SYMBOLS 100 Digital signal processing circuit 101 Image coding apparatus 102 Image decoding apparatus 103 Preprocessing part 104 Signal processing part 105 Memory 300 Image coding apparatus 301 Process target pixel value input part 302 Predictive pixel generation part 303 Difference value calculation part 304 Quantization Processing unit (quantization unit) 305 Packing unit 306 Quantization width determination unit 307 Initial quantization width calculation unit 308 Edge unit quantization width calculation unit 309 Edge determination unit 310 Edge pixel determination unit 311 Quantization width selection unit 110 Image decoding device 111 Unpacking unit 112 Quantum Quantization width determination unit 113 Inverse quantization processing unit (inverse quantization unit) 114 Predicted Pixel Generation Unit 115 Decoded Value Generation Unit 116 Output Unit 117 Quantization Information Analysis Unit 118 Edge Flag Separation Unit 119 Quantization Width Selection Unit 1600, 1700 Digital Still Camera 1610, 1710 Imaging Unit 1611 Optical System 1612, 1712 Imaging Element 1613 Analog front end 1614 Timing generators 1620 and 1720 Image processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

 画像符号化方法及び画像符号化装置において、予測画素生成部302は、圧縮対象の画素の周辺に位置する少なくとも1つの周辺画素から画素データの予測値を生成する。量子化処理部304は、前記画素データと前記生成された予測値との間の差分値を、前記画素データよりも少ないビット数である量子化値へと量子化して、前記画素データを前記量子化値へと圧縮する。量子化幅決定部306は、グループ内の前記差分値の特性から平坦部とエッジ部とが混在しているか否かをエッジ判定部309で判定すると共に、前記差分値から前記グループを構成する画素中におけるエッジ部の画素と平坦部の画素とをエッジ画素判別部310で判別し、前記量子化処理部304における量子化幅を決定する。従って、平坦部とエッジ部とが混在している場合に、エッジ部の量子化誤差が平坦領域に伝播することが防止される。

Description

画像符号化方法、画像復号化方法、画像符号化装置及び画像復号化装置
 本発明は、デジタルスチルカメラやネットワークカメラ等のように画像を扱う装置において、画像圧縮によるデータ転送の高速化やメモリの使用量削減を目的とした画像符号化方法とその装置に関するものである。
 近年、デジタルスチルカメラやデジタルビデオカメラなどの撮像装置に用いられる撮像素子の高画素化に伴い、装置に搭載される集積回路が処理する画像データ量が増大している。多くのデータ量の画像データを扱うには、集積回路内のデータ転送のバス幅を確保するために、動作周波数の高速化、メモリの大容量化等が考えられるが、これらはコストアップに直接繋がってしまう。
 また、一般的にデジタルカメラやデジタルビデオカメラなどの撮像装置では、集積回路内での全ての画像処理を終えると、SDカード等の外部記録装置に記録する。そして、その記録の際には、記録対象の画像に圧縮処理を行い、非圧縮のときに比べてより大きな画像サイズ、より多くの枚数の画像データを、同じ容量の外部記録装置に格納している。ここで、この圧縮処理には、JPEG、MPEGといった符号化方式が用いられている。
 特許文献1では、画像データの圧縮処理を、撮像素子から入力される画素信号(RAWデータ)に対しても展開することにより、撮像素子の多画素化が進んで信号処理の負荷が増大する場合でも、メモリへの書き込み及び読み出しの際に必要なバス帯域を削減し、高速操作を可能にすることを目的としている。また、バス帯域の保証と圧縮処理量の削減のために固定長符号化方式を採用している。その実装方法については、任意の画像領域の画素データから最大値と最小値を算出し、領域内の局所的なダイナミックレンジを求め、領域内の全ての画素から、算出された最小値を減算した値を、求められたダイナミックレンジに応じた量子化幅で量子化することにより、画像データの固定長符号化を行っている。
 また、特許文献2では、一般的に連写枚数は、バッファメモリに格納可能なRAWデータの枚数に依存するため、RAWデータを圧縮することによりメモリの使用量を抑え、連写枚数を増やすことを目的としている。特許文献2においても、連写枚数の保証のため固定長符号化を採用しており、その実装方法については、隣接画素との差分値から量子化幅を決定し、その量子化幅から一意に求まるオフセット値を圧縮対象の画素値から減算することにより、被量子化処理値を決定するため、メモリを必要とせず、低い符号化演算処理負荷を確保した状態で、圧縮処理を実現する画像符号化装置及び復号化装置を提供している。
 特許文献3においても、RAWデータの圧縮について述べられており、撮像素子の欠陥画素の扱いを課題としている。特許文献3では、欠陥画素であるという情報を含む画素データが入力された場合でも、後段の画像処理において欠陥画素を正しく検出し、補正できるように符号化する画像符号化装置を提供している。その実装方法については、欠陥画素である場合は、特定の量子化代表値に割り当て、欠陥画素以外の場合には、特定の量子化代表値を除く量子化値に割り当てて符号化することにより、欠陥画素である情報を、可逆的に符号化・復号化し、後段の処理において確実に復元させて、正しく補正することを可能としている。
特開2007-228515号公報 特開2007-036566号公報 特開2007-104525号公報
 しかしながら、特許文献1に記載の撮像装置では、同一領域内における最小値との差分値を量子化しており、領域内のダイナミックレンジが大きいほど量子化幅も大きくなる。これは、領域内のダイナミックレンジが広い場合は、画像として大きく変化している可能性が高く、細かいレベル変化は視覚的に感知しにくいという視覚特性を利用している。しかし、暗い画像中に白傷などの撮像素子の欠陥画素が存在した場合、欠陥画素が含まれる領域では、最大値と最小値との差が極端に大きくなってしまう。この場合、被写体の変化にかかわらず、欠陥画素が含まれる領域は、ダイナミックレンジが広いと判断される。そして、領域に含まれる画素は全て、大きな量子化幅を用いて一律量子化され、視覚的に大きな劣化として捉えられるという問題がある。
 また、特許文献2においても、圧縮対象画素と直前の画素との差分値の最大値により量子化幅を決定し、量子化するため、同様の原理により問題が生じる。
 図1は、特許文献3の画像符号化、復号化装置を含むデジタル信号処理回路100の構成を示すブロック図である。特許文献3では、RAWデータのメモリへの書き込み及び読み出しの際のバス帯域の削減による、処理の高速化を目的としている。従って、前処理部103で前処理された画素データを画像符号化装置101により圧縮して、メモリ105上に格納し、画像復号化装置102では、メモリ105に格納された画素データを伸張して信号処理部104に送る。このとき、特許文献3では、画像符号化装置101において、画素値が特定の画素値である場合には、欠陥画素であるとして、特定の量子化代表値に割り当てて符号化する。そして、画像復号化装置102では、符号化された量子化代表値が特定の量子化代表値である場合には、これを欠陥画素として特定の画素値を割り当てて復号化することにより、欠陥画素であるという情報を、可逆的に符号化、復号化している。しかし、特許文献3では、予め前処理部103において、画像中の欠陥画素の位置を検出し、その画素値を、特定の画素値に割り当ててあることを前提としており、欠陥画素の画素値が、そのまま画像符号化装置101に入力されてきた場合については、言及されていない。
 その一方で、一般的にデジタルスチルカメラ等に搭載される集積回路内の画像処理においては、撮像素子から入力された画素データを、SDRAM(Synchronous Dynamic Random Access Memory)等のメモリに一時記憶させる。そして、一時記憶された画素データに対して所定の画像処理や、YC信号生成、拡大・縮小等のズーム処理等を行い、処理後の画素データを、再度SDRAMに一時記憶する。その際、画像の任意の領域を切り出す場合や、画素の上下間の参照・相関を必要とする画像信号処理を行う場合など、任意領域の画素データをメモリから読み出すよう要求されることが多い。この際、可変長符号データでは、符号データの途中から任意領域を読み出すことはできず、ランダムアクセス性を損なうことになる。そのため、特許文献2においては、量子化処理により固定長の符号へと変換し、メモリの使用量と、メモリのアクセス量とを削減している。
 本発明は上記の問題を鑑みたものであり、その目的は、固定長符号化を採用した画像符号化方法により、ランダムアクセス性は維持したまま、量子化処理における量子化幅を、画素単位で適応的に切り替えることにより、欠陥画素や急峻なエッジの発生による影響が平坦な領域に伝播するのを抑圧することにある。
 上記目的を達成するために、本発明の画像符号化方法は、圧縮対象の画素の画素データを入力し、入力された前記画素データを圧縮する画像符号化方法であって、圧縮対象の画素の周辺に位置する少なくとも1つの周辺画素から、前記画素データの予測値を生成する予測画素生成ステップと、前記画素データと、前記予測画素生成ステップで生成された前記予測値との間の差分値を、前記画素データよりも少ないビット数である量子化値へと量子化することにより、前記画素データを、前記量子化値へと圧縮する量子化ステップと、前記量子化ステップにおける量子化幅を決定する量子化幅決定ステップとを含み、前記量子化幅決定ステップは、複数の前記画素から構成するグループ単位で、平坦部とエッジ部とが混在しているか否かを判定し、判定結果に基づいて前記量子化ステップにおける量子化幅を画素単位で適応的に切り替えることを特徴とする。
 従って、本発明では、平坦部とエッジ部とが混在しているか否かを判定し、その判定結果に基づいて量子化処理における量子化幅を画素単位で適応的に切り替えるので、欠陥画素や急峻なエッジが発生している領域においても、量子化誤差が平坦な領域にまで伝播するのを抑えることが可能となる。
 また、本発明では、画像符号化方法が固定長符号化でも実現可能であるので、生成された複数の固定長の符号化データを例えばメモリ等に記憶させた場合にも、画像内の特定の箇所の画素に対応した符号化データを容易に特定することができ、その結果、符号化データに対するランダムアクセス性を維持することができる。すなわち、本発明では、メモリへのランダムアクセス性は維持したまま、従来よりも、欠陥画素や急峻なエッジが発生している領域の画質劣化を、抑圧することができる。
 以上説明したように、本発明の画像符号化方法によれば、欠陥画素や急峻なエッジが発生している領域においても、量子化誤差が平坦な領域にまで伝播するのを抑えることが可能である。
 更に、本発明によれば、メモリへのランダムアクセス性は維持したまま、従来よりも欠陥画素や急峻なエッジが発生している領域の画質劣化を抑圧することが可能である。
図1は特許文献3のデジタル信号処理回路を説明するブロック図である。 図2は本発明の実施形態1における画像符号化方法を示すフローチャート図である。 図3は同実施形態における画像符号化装置の構成を示すブロック図である。 図4は同実施形態における画像符号化方法での量子化幅の決定方法を示すフローチャート図である。 図5は同画像符号化装置に備える予測画素生成部における予測式を説明する図である。 図6(a)は同実施形態における画像符号化処理例と各演算結果を示す図である。 図6(b)は同実施形態を適用しない従来の画像符号化処理例と各演算結果を示す図である。 図7は画像符号化処理における差分値と量子化値のビットイメージを示し、同図(a)は平坦部とエッジ部とが同グループに混在しないと判断された符号化対象画素に対応する差分値Dと量子化値のビットイメージを示す図、同図(b)はエッジ画素のビットイメージを示す図、同図(c)はエッジ画素以外の画素のビットイメージを示す図である。 図8は同実施形態における量子化情報を示す図である。 図9(a)は画像符号化前のビットイメージを示す図、同図(b)は画像符号化後のビットイメージを示す図である。 図10は同実施形態における画像復号化処理を示すフローチャート図である。 図11は同実施形態における画像復号化装置の構成を示すブロック図である。 図12は同実施形態における画像復号化処理例と各演算結果を示す図である。 図13は本発明の実施形態2におけるエッジ部量子化幅及び平坦部量子化幅の選択パターンを示す図である。 図14は同実施形態における差分値と量子化値のビットイメージを示し、同図(a)はエッジ画素のビットイメージを示す図、同図(b)はエッジ画素以外の画素のビットイメージを示す図である。 図15は同実施形態における量子化情報を示す図である。 図16は本発明の実施形態3におけるデジタルスチルカメラの構成を示すブロック図である。 図17は本発明の実施形態4におけるデジタルスチルカメラの構成を示すブロック図である。 図18は本発明の実施形態5における監視カメラの構成を示すブロック図である。 図19は本発明の実施形態6における監視カメラの構成を示すブロック図である。 図20は本発明の実施形態1における画像復号化方法での量子化幅の決定方法を示すフローチャート図である。
 以下、本発明の実施形態について図面を参照しながら説明する。尚、以下の各実施形態や各変形例の説明において、一度説明した構成要素と同様の機能を有する構成要素については、同一の符号を付してその説明を省略する。
 (実施形態1)
 本実施形態における画像符号化装置の符号化処理、及び画像復号化装置の復号化処理の全て又は一部は、LSI(Large Scale Integration)などのハードウェアや、CPU(Central Processing Unit)等により実行されるプログラムによって構成され、これは以下の実施形態でも同様である。
 <画像符号化処理>
 先ず、図2及び図3を参照し、画像符号化装置300が行なう、画像を符号化するための処理(以下、画像符号化処理という)について説明する。前記図3に示す画像符号化装置300は例えば固体撮像素子に備えられる。
 図2は、本発明の実施形態1における画像符号化方法を示すフローチャートである。また、図3は、本発明の実施形態1における画像符号化装置の構成を示すブロック図である。
 符号化対象となる画素(以下、符号化対象画素という)は、処理対象画素値入力部301に入力される。本実施形態において、各画素データはNビット長のデジタルデータとし、各々の画素データに対応した量子化後の画素データ(以下、量子化値という)をMビット長とする。また、少なくとも1画素以上の先頭の符号化対象画素の画素値(以降、初期画素値という)と、複数の画素データに対応した量子化値と、量子化値の量子化幅の情報を表す符号(以下、量子化情報という)を、パッキング部305によりSビット長にパッキングする。そして、パッキングされたパッキングデータを、画像符号化装置300から出力する。
 尚、ここで、自然数N、M、Sは、予め決められているものとする。
 処理対象画素値入力部301に入力された画素データは、適切なタイミングで予測画素生成部302と、差分演算部303とへと、処理対象画素値入力部301から出力される。但し、着目している符号化対象画素が、初期画素値として入力された場合(図2のステップS101でYESの場合)、処理対象画素値入力部301は、量子化処理を省き、受信した符号化対象画素をNビット長の初期画素値として、直接、パッキング部305に出力する。初期画素値は、差分を演算する上で基準となる値であり、本実施形態においては、Sビット長のパッキングデータ毎に少なくとも一つ挿入する。
 着目している符号化対象画素が、初期画素値でない場合(図2のステップS101でNOの場合)は、予測画素生成処理に移行する。予測画素生成処理において、予測画素生成部302に入力される画素データは、着目している符号化対象画素よりも先に入力された初期画素値、又は、以前の符号化対象画素又は先に符号化されて後述する画像復号化装置に送られて復号化された画素データの何れかである。予測画素生成部302は、入力された画素データを用いて、着目している符号化対象画素の予測値を生成する(図2のステップ(予測画素生成ステップ)S102)。
 尚、ここで、画素データに対する符号化方法として予測符号化がある。予測符号化とは、符号化対象画素に対する予測値を生成し、符号化対象画素の画素値と予測値の差分値を符号化する符号化の方式である。予測符号化では、入力が画素データの場合、着目している符号化対象画素の値と、近接する画素の値が同一である、又は、近い可能性が高いということに基づき、近傍の画素データの画素値から、符号化対象画素の値を予測することにより、差分値をできるだけ小さくして量子化幅を抑える効果がある。
 図5は、予測値の算出に用いられる近接する画素の配置を示す図である。図5中の“x”は着目している符号化対象画素の画素値を示す。また、“a”、“b”、“c”は、符号化対象画素の予測値“y”を求めるための、3つの近接画素の画素値である。以下に、一般的に用いられる予測式(1)~(7)を示す。
y=a …(1)
y=b …(2)
y=c …(3)
y=a+b-c …(4)
y=a+(b-c)/2 …(5)
y=b+(a-c)/2 …(6)
y=(a+b)/2 …(7)
 予測画素生成部302は、このように、符号化対象画素の近接画素の画素値“a”、“b”、“c”を用いて符号化対象画素の予測値”y”を求める。そして、予測画素生成部302は、この予測値“y”と符号化対象画素の画素値“x”との予測誤差Δ(=y-x)を求め、この予測誤差Δを符号化する。予測画素生成部302では、前記した予測符号化で用いられる予測式(1)~(7)の何れかの予測式を用いて予測値を算出し、差分値演算部303に出力する。尚、前記した予測式に限らず、圧縮処理で利用可能な、内部のメモリバッファが確保できる場合は、符号化対象画素に隣接している画素以外の周辺画素もメモリバッファに保持しておき、予測に使用することにより、予測精度を向上することも可能である。本実施形態においては、一例として、ステップS102において予測式(1)を使用する。
 差分値演算部303は、処理対象画素値入力部301から受信した符号化対象画素の画素値と、予測画素生成部302から受信した予測値との差分値Dを算出し、予測誤差を求める。図2のステップS103で算出された差分値は、量子化幅決定部306と、量子化処理部(量子化部)304に出力される。
 量子化幅決定部306は、先ず、差分値演算部303から受信した各符号化対象画素に対応する差分値Dに基づき、着目している符号化対象画素の差分値Dの量子化幅(以下、単位量子化幅Qという)を求める。
 この単位量子化幅Qとは、差分値Dの絶対値(以下、差分絶対値という)をバイナリコードで表した際の桁数(ビット数)に1を加えた値から、量子化値のビット長Mを引いた値を指す。つまり、差分値Dの符号つき整数バイナリ表現に必要なビット数と、量子化値のビット長Mとの差に等しい。ここで、Qは正の整数であり、差分値Dのビット数がMよりも小さい値をとる場合は、Qは“0”とする(図1のステップS104)。尚、単位量子化幅Qは、実質的な量子化幅を決定するための値であり、量子化処理における量子化幅そのものではない。算出された単位量子化幅Qは、量子化幅決定部306内の初期量子化幅算出部307と、エッジ部量子化幅算出部308、エッジ判定部309、エッジ画素判別部310に入力される。
 ステップS105では、量子化幅決定部306が、予め決められた所定の画素数Pix_Gの画素データ(複数の符号化対象画素)について、単位量子化幅Qが全て決定されたか否かの判定を行う。
 ここで、画素数Pix_Gは、数が多いほど、他の画素データの影響を受けるため、量子化誤差による画質劣化が発生し易くなるというデメリットがあるが、同じビット長Sで送信可能になる画素数が増え、圧縮率が向上するというメリットがある。
 ステップS105において、この判定の判定結果がNOならば、処理はステップS102に移行し、次に処理対象画素値入力部301が受信した符号化対象画素に対して、ステップS102~ステップS104までの少なくとも一つの処理を実行する。一方、ステップS105において、その判定結果がYESならば、ステップS106に移行する。
 図4は、本実施形態における量子化幅の決定方法を示すフローチャートであり、ステップ(量子化幅決定ステップ)S106における処理の詳細を示している。図4を参照して、ステップS106の量子化幅決定処理について説明する。
 ステップS106では、量子化幅決定部306内において、量子化幅選択部311が、符号化対象画素に対応する量子化幅を、初期量子化幅算出部307の出力結果である初期量子化幅と、エッジ部量子化幅算出部308の出力結果であるエッジ部量子化幅及び平坦部量子化幅とから選択する。
 図4の量子化幅決定ステップでは、先ず、ステップS201の処理が行われる。ステップ(初期量子化幅算出ステップ)S201では、初期量子化幅算出部307が、画素数Pix_Gから構成されるグループ単位で、そのグループの何れの符号化対象画素の量子化でも利用される、共通の量子化幅を初期量子化幅(第1量子化幅)として算出、決定する。具体的には、グループ内のPix_G個の符号化対象画素に対応する、Pix_G個の単位量子化幅Qの中から、最大の幅である量子化幅Q_MAXを、初期量子化幅とする。ステップS201において、初期量子化幅を決定すると、処理はステップS202に移行する。
 ステップ(エッジ部量子化幅算出ステップ)S202では、グループの絵柄が、平坦部とエッジ部とが混在している場合に使用する量子化幅を、エッジ部量子化幅算出部308が算出する。即ち、エッジ部量子化幅算出部308は、エッジ部の量子化処理における量子化幅であるエッジ部量子化幅(第2量子化幅)と、平坦部の量子化処理における量子化幅である平坦部量子化幅(第3量子化幅)との2つの量子化幅を算出する。具体的には、エッジ部量子化幅算出部308では、初期量子化幅に1加算した量子化幅をエッジ部量子化幅とし、初期量子化幅よりも小さい値を、平坦部量子化幅として設定する。ステップS202において、エッジ部量子化幅及び平坦部量子化幅を決定すると、処理はステップS203に移行する。
 ステップ(エッジ判定ステップ)S203では、エッジ判定部309が、符号化対象画素が属するグループの絵柄が、平坦部とエッジ部とが混在しているか否かを判定する。エッジ判定部309は、グループ内のPix_G個の符号化対象画素に対応するPix_G個の単位量子化幅Qの最大の幅である量子化幅Q_MAXと、最小の幅である量子化幅Q_MINとの差分をとる。そして、その差が、所定の閾値(第1の閾値)TH1以上である場合は、着目しているグループ内の絵柄が、平坦部とエッジ部とが混在していると判断する。量子化幅Q_MAXと量子化幅Q_MINとの値が所定の閾値TH1以上離れているということは、グループ内に、予測値との差分の大きい符号化対象画素と、差分の小さい符号化対象画素とが混在していると判断でき、即ち、平坦な領域とエッジが混在していると想定できるからである。ステップS203において、平坦部とエッジ部とが混在しているか否かを判定すると、処理はステップS204に移行する。
 ステップ(エッジ画素判別ステップ)S204では、エッジ画素判別部310において、グループ内の各符号化対象画素が、エッジが発生している画素(以下、エッジ画素という)か否かを判別する。エッジ画素においては、符号化対象画素の画素値と予測値との差分値が十分に大きくなるため、符号化対象画素に対応する単位量子化幅Qの値が所定の閾値(第4の閾値)TH2以上である場合に、エッジ画素と判断する。グループ内のエッジ画素を判別すると、処理はステップS205に移行する。
 尚、ステップS201~ステップS204における処理は、並行して行っても構わない。
 次に、ステップS205において、エッジ判定部309の判定結果により、符号化対象画素が属するグループの絵柄が、平坦部とエッジ部とが混在していると判定された場合(ステップS205でYESの場合)、処理はステップS207に移行する。一方、ステップS205において、判定結果がNOならば、処理は後述するステップS206に移行する。
 ステップS207では、エッジ画素判別部310の判別結果により、着目している符号化対象画素がエッジ画素の場合は、処理はステップS208に移行する。
 ステップS208では、着目している符号化対象画素がエッジ画素であるため、符号化対象画素に対応する量子化幅として、エッジ部量子化幅算出部308により算出されたエッジ部量子化幅を選択する。ステップS207において、この判定の判定結果がNOならば、処理はステップS209に移行する。
 ステップS209では、エッジ判定部309の判定結果と、エッジ画素判別部310の判別結果により、着目している符号化対象画素は、エッジが近接する平坦部であると判断できるため、符号化対象画素に対応する量子化幅として、エッジ部量子化幅算出部308により算出された平坦部量子化幅を選択する。
 ステップS205において、この判定の判定結果がNOならば、符号化対象画素が属するグループの絵柄が、全体的に平坦か、又は、予測値と符号化対象画素の画素値との差分値が大きくなるような変化が、複数領域に発生しているような複雑な絵柄であると判断できる。即ち、初期量子化幅が、元々、小さい量子化幅であるか、又は、絵柄が複雑であるため、グループ内の全ての符号化対象画素が、大きい量子化幅で一律量子化しても、視覚的に劣化が感知されにくい条件であると言える。そのため、ステップS206では、グループ内の符号化対象画素に対応する量子化幅は全て、初期量子化幅算出部307により算出された初期量子化幅とする。
 各画素に対応する量子化幅が決定されると、処理はステップS107に移行する。
 ステップ(量子化ステップ)S107では、量子化処理部304において量子化処理が施される。量子化処理部304は、量子化幅選択部311で決定した量子化幅により、差分値演算部303から受信した、符号化対象画素の画素値と、その予測値との差分値Dを量子化する量子化処理を行う。尚、量子化処理とは、差分値Dを量子化幅の数だけ下位にビットシフトする処理である。量子化処理部304は、量子化幅が“0”である場合、量子化は行なわない。量子化処理部304から出力された量子化値はパッキング部305へ送られる。
 ステップS108では、グループ内の符号化対象画素の画素数Pix_Gについて、量子化処理が全て終了したか否かの判定を行う。ステップS108においてNOならば処理はステップS107に移行し、同一グループ内における次の符号化対象画素に対してステップS107の量子化処理を実行する。一方、ステップS108においてYESならば、処理はステップS109に移行する。
 ステップ(パッキングステップ)S109では、パッキング部305において、少なくとも1画素以上の初期画素値と、複数の量子化値と、少なくとも一つ以上のJビット長(Jは自然数)の量子化情報とを結合させて、Sビットにパッキングする。更に、エッジ判定部309における判定結果によって、平坦部とエッジ部とが混在していると判断された場合は、量子化値にエッジフラグを1ビット埋め込む。そして、パッキング部305は、パッキングされたパッキングデータを外部のSDRAM等のメモリ、又は、後述する画像復号化装置に出力する。設定する固定ビット長Sとしては、使用する集積回路のデータ転送のバス幅のビット数と同じビット数が考えられる。パッキングデータのビットの後部において、未使用ビットが残存する場合は、Sビットに達するようダミーデータを記録する。
 次に、本実施形態における画像符号化処理の詳細な説明を行なう。
 図6は、本実施形態における画像符号化処理を説明するための図である。図6(a)は、本実施形態に係る画像符号化処理の例であり、図6(b)は本実施形態を適用しない従来の画像符号化処理の例である。
 ここで、処理対象画素値入力部301は、固定ビット長(Nビット)の画素データを、順次、受信するとする。また、処理対象画素値入力部301が受信する画素データのデータ量は10ビット(N=10)であるとする。即ち、画素データのダイナミックレンジは10ビットであるとする。ここで、量子化値のビット長Mは7ビットであるとする。また、パッキング部305は受信したデータをSビットにパッキングして、パッキングされたパッキングデータを画像符号化装置300から外部に出力する。設定する固定ビット長Sは、48ビットとする。ここで、1グループを構成する画素数Pix_Gは、例えば、“5”であるとする。
 図6(a)には、一例として、処理対象画素値入力部301に入力される6個の符号化対象画素の画素データ(以下、符号化対象画素データという)が示される。処理対象画素値入力部301には、画素P1,P2…P6の順で、各画素に対応する10ビットの画素データが入力されるとする。画素P1~P6内に示される数値(150等)は、画素データが示す信号レベルである。尚、画素P1に対応する画素データは先頭の符号化対象画素であり、その画素値は初期画素値であるとする。
 本実施形態では、符号化対象画素の予測値は、一例として、予測式(1)により予測画素生成部302によって算出されるものとする。この場合、算出される符号化対象画素の予測値は、符号化対象画素の左隣の画素の値(図5のa)となる。すなわち、予測画素生成部302は、符号化対象画素の画素値が一つ前に入力された画素と同一の画素値(信号レベル)になる可能性が高いと予測していることになる。
 図2の画像符号化処理では、先ず、ステップS101の処理が行なわれる。ステップS101では、処理対象画素値入力部301が、入力された符号化対象画素データが初期画素値であるか否かを判定する。ステップS101において、その判定がYESならば、処理対象画素値入力部101は、受信した画素データを内部のバッファに記憶させ、処理対象画素値入力部301は、入力された画素データをパッキング部305へ送信する。そして、処理は後述するステップS109に移行する。一方、ステップS101においてその判定がNOならば、処理はステップS102に移行する。
 ここで、処理対象画素値入力部301は、画素P1に対応する画素データを初期画素値として受信したとする。この場合、処理対象画素値入力部301は、入力された画素データを内部のバッファに記憶させ、処理対象画素値入力部301は、受信した画素データをパッキング部305へ送信する。尚、バッファに画素データが記憶されている場合、処理対象画素値入力部301は、受信した画素データを内部のバッファに上書き記憶させる。
 ここで、画素P2が符号化対象画素であるとする。この場合、処理対象画素値入力部301は、画素P2に対応する符号化対象画素データを受信したとする。符号化対象画素データが示す画素値は“1023”(図6(a)参照)であるとする。この場合、受信した画素データは、初期画素値ではないので(ステップS101でNO)、処理対象画素値入力部301は受信した画素データを差分値演算部303へ送信する。
 また、ステップS101でNOと判定された場合、処理対象画素値入力部301は内部のバッファに記憶されている画素データを予測値画素生成部302へ送信する。ここで、送信される画素データは、画素P1の画素値“150”を示すとする。
 また、処理対象画素値入力部301は、受信した画素データを内部のバッファに上書き記憶させる。そして、処理はステップS102に移行する。
 ステップS102では、予測値画素生成部302が符号化対象画素の予測値を算出する。具体的には、予測値画素生成部302は、先述の通り、例えば予測式(1)を使用して、予測値を算出する。この場合、予測値画素生成部302が処理対象画素値入力部301から受信した画素P1の画素値(“150”)が予測値として算出される。予測値画素生成部302は、算出した予測値“150”を差分値演算部303へ送信する。
 ステップS103では、差分値演算部303が差分値演算処理を行う。具体的には、差分値演算部303が、処理対象画素値入力部301から受信した符号化対象画素データから、予測値画素生成部302から受信した予測値を減算し、差分値Dを算出する。ここで、受信した符号化対象画素データの画素値が“1023”であり、予測値が“150”であるとする。符号化対象画素データ(“1023”)から、予測値(“150”)を減算することにより、差分値D“873”を算出する。また、差分値演算部303は、算出した差分値Dを量子化処理部304と量子化幅決定部306へ各々送信する。
 ステップS104では、量子化幅決定部306が、入力された画素毎に単位量子化幅Qを求める。量子化幅決定部306では、差分値Dの差分絶対値をバイナリコードで表した際の桁数に1を加えた値、即ち、差分値Dのビット数を求める。そして、差分値Dのビット数から量子化値のビット長Mを引いた値を単位量子化幅Qとする。ここで、差分値Dは、“873”であるとする。差分絶対値は“873”となり、そのビット数は10ビットとなる。ビット長Mは7ビットであるとすると、Q=10+1-7で、画素P2の単位量子化幅Qは、“4”となる。尚、Qは正の整数であるため、差分値のビット数が量子化値のビット長Mよりも小さい値をとる場合は、Qは0とする。量子化幅決定部306は、求めた単位量子化幅Qを、量子化幅決定部306内の初期量子化幅算出部307と、エッジ部量子化幅算出部308、エッジ判定部309、エッジ画素判別部310にそれぞれ送信する。
 ステップS105では、量子化幅決定部306が、グループを構成する画素数Pix_Gの画素データについて、単位量子化幅Qが全て決定されたか否かの判定を行う。ここで、着目している符号化対象画素が画素P2であり、画素数Pix_Gが“5”であるとする。このとき、ステップS105の判定において、判定結果はNOであり、処理はステップS102に移行する。次に、処理対象画素値入力部301が受信した画素(P3)の画素データに対して、ステップS102からステップS104までの処理を実行する。画素P6までの入力された画素に対して、単位量子化幅Qが全て決定されると、ステップS105の判定において、YESと判定され、ステップS106に移行する。
 ステップS106では、量子化幅決定部306内において、量子化幅選択部311が、符号化対象画素に対応する量子化幅を、初期量子化幅とエッジ部量子化幅及び平坦部量子化幅とから、エッジ有無の情報とエッジフラグとに基づいて選択する。
 ステップS106では、先ず、ステップS201の処理が行われる。ステップS201では、初期量子化幅算出部307が、グループ内のPix_G個の画素に対応する、Pix_G個の単位量子化幅Qの中から、最大の幅である量子化幅を、最大量子化幅Q_MAXとして算出する。図6(a)において各符号化対象画素の単位量子化幅Qは”4”、”4“、”0“、”0“、”0“であるため、最大量子化幅Q_MAXは、”4“となる。ここで算出した最大量子化幅Q_MAXは、量子化幅決定部306により、グループ内の全画素に対して共通の量子化幅となる初期量子化幅として設定される。つまり、グループに属する何れの符号化対象画素の量子化幅も、初期量子化幅は、その最大量子化幅Q_MAXである。
 次に、ステップS202では、エッジ部量子化幅算出部308が、エッジ部の量子化処理における量子化幅であるエッジ部量子化幅と、平坦部の量子化処理における量子化幅である平坦部量子化幅とを算出する。エッジ部量子化幅は、初期量子化幅に1加算した量子化幅である。ここで、初期量子化幅は“4”であるため、エッジ部量子化幅は“5”となる。
 一方、平坦部量子化幅は、平坦部の量子化処理における量子化幅であり、エッジ画素以外の符号化対象画素の量子化処理において使用される量子化幅となる。エッジ画素か否かの判定は、エッジ画素判別部310が、後述する処理により判定する。その際の判定方法としては、単位量子化幅Qの値が所定の閾値(第4の閾値)TH2以上である場合に、エッジ画素と判断する。平坦部量子化幅は、初期量子化幅より小さい量子化幅に設定することにより、エッジ画素以外の領域の量子化誤差を低減することを目的としており、例えば量子化幅“2”とする。
 ステップS203では、エッジ判定部309が、グループの絵柄が平坦部とエッジ部とが混在しているか否かを判定する。エッジ判定部309は、グループ内のPix_G個の単位量子化幅Qの最大の幅である量子化幅Q_MAXと、最小の幅である量子化幅Q_MINとの差分をとり、その差が所定の閾値(第1の閾値)TH1以上である場合は、着目しているグループ内の絵柄が、平坦な領域とエッジが混在していると判断する。ここで、グループ内の最大量子化幅Q_MAXが“4”であり、また、最小量子化幅Q_MINが“0”であったとする。そして、エッジを判定する閾値TH1の値が“3”であったとする。この場合、最大量子化幅Q_MAXと最小量子化幅Q_MINとの差を演算すると、Q_MAX―Q_MIN=4-0=4となる。閾値TH1と比較すると、4≧3が成立するため、着目しているグループは、平坦な領域とエッジとが混在している絵柄であると判断できる。
 尚、平坦部とエッジ部とが混在しているか否かを判定する方法として、グループ内の最大量子化幅Q_MAXと最小量子化幅Q_MINとに各々対応する閾値(第2の閾値)TH3と閾値(第3の閾値)TH4を、それぞれ予め設定しておいてもよい。ここで、閾値TH3は、エッジ部を定義するための差分値Dの閾値を表し、閾値TH4は、平坦部を定義するための差分値Dの閾値を表す。このため、最大量子化幅Q_MAXが閾値TH3以上であり、かつ、最小量子化幅Q_MINが閾値TH4以下である場合に、平坦部とエッジ部とが混在していると判定することができる。
 エッジ判定部309は、エッジ判定処理を終了すると、エッジ有無の情報を量子化幅選択部311へ送信する。
 ステップS204では、エッジ画素判別部310が、着目している符号化対象画素がエッジ画素か否かを判別する。エッジ画素判別部310は、単位量子化幅Qの値が所定の閾値TH2以上である場合に、エッジ画素と判断し、判別結果はエッジフラグとして量子化幅選択部311へ送信する。エッジフラグは、エッジ画素である場合は”1“を設定し、エッジ画素以外の場合は”0“を設定するものとする。ここで、閾値TH2の値が“2”であったとする。図6(a)において、画素P2~P6の単位量子化幅Qは”4”、”4“、”0“、”0“、”0“であるため、それぞれ閾値TH2の値“2”と比較することにより、閾値TH2以上の符号化対象画素をエッジ画素と判断し、エッジフラグの値は、”1”、”1“、”0“、”0“、”0“となる。
 尚、単位量子化幅Qの値が所定の閾値TH2以上である場合に、エッジ画素と判断するということは、符号化対象画素の画素値と予測値との差分値のビット長が所定のビット以上である画素、つまり、所定の差分値以上となる画素では、急峻なエッジが発生していると判断しているのと等しい。エッジ画素判別部310が、算出したエッジフラグを量子化幅選択部311へ送信すると、処理はステップS205へ移行する。
 尚、ステップS201~ステップS204における処理は、グループ内の符号化対象画素に対応する単位量子化幅Qが全て算出されれば、実行可能な処理であるため、初期量子化幅算出部307と、エッジ部量子化幅算出部308、エッジ判定部309及びエッジ画素判別部310に、単位量子化幅Qが全て入力された時点で、並行して行っても構わない。
 ステップS205では、前述したステップS203におけるエッジ判定部309の判定結果により、符号化対象画素が属するグループの絵柄について、平坦部とエッジ部とが混在しているか否かを判定する。
 ここで、着目している符号化対象画素は、画素P2であるとする。量子化幅選択部311が、受信した初期量子化幅が“4”、エッジ部量子化幅が“5”、平坦部量子化幅が“2”であったとする。また、符号化対象画素が属するグループの絵柄が、平坦部とエッジ部とが混在していると、エッジ判定部309が判定したとする。また、量子化幅選択部311がエッジ画素判別部310から受信したエッジフラグの値が“1”であったとする。
 量子化幅決定処理(図4参照)では、平坦部とエッジ部とが混在していると判定されたため、ステップS205においてYESと判定され、ステップS207へ移行する。ステップS207では、エッジフラグの値が“1”であるため、YESと判定され、処理はステップS208へ移行する。ステップS208では、符号化対象画素に対応する量子化幅として、エッジ部量子化幅である量子化幅“5”が選択され、画素P2の量子化幅決定処理は終了する。
 ステップS107では、量子化処理部304が、量子化幅選択部311で決定した量子化幅により、差分値演算部303から受信した差分値Dを量子化する。量子化処理では、量子化処理部304が量子化幅選択部311から受信した量子化幅をQ_Fixedとした場合、差分値Dを量子化幅Q_Fixedの数だけ下位にビットシフトする処理であり、これは、差分値Dを2のQ_Fixed乗で除算する処理と等価である。ここで、差分値Dが“873”、量子化幅が“5”であったとする。この場合、量子化処理では、量子化処理部304は、“873”を2の5乗で除算することにより量子化処理を行って、量子化値“5”を算出する。
 尚、量子化処理としては、例えば、ビットシフタを利用することにより、画像符号化装置300の回路規模を削減することが可能となる。
 ここで、量子化処理部304における量子化処理により、量子化誤差が発生したとき、画像符号化処理及び画像復号化処理において、予測値自体が一致せず、画質の劣化に繋がる場合がある。そのため、ステップS107において、量子化処理部304が量子化処理を実行する際に、予測画素生成部302における予測画素生成処理(図2のステップS102)において、予測値を再度算出し、符号化の対象となる差分値を求めて直してもよい。具体的には、h番目の符号化対象画素の予測値を算出する際に、(h-1)番目の画素データが初期画素値である場合は、(h-1)番目の画素データが示す値そのものを予測値とする。一方、(h-1)番目の画素データが初期画素値でない場合は、画像符号化装置300により、一旦、符号化された(h-1)番目のデータを後述する画像復号化装置に入力させ、復号化することにより得られる画素データが示す画素値を予測値とすればよい。これにより、量子化処理部304における量子化処理により量子化誤差が生じるような場合でも、画像符号化処理及び画像復号化処理において、予測値を一致させ、画質の劣化を抑圧することが可能となる。
 図6(a)では、予測画素生成部302が、画像復号化処理により得られる画素データを予測値とした際の差分値を圧縮対象値として表し、量子化処理部304に送信するものとする。つまり、図6(a)に示した圧縮対象値とは、ステップS107において、量子化処理部304が量子化処理を実行する対象となる値であり、復号化結果と入力値(符号化対象画素データ)との差分値に等しい。
 次に、ステップS108で、グループ内の画素数Pix_Gについて、量子化処理が全て終了したか否かの判定を行う。ここで、着目している符号化対象画素は、画素P2であるとする。ステップS108ではNOと判定され、処理はステップS107へ移行する。以降の処理は、画素P3の画像符号化処理となり、前述した処理と重複するため、詳細な説明は繰り返さない。
 画素P4の量子化幅決定処理においては、初期量子化幅及びエッジ部量子化幅、平坦部量子化幅、エッジ有無の情報は、グループで共通する値であるため、変更はない。しかし、量子化幅選択部311がエッジ画素判別部310から受信したエッジフラグの値が“0”であったとする。ステップS205では、平坦部とエッジ部とが混在していると判定されたため、YESと判定され、ステップS207へ移行する。ステップS207では、エッジフラグの値が“0”であるため、NOと判定され、処理はステップS209へ移行する。ステップS209では、符号化対象画素に対応する量子化幅として、平坦部量子化幅である量子化幅“2”が選択され、画素P4の量子化幅決定処理は終了する。
 同様の処理を繰り返し実行し、グループ内の画素数Pix_Gの符号化対象画素について、量子化幅決定部306で、各符号化対象画素に対応する量子化幅を決定し、量子化処理部304により量子化処理を実行する。
 ステップS109では、パッキング部305が、エッジ判定部309によって平坦部とエッジ部とが混在していると判断された場合は、量子化値にエッジフラグを1ビット埋め込む。そして、少なくとも1画素以上の初期画素値と、複数の量子化値と、少なくとも一つ以上の量子化情報とを結合させて、Sビットにパッキングする。更に、パッキング部305は、量子化幅決定部306から受信した量子化幅の情報を符号化し、ビット長Jの量子化情報を生成する。
 ここで、パッキング部305が、パッキングする量子化値の例を図7を用いて説明する。図7は、本実施形態の画像符号化処理における差分値Dと量子化値とのビットイメージを示す図である。そして、量子化処理部304が量子化処理を実行することにより、差分値Dのビットデータが、量子化値のビットデータとして、どのビット位置に格納されるかを表している。また、図7(a)は、エッジ判定部309によって平坦部とエッジ部とが同グループに混在しないと判断された符号化対象画素に対応する差分値Dと量子化値とのビットイメージを示し、図7(b)は本実施形態のエッジ画素、図7(c)は本実施形態のエッジ画素以外の画素のビットイメージをそれぞれ示している。
 ここで、処理対象画素値入力部301が入力する画素データのビット長Nは10ビットであるため、その差分値Dの符号つき整数のバイナリ表現に必要なビット長は、11ビットとなる。図7においては、差分値Dの11ビット中の最上位ビット(“b10”)は、正負符号を表すビットデータであるとする。また、量子化値のビット長Mは7ビットであり、図7における量子化値の最上位ビット(“b6”)は、差分値Dの正負符号を表すビットデータが格納されるものとする。つまり、差分値Dの最上位ビット(“b10”)の情報がそのまま量子化値の最上位ビット(“b6”)に格納される。具体的には、例えば、差分値演算部303において符号化対象画素データから予測値を減算した結果、差分値Dが正数である場合は、量子化処理部304は、量子化値の最上位ビットには“0”を設定し、負数である場合は、“1”を設定する。
 ここで、予測値と符号化対象画素データとの差分値が大きかった場合、差分絶対値を表現するために10ビット必要であったとする。エッジ判定部309によって平坦部とエッジ部とが混在していないと判断された場合は、差分値Dのビットデータb4~b9が量子化値のビットb0~b5に格納される(図7(a)参照)。ビットデータb0~b3の4ビットが省かれるということは、量子化処理部304が、初期量子化幅(“4”)によって量子化処理を施したためである。
 本実施形態において、エッジ判定部309によって平坦部とエッジ部とが混在していると判断された場合は、エッジ画素の量子化値は、差分値Dのビットデータb5~b9が量子化値のビットb1~b5に格納される(図7(b)参照)。これは、量子化処理部304が、エッジ部量子化幅(“5”)により量子化処理を施したことに相当する。ここで、ビットb0には、前述したエッジ画素判別部310により判別されるエッジフラグを格納する。即ち、量子化値を符号化したMビットのビットデータのうち、差分値Dについての情報を格納できるビット長は、(M-1)ビットということになる。
 一方、本実施形態において、エッジ判定部309によって平坦部とエッジ部とが混在していると判断された場合の、エッジ画素以外の画素においては、図7(c)のように、差分値Dのビットデータb2~b6を量子化値のビットb1~b5に格納する。これは、量子化処理部304が、平坦部量子化幅(“2”)により量子化処理を施したことに相当する。エッジ画素以外の画素においても、エッジ画素と同様に、ビットb0にはエッジフラグを格納する必要があるため、量子化値のうち、差分値Dについての情報を表すビット長は、(M-1)ビットである。
 ここで、エッジ画素判別部310がエッジ画素が否かを判別する際の単位量子化幅Qの閾値がTH2であるとする。前述の通り、エッジ判定部309によって平坦部とエッジ部とが混在していると判断された場合、差分値Dについての情報を格納できる量子化値のビット長は、(M-1)ビットである。このため、エッジ画素判別部310は、差分値Dのビット長が、以下の式(8)で求められるビット長L以上であれば、エッジ画素と判断しているのと等しい。
L=(TH2+(M-1))   …(8)
 換言すると、差分値Dのビット長がLビット以上の符号化対象画素データは、図7(b)のように、エッジ部量子化幅により量子化処理が施され、Lビットよりも小さい符号化対象画素データはエッジ画素ではないと判断され、図7(c)のように、平坦部量子化幅により量子化処理が施される。
 また、平坦部量子化幅は、平坦な領域の量子化誤差を低減するための量子化幅であるため、できるだけ小さな値に設定するのが望ましい。しかし、閾値TH2は、式(8)の通り、エッジ画素を判断する際の閾値を導いている。このため、式(8)により、ビット長Lが極端に小さくなるような閾値TH2を設定すると、エッジ画素であると判断する閾値が低くなってしまい、結果、エッジ画素である場合に、符号化対象画素データのうちのほとんどのデータが失われてしまう可能性もある。
 ここで、閾値TH2の値が“2”であったとする。量子化値のビット長Mは7ビットであるため、式(8)により、TH2+(M-1)=8となり、差分値Dのビット長が8ビットよりも小さい場合は、平坦部量子化幅により量子化処理が施される。従って、平坦部量子化幅による量子化処理が選択される条件を満たすための、差分値Dの最大ビット長は、7ビットとなる。よって、エッジ画素以外の量子化値は、差分値Dの7ビット目までのビットデータを量子化値として格納する必要があり、図7(c)のように、差分値Dのビットデータb2~b6が量子化値のビットb1~b5に格納される。また、この場合の平坦部量子化幅の値は、閾値TH2の値と同じ値(“2”)となる。
 図7(a)と図7(b)の量子化値のビットデータを比較すると、本実施形態のエッジ画素に関しては、フラグビットとして1ビット割り当てることにより、平坦部とエッジ部とが混在していない場合よりも、量子化幅が大きな値をとることになる。しかし、被写体を撮影した際の絵柄自体が変化している場合、視覚的に局所的なエッジ部のレベル変化を量子化誤差として確認することは困難である。
 また、被写体自体には変化はないが、撮像素子の欠陥画素を含む領域で、欠陥画素とその隣接画素との差が極端に大きくなってしまった場合を考える。エッジ画素(欠陥画素)が量子化処理により大きく劣化したとしても、一般的に、撮像素子から入力された撮像信号に対して画像信号処理を施す信号処理装置において、欠陥画素を補正する回路が搭載されている。このため、信号処理装置において、エッジ画素は、量子化誤差の少ない周辺の画素を用いて、適切な画素値に補正することが可能である。
 更に、図7(a)と図7(c)の量子化値のビットデータを比較すると明確なように、エッジ画素以外の符号化対象画素に対応する量子化幅においては、量子化幅が抑えられている。よって、量子化処理が施された場合に、視覚的に大きな劣化として感知し易い平坦部の画質劣化の抑圧が可能となる。
 次に、パッキング部305が生成する量子化情報の例を図8に示す。ここで、量子化情報のビット長Jが“3”であるとする。図8は、差分値Dの符号つき整数のバイナリ表現に必要なビット長と、エッジ判定部309による判定結果と、量子化幅により決定される3ビットの量子化情報とを対応させた図である。図中のエッジ判定部309による判定結果は、平坦部とエッジ部とが混在していると判断された場合を“1”で、それ以外を“0”で示している。例えば、エッジ判定部309により平坦部とエッジ部とが混在していると判断された場合は、図8により、パッキング部305は、量子化情報として“101”を生成する。また、エッジ判定部309により平坦部とエッジ部とが混在していないと判断され、量子化幅決定部306から受信した量子化幅が“3”であったとする。この場合、図8により、パッキング部305は、量子化情報として“011”を生成する。
 ステップS109のパッキング処理では、パッキング部305において、処理対象画素値入力部301から受信した初期画素値である画素P1の画素データを、Sビット長のバッファメモリに格納する。その後は、順次、量子化幅決定部306から受信した量子化幅、及び、エッジ判定部309により判定されたエッジ有無の情報を符号化したJビット長の量子化情報、量子化処理部304から受信した符号化対象画素P2の量子化値を、前記のバッファメモリに格納していく。ここで、固定ビット長Sが“48”、入力する符号化対象画素データのビット長Nが“10”、量子化情報のビット長Jが“3”であるとする。量子化値のビット長Mは7ビットであるため、48ビット長のバッファメモリの先頭から20ビット分符号化データが格納されたことになる。符号化対象画素のパッキング処理が終了すると、ステップS110に移行する。
 ステップS110では、Sビットにパッキングする画素数Pixについて画像符号化処理が終了したか否かを判定する。ここで、Pixは、予め算出されているものとする。
 ここで、固定ビット長Sが“48”、入力する符号化対象画素データのビット長Nが“10”、量子化情報のビット長Jが“3”、量子化値は7ビットであるとき、Pixは6画素であれば、Sビットにパッキングが可能となる。尚、これは、Sビットのパッキングデータが、1画素の初期画素値と、5画素で構成される符号化対象画素のグループが1グループで構成されることを示す。尚、Sビット中のグループ数は、1グループに限定しなくてもよい。
 ステップS110において、判定結果がNOならば、処理はステップS101に移行し、次に処理対象画素値入力部301が受信した符号化対象画素データに対して、ステップS101~ステップS109までの少なくとも一つの処理を実行する。画素P3~画素P6に対してステップS101~ステップS109までの処理を繰り返し行い、順次、バッファメモリに格納していく。
 一方、ステップS110において、判定結果がYESならば、バッファメモリ内の符号化データをSビット単位で画像符号化装置300から出力し、処理はステップS111に移行する。
 ステップS111では、出力した符号化データで1画像についての符号化処理が全て終了したかを判別し、YESであれば符号化処理を終了し、NOであればステップS101へ移行して、ステップS101~ステップS110の少なくとも一つの処理を実行する。
 以上の処理及び演算を実行した結果、算出される符号化対象画素P1~P6の各演算結果と、パッキング部305にてパッキングされる7ビットの量子化値、復号化結果と入力値(符号化対象画素データ)との誤差を図6(a)に示す。
 また、図9(a)は、画像符号化処理を適応しない場合、つまり、量子化幅が常に“0”であると想定された場合の、Sビットのパッキングデータのビットイメージである。尚、このビットイメージは、実際に画像符号化装置300により生成されるビットイメージではない。図9(b)は、画像符号化処理を適応し、実際にパッキング部305によりバッファメモリに格納され、画像符号化装置300から出力されるビットイメージである。
 図9(b)は、最初に入力された画素P1は、初期画素値としてパッキング部107にN(“10”)ビットで入力されることが、左端からの10ビットにより示される。その後は、量子化情報をJ(“3”)ビット、以降の画素P2~P6に対応する量子化値をM(“7”)ビットの符号化データとして、最初の10ビットのデータの後ろに続く構成となっている。画素P2~画素P6までを符号化することによって、同じビット長Sでも格納可能になる画素の画素数が、より多い画素数に増えている。
 また、パッキング部305によりパッキングするデータのビット長Sを、使用される集積回路のデータ転送のバス幅に設定することにより、一回の転送で送信できる画素数が増え、また、バス幅は固定長にすることを保証できる。従って、ある圧縮された画素データにデータアクセスすることが要求される場合、バス幅毎にパッキングされたパッキングデータにデータアクセスするだけでよい。このとき、バス幅とパッキングデータのビット長が一致せず、未使用ビットが存在する場合は、図9(a)に示したように未使用ビットをダミーデータに置き換えればよい。
 図6(b)は、本実施形態を実施しない従来の画像符号化処理の例である。従来の画像符号化処理においても、本実施形態と同様に、ステップS101~ステップS105までの処理が実行される。ステップS106では、初期量子化幅算出部307が、画素数Pix_Gから構成されるグループ単位で、そのグループの何れの符号化対象画素の量子化でも利用される、共通の量子化幅を初期量子化幅として決定する(図4のステップS201)。従来の画像符号化処理においては、ステップS201において求められた初期量子化幅がグループ共通の量子化幅となり、グループに属する符号化対象画素は、全て初期量子化幅で一律量子化されることになる。そのため、従来の画像符号化処理においては、ステップS201の処理が終了すると、ステップ(量子化幅決定ステップ)S106における処理は終了し、ステップS107へ移行する。
 従来の画像符号化処理では、グループ内の符号化対象画素が全て初期量子化幅で一律量子化されるため、画素P4~P6のように画素の信号レベルの変化が少ない平坦な領域においても、量子化幅“4”で量子化処理が施される。その際の処理及び演算において算出される符号化対象画素P1~P6の各演算結果と、量子化値、復号化結果と入力値(符号化対象画素データ)との誤差を図6(b)に示した。図6(a)に示した復号化結果及び復号化結果と入力値(符号化対象画素データ)との誤差と比較すると明確なように、画素P4~P6の平坦な領域において、誤差が拡大している。具体的には、本実施形態を実施しない従来の画像符号化処理(図6(b))では、画素P4~P6の平坦な領域において、大きな量子化幅で量子化処理が施された影響により、誤差が、”-4”、”-5“、”8“と発生しているのに対し、本実施形態を実施した形態(図6(a))では、量子化幅を抑えたため、”0”、”-1“、”0“と誤差の発生を抑圧できているのが判る。
 尚、本実施形態においては、画像符号化処理の方法を、予測式(1)を用いた予測符号化とし、処理対象画素値入力部301から受信した符号化対象画素データから、予測値画素生成部302から受信した予測値を減算することにより、差分値を算出した。しかし、符号化処理の方法はこれに限定せず、着目している符号化対象画素データの画素値に近似する予測値を求め、予測値との差分を表す値を算出し、量子化対象とした上で、量子化処理を施す方法であれば、本発明に適用可能であることはいうまでもない。
 以上により、平坦部とエッジ部とが混在する場合、従来の画像符号化処理では、視覚的に劣化が目立つ平坦部の画質まで劣化してしまうのに対し、本実施形態の画像符号化処理により、平坦部の劣化の抑圧が可能となることが判る。
 従って、本実施形態によれば、比較的平坦な領域中に欠陥画素や急峻なエッジが発生した場合等のように、平坦部とエッジ部とが混在している場合においても、画素単位で適応的に、量子化処理における量子化幅を切り替えることにより、ランダムアクセス性は維持したまま、視覚的に劣化が目立つ平坦部の画質劣化の度合いを小さくすることができる。
 <画像復号化処理>
 以下に、図10及び図11を参照して、画像復号化装置110が行う符号化データを復号化するための処理(以下、画像復号化処理という)について説明する。
 図10は、本発明の実施形態1における画像復号化処理のフローチャートである。また、図11は、本発明の実施形態1における画像復号化装置110の構成を示すブロック図である。
 例えば、アンパッキング部111に入力される符号化データは、図6(a)に示される画素P1~P6を復元させるために必要な符号化データである。アンパッキング部111は、パッキング部305、又は、SDRAM等のメモリから送られたSビットの固定長符号化データを解析し、その固定長符号化データを複数のデータへと分離する。つまり、アンパッキング部111は、送られた固定長符号化データをNビット長の初期画素値、又はJビット長の量子化幅の情報が格納された量子化情報、Mビット長の復号化の対象となる画素(以下、復号化対象画素という)に対応した量子化値に分離する(図10のステップS301)。
 アンパッキング部111で解析された符号化データは、適切なタイミングで量子化幅決定部112及び出力部116に送信される。着目している符号化データが初期画素値として入力された場合(図10のステップS302でYESの場合)は、Nビット長の符号化前のダイナミックレンジを保持した画素データとして送られてくる。このため、アンパッキング部111は、着目している符号化データに対しては、逆量子化処理を省き、直接、出力部116に送信する。
 着目している符号化データが初期画素値でない場合(図10のステップS302でNOの場合)は、アンパッキング部111は、量子化情報が格納されたJビット長の符号化データ又は量子化値が格納されたMビット長の符号化データを量子化幅決定部112に送信し、逆量子化処理における量子化幅の決定処理に移行する(図10のステップS303)。
 ステップ(量子化幅決定ステップ)S303では、量子化幅決定部112内において、量子化幅選択部119が、量子化情報解析部117の解析結果と、エッジフラグ分離部118が分離したエッジフラグとを基に、逆量子化処理における量子化幅を画素毎に決定し、対応する量子化値と共に逆量子化処理部113に出力する。そして、処理は、逆量子化処理に移行する。
 図20は、逆量子化処理における量子化幅の決定方法を示すフローチャートであり、ステップS303における処理の詳細を示している。図20を参照して、ステップS303の逆量子化処理における量子化幅決定処理について説明する。
 先ず、量子化幅決定部112が、アンパッキング部111から受信した符号化データがJビット長の量子化情報である場合(図20のステップS401でYESの場合)は、量子化幅決定部112は、アンパッキング部111から受信した符号化データから、逆量子化処理における量子化幅の情報を解析する(図20のステップS402)。具体的には、量子化幅決定部112内の量子化情報解析部117が、画像符号化装置300が実施した画像符号化処理において、パッキング部305が生成したJビット長の量子化情報を解析する。この解析処理により、エッジ判定部309による判定結果と、量子化処理部304において行われた量子化処理における量子化幅の情報とを抽出する。量子化情報解析部117は、その解析結果から、エッジ判定部309によるエッジ有無の判定結果をエッジフラグ分離部118に送信し、量子化幅の情報を量子化幅選択部119に送信する。
 一方、量子化幅決定部112が、アンパッキング部111から受信した符号化データが、量子化値が格納されたMビット長の符号化データである場合(図20のステップS401でNOの場合)は、前述のようにステップS402にて量子化情報解析部117が解析した結果から、着目している復号化対象画素が属するグループの絵柄について、平坦部とエッジ部とが混在するか否かを判定する(図20のステップS403)。着目している復号化対象画素が属するグループの絵柄が、平坦部とエッジ部とが混在する場合(図20のステップS403でYESの場合)は、エッジフラグ分離部118が、アンパッキング部111から受信した復号化対象画素に対応する量子化値に埋め込まれたエッジフラグを分離する。そして、エッジフラグ分離部118は、分離処理を終了すると、分離したエッジフラグの情報を量子化幅選択部119に送信し、また、量子化値の情報を逆量子化処理部(逆量子化部)113に送信する(図20のステップS405)。
 量子化幅選択部119は、エッジフラグを受信すると、その情報から着目している復号化対象画素がエッジ画素か否かを判定する(図20のステップS406)。エッジフラグにより着目している復号化対象画素がエッジ画素の場合は、処理はステップS407に移行する。
 ステップS407では、着目している復号化対象画素がエッジ画素であるため、対応する量子化幅として、量子化情報解析部117の解析結果からエッジ部量子化幅を選択する。ステップS406において、この判定の判定結果がNOならば、処理はステップS408に移行する。
 ステップS408では、量子化情報解析部117の解析結果と、エッジフラグ分離部118から受信したエッジフラグの情報とにより、着目している復号化対象画素は、エッジが近接する平坦部であると判断できるため、対応する量子化幅として平坦部量子化幅を選択する。
 ステップS403において、この判定の判定結果がNOならば、量子化幅選択部119は、復号化対象画素が属するグループの絵柄が、全体的に平坦か、又は、複雑な絵柄であると判断できるため、グループ内の全ての復号化対象画素に対応する量子化幅は、量子化情報解析部117の解析結果から得られた初期量子化幅とする。また、この場合、エッジフラグ分離部118は何もせず、アンパッキング部111から受信した量子化値をそのまま逆量子化処理部113に送信する。
 各復号化対象画素に対応する量子化幅が決定されると、逆量子化処理における量子化幅決定処理は終了し、逆量子化処理に移行する。
 逆量子化処理では、逆量子化処理部113が、量子化幅決定部112が送信した量子化幅及び量子化値が格納されたMビット長の符号化データを受信し、受信した量子化幅により逆量子化処理を行う。量子化幅による逆量子化処理とは、量子化幅決定部112から受信した量子化値を表すMビット長の符号化データを、量子化幅の数だけ上位にビットシフトする処理である。逆量子化処理部113は、逆量子化処理により、Nビットで表現された復号化対象画素とその予測画素との画素値の差分値D´を算出する。尚、逆量子化処理部113は、量子化幅が“0”である場合は、逆量子化は行なわない(図10のステップ(逆量子化ステップ)S304)。
 ステップ(予測画素生成ステップ)S305では、予測画素生成部114が、復号化対象画素に対応する予測値を算出する。予測画素生成部114に入力されるデータは、着目している復号化対象画素よりも先に入力されて出力部116から出力された初期画素値、又は、先に復号化され出力部116から出力された画素データの何れかであり、予測画素生成部114は、入力された画素データ用いてNビットで表現された予測値を生成する。予測値の生成方法は、前述した予測式(1)~(7)の方法のうちの何れかであり、画像符号化装置300の予測画素生成部302で用いた式と同様の予測式を用いて、予測画素生成部114は予測値を算出する。予測画素生成部114は、算出した予測値を復号化値生成部115に送信する。
 ステップS306では、復号化値生成部115が、逆量子化処理部113から受信した逆量子化結果と、予測画素生成部114から受信した復号化対象画素に対応する予測値とを加算することにより、復号化対象画素に対応する復号化値を生成し、出力部116へ送信する。
 次に、本実施形態における画像復号化処理の詳細な説明を行なう。
 図12は、本実施形態における画像復号化処理を説明するための図である。
 ここで、アンパッキング部111は、48ビット単位でパッキングデータを受信する(S=48)。アンパッキング部111は、10ビットの初期画素値(N=10)、又は3ビットの量子化情報(J=3)、又は7ビットの復号化対象画素に対応する量子化値(M=7)を、順次受信するとする。図12は、一例として図6(a)で示した6個の画素データ(画素P1~P6)の画像符号化処理結果を、画像復号化装置110への入力のデータとして示した図である。
 アンパッキング部111には、例えば、外部のメモリに記憶されている複数の符号化データが、図9(b)に示すように連続して入力されるとする。画素P1に対応する画素データは初期画素値であるため、10ビットで表現されているものとする。また、画素P2~P6のそれぞれに対応するデータは、例えば、図7(b)又は図7(c)で表された量子化値とエッジフラグを含む符号化データであるため、7ビットのバイナリコードで示す。
 画像復号化処理では、先ず、ステップS301の処理が行われる。ステップS301では、アンパッキング部111が、符号化データに対して、図9(b)に示すように、予め決められたビットに分離し、ステップS302に移行する。
 ステップS302では、アンパッキング部111が、分離した符号化データが初期画素値であるか否かを判定する。ステップS302において、判定の結果がYESならば、アンパッキング部111は、受信した画素データを出力部116へ送信する。そして、処理は後述するステップS307に移行する。一方、ステップS302において、判定結果がNOならば、処理はステップS303に移行する。
 ここで、アンパッキング部111は、初期画素値として、画素P1に対応する画素データを受信したとする。初期画素値は“150”であるとする。この場合、アンパッキング部111は、入力された画素値“150”を出力部116へ送信する。出力部116は、受信した初期画素値を予測画素生成部114へ送信する。
 ステップS303の量子化幅決定ステップでは、量子化幅決定部112が、各復号化対象画素に対応する逆量子化処理における量子化幅を決定する。先ず、量子化幅決定部112は、アンパッキング部111から受信した符号化データが量子化情報であるか否かを判定する(図20のステップS401)。ステップS401において判定結果がNOならば、処理は後述するステップS403に移行する。判定結果がYESならば、処理はステップS402に移行する。
 ここで、量子化幅決定部112が、アンパッキング部111から受信した符号化データが、Jビット長の量子化情報であるとする。量子化情報のビット長Jは3ビットであり、量子化情報が示す値は“101”であるとする。この場合、ステップS402に移行し、量子化幅決定部112が受信した量子化情報を量子化情報解析部117が解析し、エッジ判定部309による判定結果と、逆量子化処理における量子化幅とを求める。量子化幅は、画像符号化処理において、量子化処理部304が使用した量子化幅と一致する必要があるため、図8の表の対応関係を基に算出する。ここで、量子化幅決定部112が受信した量子化情報が“101”であるとする。図8に基づき解析すると、画像符号化処理では、エッジ判定部309により、平坦部とエッジ部とが混在していると判断されているため、量子化情報解析部117は、エッジフラグ分離部118に“エッジ有り”の情報を送信する。また、逆量子化処理における量子化幅は、平坦部量子化幅“2”又はエッジ部量子化幅“5”となり、量子化情報解析部117は、この量子化幅の情報を量子化幅選択部119に送信する。
 次に、量子化幅決定部112が、アンパッキング部111から受信した符号化データが、Mビット長の復号化対象画素P2に対応する量子化値であるとする。この場合、受信した符号化データは量子化情報でないので(ステップS401でNOの場合)、ステップS403に移行する。ここで、量子化幅決定部112がアンパッキング部111から受信した符号化データが復号化対象画素P2の量子化値であり、その量子化値が示す7ビット(M=7)のバイナリコードの値は、“0110111”であるとする。
 ステップS403では、ステップS402にて例えば量子化情報解析部117が解析した結果を用いて、着目している復号化対象画素が属するグループの絵柄が、平坦部とエッジ部とが混在するか否かを判定する。混在する場合(ステップS403でYESの場合)は、処理はステップS405に移行する。
 ここで、ステップS402において、量子化情報解析部117が出力した解析結果により、グループの絵柄が、平坦部とエッジ部とが混在すると判定されたとする(ステップS403でYES)。また、エッジフラグは、図7(b)及び図7(c)に示すように、量子化幅決定部112が受信した量子化値の最下位ビットに格納されているものとする。
 処理はステップS405に移行し、ステップS405では、エッジフラグ分離部118が、着目する復号化対象画素に対応する量子化値に埋め込まれたエッジフラグを分離する。そして、エッジフラグ分離部118は、分離したエッジフラグの情報を量子化幅選択部119に送信し、量子化値の情報を逆量子化処理部113に送信する。復号化対象画素P2の量子化値(“0110111”)の最下位ビットが“1”であるため、エッジフラグ分離部118は、画素P2をエッジ画素であると特定する。そして、エッジフラグ分離部118は、量子化値(“0110111”)に埋め込まれたエッジフラグ(量子化値の最下位ビット“1”)を、量子化値から分離する。従って、エッジフラグ分離部118により、量子化幅決定部112が受信した復号化対象画素P2の量子化値は、エッジ画素か否かを表すエッジフラグ(“1”)と、量子化値(“011011”)とに分離されたことになる。エッジフラグ分離部118は、分離処理を終了すると、分離したエッジフラグの情報(“1”)を量子化幅選択部119に送信し、量子化値の情報(“011011”)を逆量子化処理部113に送信し、処理はステップS406に移行する。
 ここで、量子化幅選択部119がエッジフラグ分離部118から受信したエッジフラグの情報が“1”であるとする。このとき、画素P2はエッジ画素であると特定できる(ステップS406でYES)。そのため、処理はステップS407に移行する。
 ここで、ステップS402の処理において、量子化情報解析部117が、復号化対象画素の属するグループの量子化幅は、平坦部量子化幅“2”又はエッジ部量子化幅“5”であると決定しているとする。この場合、ステップS407では、画素P2の量子化幅はエッジ部量子化幅である“5”と決定され、量子化幅決定処理を終了する。逆量子化処理における量子化幅決定処理が終了すると、量子化幅選択部119は、決定した量子化幅を逆量子化処理部113に送信し、処理はステップS304に移行する。
 ステップS304では、逆量子化処理部113により逆量子化処理が行われる。逆量子化処理では、逆量子化処理部113が、量子化幅決定部112から受信した各復号化対象画素の量子化値を、量子化幅決定部112から受信した逆量子化における量子化幅の数だけ上位にビットシフトすることにより、逆量子化する。逆量子化により算出されるデータは、N+1(“11”)ビットで表現された差分値D´であるとする。
 ここで、逆量子化処理部113が量子化幅決定部112から受信した量子化幅が“5”であり、かつ、受信した量子化値のバイナリコードが“011011”であるとする。この場合、逆量子化処理部113は、“011011”を5ビット上位にビットシフトすることにより、逆量子化を行う。そして、N+1(“11”)ビットの差分値D´の符号つき整数バイナリ表現である“01101100000”を算出する。図7に示すように、量子化値の最上位ビットは正負符号を表しているため、差分値D´は正数“1101100000”、つまり“864”が算出され、算出された結果は、逆量子化処理部113が復号化値生成部115へ送信する。
 尚、逆量子化処理部113は、量子化幅決定部112から受信した量子化幅が“0”の場合、逆量子化を行わず、量子化値をそのまま復号化値生成部115へ送信する。
 ステップS305では、予測値画素生成部114が、復号化対象画素の予測値を算出する。具体的には、予測値画素生成部114は、画像符号化装置300における画像符号化処理の予測値の生成処理ステップS102と同じ予測方式をとるため、予測式(1)を使用して予測値を算出する。ここで、予測値画素生成部114が復号化対象画素P2の予測値を算出するとする。予測式(1)より、一つ前に受信した復号化対象画素である画素P1の画素データを予測値とするため、画素P1の画素値“150”を出力部116から受信し、予測値として算出される。
 ステップS306では、復号化値生成部115が、予測値画素生成部114から受信した予測値と、逆量子化処理部113から受信した差分値D´とから、復号化値を算出する。具体的には、図12に示すように、復号化値生成部115が、予測画素生成部114から受信した予測値と、逆量子化処理部113から受信した差分値D´とを加算することにより、復号化値を生成する。ここで、予測画素生成部114から受信した予測値が示す値が“150”であるとする。また、逆量子化処理部113から受信した差分値D´が“864”であるとする。この場合、“150”と“864”とを加算することにより、N(“10”)ビット長の復号化値 “1014”を算出する。得られた復号化値は、出力部116へ送信する。
 尚、本実施形態において、画像符号化処理の方法を予測式(1)を用いた予測符号化とした。そのため、画像復号化処理においては、逆量子化値と予測値とを加算することにより、復号化値を算出している。しかし、本実施形態における差分値演算部303の差分値の算出方法については、予測値と符号化対象画素との減算処理のみに限定しない。例えば、予測値と符号化対象画素との排他的論理和演算等のように、予測値からの変化情報を抽出できる処理であれば、本発明に適用可能であることはいうまでもない。
 出力部116は、復号化された画素データを、例えば外部のメモリ及び予測画素生成部114に記憶させる。また、前述した通り、画像符号化装置300において、h番目の符号化対象画素の予測値を算出する際に、一旦、符号化された後に、画像復号化装置110にて復号化された(h-1)番目の復号化画素データを使用することも可能である。その場合は、画像符号化装置300における予測画素生成部302に、出力部116が送信する復号化された画素データを記憶させてもよい。尚、出力部116は、外部のメモリに記憶させるのではなく、外部の画像を処理する回路等に出力してもよい。
 ステップS307では、画像符号化装置300のパッキング部305により、固定ビット長Sビットにパッキングされた画素数Pixについて、画像復号化処理が終了したか否かを判定する。ここで、Pixは、画像符号化処理と同様に、予め算出されているものとする。
 ステップS307において、画素数Pixについての上記の判定結果がNOならば、処理はステップS302に移行し、画像復号化装置110は、次にアンパッキング部111が受信した次の符号化データに対して、ステップS302~ステップS306までのうちの、少なくとも一つの処理を実行する。そして、画像復号化装置110は、画素P3~画素P6に対して、ステップS302~ステップS306までの処理を繰り返し行い、順次、得られた復号化後の画素データを画像復号化装置110から出力する。
 一方、ステップS307において、画素数Pixについての判定結果がYESならば、処理はステップS308に移行する。
 ステップS308では、出力部116が出力した復号化後の画素データで1画像についての復号化処理が全て終了したかを、例えばアンパッキング部111等が判定する。そして、この判定結果がYESであれば、復号化処理を終了し、NOであれば、ステップS301へ移行して、ステップS301~ステップS307までのうちの少なくとも一つの処理を実行する。
 以上の処理及び演算を実行した結果、算出される復号化対象画素P2~P6の演算結果と、出力部116から出力される10ビットで表された各画素に対応する復号化後の画素データを図12に示した。
 ここで、初期画素値である画素P1に対応する演算結果が存在しないのは、画像符号化処理において、符号化対象画素が初期画素値として入力された場合(図2のステップS101でYESの場合)は、量子化処理を省き、直接、パッキング部305に入力する(図2のステップS109)ため、画像復号化処理においても、アンパッキング部111で初期画素値として画素データを受信した場合は、入力された画素データを直接、出力部116へ送信するためである。
 (実施形態2)
 本実施形態2では、前記実施形態1で説明した画像符号化装置300の他の例を説明する。
 実施形態2における実施形態1に対する差異は、エッジ部量子化幅算出部308におけるエッジ部量子化幅及び平坦部量子化幅の算出方法と、エッジ画素判別部310におけるエッジ画素の判別方法にある。先ず、図13は、実施形態2におけるエッジ部量子化幅算出部308のエッジ部量子化幅及び平坦部量子化幅の選択パターンを示しており、図14は、実施形態2を適用した場合の差分値Dと量子化値とのビットイメージの例を示す。また、図15は、実施形態2において、パッキング部305が生成する量子化情報の例を示す図である。
 本実施形態で採用する量子化幅決定方法では、符号化対象画素が属するグループの絵柄が、平坦部とエッジ部とが混在していると判定された場合において、エッジ部量子化幅算出部308は、複数のエッジ部量子化幅及び平坦部量子化幅の組み合わせパターンから適当な量子化幅を選択する。具体的には、エッジ部量子化幅算出部308は、グループの最大量子化幅Q_MAXと最小量子化幅Q_MINの値により、算出するエッジ部量子化幅及び平坦部量子化幅の値を切り替える。これにより、符号化対象画素の画素値と予測値との差分値Dのレベルに応じて、量子化幅の値を求めるため、より適当な量子化幅を、画素毎に選択できる。
 本実施形態では、一例として、図13に示すようなパターンを予め用意する。図13の上段は、実施形態1で説明したエッジ部量子化幅及び平坦部量子化幅の組み合わせパターンであり、下段が本実施形態で追加する組み合わせパターンである。
 エッジ部量子化幅算出部308は、グループ内のPix_G個の画素に対応するPix_G個の単位量子化幅Qの中から、最大量子化幅Q_MAXと最小量子化幅Q_MINとを求める。そして、図13の上段と下段に示す関係の何れの関係に当てはまるか比較する。
 ここで、最大量子化幅Q_MAXと最小量子化幅Q_MINとが、それぞれ“3”、“0”であったとする。最大量子化幅Q_MAXが“3”であるとき、差分絶対値の最大値のビット数は9ビットである。即ち、図14(a)に示すように、差分値Dのビットデータのうち、最上位ビットの正負符号を表すビットを除くと、9ビット目(“b8”)までしか有効なビットデータは格納されていない。これは、実施形態1の図7と比較しても明確なように、グループの絵柄は、平坦部とエッジ部とが混在しているが、エッジ部の差分値Dが比較的小さい、つまり、平坦な領域にエッジが近接しているが、そのエッジ部の急峻さは、実施形態1と比較すると緩やかである場合を示している。
 このような場合、図13の下段のように、エッジ画素判別部310におけるエッジ画素とエッジ画素以外とを判別するための閾値TH2を設定し直すことにより、平坦部の量子化幅を低減し、画質の劣化を、更に抑圧することができる。
 ここで、閾値TH2の値は、実施形態1では“2”であったが、“1”に設定する。量子化値のビット長Mを“7”とすると、式(8)により、TH2+(M-1)=7となり、差分値Dのビット長が7ビットよりも小さい場合は、平坦部量子化幅により量子化処理が施される。従って、エッジ画素以外の量子化値は、差分値Dの6ビット目までのビットデータを量子化値として格納する必要があり、図14(b)のように、差分値Dのビットデータb1~b5が量子化値のビットb1~b5に格納される。また、このときの平坦部量子化幅の値は、閾値TH2の値と同じ値(“1”)となる。
 尚、式(8)の通り、閾値TH2は、エッジ画素を判断する際の差分値Dのビット長Lの値を導いている。そのため、実施形態2においても、ビット長Lが極端に小さくなるような閾値TH2を設定すると、エッジ画素と判断された場合に、符号化対象画素データのほとんどの情報が失われてしまうことになる。そのため、実施形態2において、複数のエッジ部量子化幅及び平坦部量子化幅の組み合わせパターンを用意する場合は、式(8)で算出されるビット長Lとエッジ部量子化幅との差が、常に一定になるように、閾値TH2を求めればよい。
 実施形態2において、パッキング部305が生成する量子化情報は、図15のようになる。図8と比較すると、量子化情報“110”が追加されていることが判る。これにより、画像復号化装置110においても、量子化情報解析部117で量子化情報を解析することにより、エッジ部量子化幅及び平坦部量子化幅の組み合わせが複数ある場合でも、切り替えることが可能である。
 以上の処理により、実施形態1(図13の上段)と比較しても、平坦部量子化幅の値が“2”から“1”へ小さくなっており、平坦な領域に比較的緩やかな変化のエッジが近接している場合において、平坦部の画質劣化を更に抑圧することが可能となる。
 尚、予め用意しておくエッジ部量子化幅及び平坦部量子化幅の組み合わせパターンは、発生し得る差分値Dのビットデータに応じて、複数用意しておくことも可能である。これにより、複数のエッジの発生パターンに対応でき、より平坦部の画質の劣化を抑圧することが可能となる。
 (実施形態3)
 本実施形態3では、実施形態1で説明した画像符号化装置300及び画像復号化装置110を備えたデジタルスチルカメラの例を説明する。
 図16は、実施形態3に係るデジタルスチルカメラ1600の構成を示すブロック図である。図16に示されるように、デジタルスチルカメラ1600は、画像符号化装置300と、画像復号化装置110とを備える。画像符号化装置300及び画像復号化装置110の構成及び機能は実施形態1で説明したので、詳細な説明は繰り返さない。
 デジタルスチルカメラ1600は、更に、撮像部1610と、画像処理部1620と、表示部1630と、圧縮変換部1640と、記録保存部1650と、SDRAM1660とを備える。
 撮像部1610は、被写体を撮像して、被写体の撮像された像に対応するデジタルの画像データ(RAWデータ)を出力する。この例では、撮像部1610は、光学系1611と、撮像素子1612と、アナログフロントエンド1613(図中ではAFEと略記)と、タイミングジェネレータ1614(図中ではTGと略記)とを含む。光学系1611は、レンズ等からなり、被写体の像を撮像素子1612上に結像させるようになっている。撮像素子1612は、光学系1611から入射した光を電気信号に変換する。撮像素子1612としては、CCD(Charge Coupled Device)を用いた撮像素子や、CMOSを用いた撮像素子等、種々の撮像素子を採用できる。アナログフロントエンド1613は、撮像素子1612が出力したアナログ信号に対してノイズ除去、信号増幅、A/D変換などの信号処理を行ない、信号処理がされたデータを画像データとして出力する。タイミングジェネレータ1614は、撮像素子1612やアナログフロントエンド1613の動作タイミングの基準となるクロック信号をこれらに供給する。
 画像処理部1620は、撮像部1610から入力された画素データ(RAWデータ)に所定の画像処理を施し、画像処理後のデータを画像符号化装置300へ出力する。一般的に、画像処理部1620は、図16に示すように、傷補正回路1621、輝度信号生成回路1622、色分離回路1623、アパーチャ補正処理回路1624(図中ではAPと略記)、マトリクス処理回路1625、及び画像の拡大・縮小を行うズーム回路1626(図中ではZOMと略記)等を備えている。
 傷補正回路1621では、電源投入時等に、撮像素子1612の遮光データを得ることにより欠陥画素を検出し、この検出された欠陥画素の位置情報をレジスタやメモリ等の記憶手段に保持しておく。そして、撮像時に、保持されている位置情報に基づいて、撮像素子1612における欠陥画素の周辺に配置する複数の画素データを用いて補間値を算出し、この補間値と欠陥画素の値とを置換する回路である。輝度信号生成回路1622は、RAWデータから輝度信号(Y信号)を生成する。色分離回路1623は、RAWデータから色差信号(Cr/Cb信号)を生成する。アパーチャ補正処理回路1624は、輝度信号生成回路1622が生成した輝度信号に高周波数成分を足し合わせて、解像度を高く見せる処理を行う。マトリクス処理回路1625は、撮像素子の分光特性や画像処理で崩れた色相バランスの調整を色分離回路1623の出力に対して行う。
 そして、画像処理部1620は、一般的に、処理対象の画素データをSDRAM等のメモリに一時記憶させ、一時記憶されたデータに対して所定の画像処理や、YC信号生成、ズーム処理等を行い、処理後のデータを再度SDRAMに一時記憶することが多い。そのため、画像処理部1620では、画像符号化装置300への出力と画像復号化装置110からの入力とが何れも発生することが考えられる。
 表示部1630は、画像復号化装置110の出力(画像復号化処理後の画像データ)を表示する。
 圧縮変換部1640は、画像復号化装置110の出力をJPEG等の所定の規格で圧縮変換した画像データを記録保存部1650に出力する、また、圧縮変換部1640は、記録保存部1650によって読み出された画像データを伸張変換して、伸張変換された画像データを画像符号化装置300へ入力する。即ち、圧縮変換部1640は、JPEG規格に基づくデータを処理可能である。このような圧縮変換部1640は、一般的にデジタルスチルカメラに搭載される。
 記録保存部1650は、圧縮された画像データを受信して、記録媒体(例えば不揮発性メモリ等)に記録する。また、記録保存部1650は、記録媒体に記録されている圧縮された画像データを読み出して、読み出した画像データを圧縮変換部1640に出力する。
 本実施形態3の画像符号化装置300及び画像復号化装置110における入力信号としては、例えば、撮像部1610から入力されたRAWデータが挙げられる。但し、画像符号化装置300の入力信号は、RAWデータに限定されない。例えば、画像符号化装置300及び画像復号化装置110が処理対象とする画素データは、画像処理部1620によってRAWデータから生成されたYC信号(輝度信号又は色差信号)のデータでもよいし、又は、一旦、JPEG等に圧縮変換されたJPEG画像のデータを伸張することにより得られるデータ(輝度信号又は色差信号のデータ)等であってもよい。
 このように、実施形態3におけるデジタルスチルカメラ1600は、一般的にデジタルスチルカメラに搭載される圧縮変換部1640以外にも、RAWデータやYC信号を処理対象とする画像符号化装置300及び画像復号化装置110を備える。これにより、本実施形態3におけるデジタルスチルカメラ1600においては、同じSDRAM等のメモリ容量で、同じ解像度の連写枚数を増やす高速撮像動作が可能となる。また、デジタルスチルカメラ1600においては、同じ容量のSDRAM等メモリに記憶させる動画像の解像度を高めることが可能になる。
 また、本実施形態3に示したデジタルスチルカメラ1600の構成は、デジタルスチルカメラ1600と同様に、撮像部、画像処理部、表示部、圧縮変換部、記録保存部、及びSDRAMを備えるデジタルビデオカメラの構成に適用することも可能である。
 (実施形態4)
 本実施形態4では、デジタルスチルカメラに設けられる撮像素子が、画像符号化装置300を含む場合のデジタルスチルカメラの構成の例を説明する。
 図17は、実施形態4におけるデジタルスチルカメラ1700の構成を示すブロック図である。図17に示されるように、デジタルスチルカメラ1700は、図16のデジタルスチルカメラ1600と比較して、撮像部1610の代わりに撮像部1710を備える点と、画像処理部1620の代わりに画像処理部1720を備える点とが異なる。それ以外の構成は、デジタルスチルカメラ1600と同様であるので、詳細な説明は繰り返さない。
 撮像部1710は、図16の撮像部1610と比較して、撮像素子1612の代わりに撮像素子1712を含み、アナログフロントエンド1613を省略した点が異なる。それ以外は、撮像部1610と同様であるので、詳細な説明は繰り返さない。これは、例えば、撮像素子1712にCMOSセンサを用いた例であり、画素内に増幅器及びA/D変換回路を有し、デジタル信号を出力する。このため、図3の画像符号化装置300を搭載することが可能となる。
 また、画像処理部1720は、図16の画像処理部1620と比較して、更に、図11の画像復号化装置110を含む点が異なる。それ以外の構成は、画像処理部1620と同様であるので、詳細な説明は繰り返さない。
 撮像素子1712に含まれる画像符号化装置300は、撮像素子1712により撮像された画素信号(RAWデータ)を符号化し、その符号化により得られたデータを画像処理部1720内の画像復号化装置110に送信する。
 画像処理部1720内の画像復号化装置110は、画像符号化装置300から受信したデータを復号化する。この処理により、撮像素子1712と集積回路内の画像処理部1720との間のデータ転送効率を向上させることが可能となる。
 従って、実施形態4のデジタルスチルカメラ1700においては、前記実施形態3のデジタルスチルカメラ1600よりも、同じメモリ容量で、同じ解像度の連写枚数を増やしたり、動画像の解像度を高めることが可能になる。
 一方、近年では、高画素の撮像素子1712を使用して、30枚/秒の画像を出力することが求められている。具体的には、高画素の撮像素子から30枚/秒の画像を出力したり、また、高画素でない場合でも、野球のボールインパクトの瞬間を撮像する高速撮像などのような、1秒当たり100枚以上の画像を出力する高速撮像が求められている。この実現方法として、画素データの読出速度の高速化を図ることが考えられるが、単純に読出速度を高速化したのでは、消費電力の増加や、ノイズ、不要輻射の問題が起こり得る。そのため、撮像部1710の出力信号を高速のクロックを用いてシリアル形式のデータに変換してから外部に出力する方法があるが、本実施形態4では、更に、撮像素子1712内部に画像符号化装置300を搭載する。このため、撮像部1710と画像処理部1720との間のデータ転送効率の向上が可能となり、高速撮像の実現に有効である。
 また、前記実施形態3と比較すると、本実施形態4のように、撮像部1710に画像符号化装置300が搭載される場合、画像処理部1720内にある傷補正回路1621より前段に、画像符号化処理を実行することになる。即ち、撮像素子1712に欠陥画素が発生した場合、欠陥画素の画素値は補正されずに、そのままの画素値(信号レベル)で画像符号化装置300に入力されるということを意味する。
 一般的に、欠陥画素としては、感度に反応せず低い画素値のみを出力する黒傷や、逆に飽和レベルに近い画素値のみを出力する白傷が挙げられる。そのため、欠陥画素の画素値が補正されずに、そのままの画素値で画像符号化装置300に入力された場合、被写体の絵柄とは無関係に、平坦な領域に、急峻なエッジが発生する可能性がある。従って、欠陥画素が含まれる領域は大きな量子化幅を用いて量子化され、視覚的に大きな劣化として捉えられる可能性がある。
 しかし、本実施形態4においては、画像符号化装置300に入力する画素データ上で、欠陥画素により急峻なエッジが発生した場合でも、量子化処理の影響が周辺の平坦な画素へ伝播するのを防ぐため、傷補正回路1621の前段に、画像符号化装置300を搭載しても、問題なく画像符号化処理を施すことができる。よって、撮像部1710内にも画像符号化装置300を内蔵させることが可能となり、撮像部1710と画像処理部1720との間のデータ転送効率の向上に有効である。
 (実施形態5)
 本実施形態5では、監視カメラが受信する画像データが画像符号化装置300からの出力である場合の監視カメラを説明する。
 図18は、監視カメラ1800の構成を示す図である。
 通常、監視カメラ装置においてそうであるように、監視カメラ1800は、監視カメラ1800から送信される画像データが第3者によって伝送経路上で盗まれないよう、伝送路上のセキュリティ性を確保するため、画像データを暗号化している。一般的には、監視カメラ用信号処理部1810内の画像処理部1801により所定の画像処理が施された画像データを、圧縮変換部1802によりJPEGやMPEG4、H.264等の所定の規格で圧縮変換し、更に暗号化部1803により暗号化して、その暗号化されたデータが通信部1804からインターネット上に送信されることにより、個人のプライバシー保護を行っている。
 そこで、図18に示すように、前述した画像符号化装置300を含む撮像部1710からの出力を監視カメラ用信号処理部1810に入力し、監視カメラ用信号処理部1810内に搭載する画像復号化装置110により符号化データを復号化する。このことにより、撮像部1710で撮影された画像データを擬似的に暗号化することができるので、撮像部1710と監視カメラ用信号処理部1810との間のデータ転送効率を向上させると共に、伝送路上のセキュリティ性が確保され、従来よりも更にセキュリティ性の向上を図ることが可能になる。
 従って、監視カメラへの画像符号化装置300及び画像復号化装置110の搭載により、監視カメラのデータ転送効率が向上し、動画像の解像度を高める等といった撮像動作を実現することが可能になる。更に、擬似的に画像データを暗号化することにより、画像データの漏洩防止やプライバシー保護を行うなどといったセキュリティ性の向上が可能となる。
 (実施形態6)
 図19は、本実施形態6における監視カメラ1900の構成を示す図である。
 また、監視カメラ装置の実現方法として、図19に示すように、撮像部1610からの入力画像に対して、所定のカメラ画像処理を行う画像処理部1901と信号入力部1902とを搭載して、画像処理部1901が送信した画像データを受信して圧縮変換を行い、暗号化した上で、通信部1804からインターネット上に画像データを送信する監視カメラ用信号処理部1910を、別個のLSIにより実現する形態がある。
 本実施形態6においては、画像処理部1901に画像符号化装置300を搭載し、画像復号化装置110を監視カメラ用信号処理部1910に搭載する。このことにより、画像処理部1901が送信する画像データを擬似的に暗号化することができる。このため、画像処理部1901と監視カメラ用信号処理部1910との間のデータ転送効率を向上させると共に、伝送路上のセキュリティ性が確保され、従来よりも更にセキュリティ性の向上を図ることが可能になる。
 このように、各実施形態において、固定長符号化を行うことにより、ランダムアクセス性は維持したまま、量子化幅を画素単位で適応的に切り替えることにより、欠陥画素や急峻なエッジの発生による影響が平坦な領域に伝播する課題が解決される。
 尚、上記の説明で示される実施形態が、単なる一例であるのは当然である。即ち、権利が請求される対象の概念は、上記に示される実施形態が抽象化された上位概念である。そして、この上位概念は、一例である上記に示された実施形態により実施(実装、実現)されてもよいし、上記に示された実施形態とは一部又は全部が異なる他の実施形態により実施(実装、実現)されてもよいのは当然である。
 以上説明したように、本発明に係る画像符号化方法及び装置並びに画像復号化方法及び装置は、集積回路のデータ転送のバス幅等については、固定長を保証しつつ、画像データを圧縮することが可能になる。
 また、平坦部とエッジ部とが混在しているか否かを判定し、その判定結果を基に量子化処理における量子化幅を画素単位で適応的に切り替えるので、欠陥画素や急峻なエッジが発生している領域においても、量子化誤差が平坦な領域にまで伝播するのを抑えることが可能となる。従って、デジタルスチルカメラやネットワークカメラ等のように画像を扱う装置において、ランダムアクセス性は維持したまま、画像圧縮における画質の劣化を最小限に抑圧しつつ、画像データを符号化、復号化が可能になる。そのため、近年の画像データ処理量の増大へのキャッチアップに有用である。
100   デジタル信号処理回路
101   画像符号化装置
102   画像復号化装置
103   前処理部
104   信号処理部
105   メモリ
300   画像符号化装置
301   処理対象画素値入力部
302   予測画素生成部
303   差分値演算部
304   量子化処理部(量子化部)
305   パッキング部
306   量子化幅決定部
307   初期量子化幅算出部
308   エッジ部量子化幅算出部
309   エッジ判定部
310   エッジ画素判別部
311   量子化幅選択部
110   画像復号化装置
111   アンパッキング部
112   量子化幅決定部
113   逆量子化処理部(逆量子化部)
114   予測画素生成部
115   復号化値生成部
116   出力部
117   量子化情報解析部
118   エッジフラグ分離部
119   量子化幅選択部
1600,1700  デジタルスチルカメラ
1610,1710  撮像部
1611  光学系
1612,1712  撮像素子
1613  アナログフロントエンド
1614  タイミングジェネレータ
1620,1720  画像処理部
1621  傷補正回路
1622  輝度信号生成回路
1623  色分離回路
1624  アパーチャ補正処理回路
1625  マトリクス処理回路
1626  ズーム回路
1630  表示部
1640  圧縮変換部
1650  記録保存部
1660  SDRAM
1800,1900  監視カメラ
1810  監視カメラ用信号処理部
1801  画像処理部
1802  圧縮変換部
1803  暗号化部
1804  通信部
1910  監視カメラ用信号処理部
1901  画像処理部
1902  信号入力部
S102  予測画素生成ステップ
S201  初期量子化幅算出ステップ
S202  エッジ部量子化幅算出ステップ
S203  エッジ判定ステップ
S204  エッジ画素判別ステップ
S106  量子化幅決定ステップ
S107  量子化ステップ
S109  パッキングステップ
Q_MAX 第1量子化幅
TH1   第1の閾値
TH3   第2の閾値
TH4   第3の閾値
TH2   第4の閾値

Claims (26)

  1.  圧縮対象の画素の画素データを入力し、入力された前記画素データを圧縮する画像符号化方法であって、
     圧縮対象の画素の周辺に位置する少なくとも1つの周辺画素から、前記画素データの予測値を生成する予測画素生成ステップと、
     前記画素データと、前記予測画素生成ステップで生成された前記予測値との間の差分値を、前記画素データよりも少ないビット数である量子化値へと量子化することにより、前記画素データを前記量子化値へと圧縮する量子化ステップと、
     前記量子化ステップにおける量子化幅を決定する量子化幅決定ステップとを含み、
     前記量子化幅決定ステップは、複数の前記画素から構成するグループ単位で、平坦部とエッジ部とが混在しているか否かを判定し、その判定結果に基づいて前記量子化ステップにおける量子化幅を画素単位で適応的に切り替える
     ことを特徴とする画像符号化方法。
  2.  前記請求項1記載の画像符号化方法であって、
     前記量子化幅決定ステップは、
     前記グループ内の前記差分値の特性から平坦部とエッジ部とが混在しているか否かを判定するエッジ判定ステップと、
     前記差分値に基づいて、前記グループを構成する画素中におけるエッジ部の画素と平坦部の画素とを判別するエッジ画素判別ステップとを含み、
     前記エッジ判定ステップの判定結果と、前記エッジ画素判別ステップの判別結果とに基づいて、前記量子化ステップにおける量子化幅を画素単位で適応的に切り替える
     ことを特徴とする画像符号化方法。
  3.  前記請求項2記載の画像符号化方法であって、
     前記エッジ判定ステップは、
     前記グループ内の前記差分値の最大値と最小値との差が第1の閾値以上である場合に、平坦部とエッジ部とが混在していると判定する
     ことを特徴とする画像符号化方法。
  4.  前記請求項3記載の画像符号化方法であって、
     前記第1の閾値は、2のべき乗である
     ことを特徴とする画像符号化方法。
  5.  前記請求項2記載の画像符号化方法であって、
     前記エッジ判定ステップは、
     前記グループ内の前記差分値の最大値が第2の閾値以上であり、かつ、前記差分値の最小値が第3の閾値以下である場合に、平坦部とエッジ部とが混在していると判定する
     ことを特徴とする画像符号化方法。
  6.  前記請求項5記載の画像符号化方法であって、
     前記第2の閾値及び第3の閾値は、2のべき乗である
     ことを特徴とする画像符号化方法。
  7.  前記請求項2記載の画像符号化方法であって、
     前記エッジ画素判別ステップは、
     前記差分値が第4の閾値以上である場合に、エッジ部の画素と判断し、それ以外は平坦部の画素と判別する
     ことを特徴とする画像符号化方法。
  8.  前記請求項7記載の画像符号化方法であって、
     前記第4の閾値は、2のべき乗である
     ことを特徴とする画像符号化方法。
  9.  前記請求項2記載の画像符号化方法であって、
     前記量子化幅決定ステップは、
     前記量子化ステップにおける量子化幅として、前記エッジ判定ステップの判定結果に基づいて、前記グループ単位で、第1量子化幅を使用するか、又は、第2量子化幅及び第3量子化幅を使用するかを決定し、前記エッジ画素判別ステップの判別結果に基づいて、画素単位で、前記第2量子化幅を使用するか前記第3量子化幅を使用するかを決定する
     ことを特徴とする画像符号化方法。
  10.  前記請求項2又は9記載の画像符号化方法であって、
     前記量子化幅決定ステップは、
     前記グループ中の前記差分値の最大値に応じた第1量子化幅を算出する初期量子化幅算出ステップと、
     エッジ部の量子化における量子化幅である第2量子化幅、及び、平坦部の量子化における量子化幅である第3量子化幅を算出するエッジ部量子化幅算出ステップとを含む
     ことを特徴とする画像符号化方法。
  11.  前記請求項10記載の画像符号化方法であって、
     前記第2量子化幅は、前記第1量子化幅に対し1加算した値となる
     ことを特徴とする画像符号化方法。
  12.  前記請求項10記載の画像符号化方法であって、
     前記第3量子化幅は、前記第1量子化幅に対し量子化幅が小さくなる
     ことを特徴とする画像符号化方法。
  13.  前記請求項10記載の画像符号化方法であって、
     エッジ部量子化幅算出ステップは、前記グループ内の前記差分値の最大値と最小値との差に対応する複数の前記第3量子化幅の中から、量子化値を選択する
     ことを特徴とする画像符号化方法。
  14.  前記請求項1記載の画像符号化方法であって、
     パッキングステップを含み、エッジ部の画素か否かを1ビットで表されるフラグとして前記量子化値に埋め込み、出力する
     ことを特徴とする画像符号化方法。
  15.  前記請求項1記載の画像符号化方法であって、
     パッキングステップを含み、前記グループ単位で、前記グループを構成する画素の前記量子化値と、前記量子化幅の情報と、平坦部とエッジ部とが混在しているか否かの判定結果とのうち、少なくとも何れかを含むSビット長(Sは自然数)の符号化データを生成する
     ことを特徴とする画像符号化方法。
  16.  前記請求項1記載の画像符号化方法であって、
     入力されたNビット長(Nは自然数)の画素データと、同ビット長の前記予測値との差分値を、所定のビット長M(Nより小さいMは自然数)の固定長符号に符号化する
     ことを特徴とする画像符号化方法。
  17.  入力される符号化データが量子化値を含み、
     前記量子化値は、画素データと前記画素データの予測値との間の差分値を量子化したものであり、前記画素データの予測値は前記画素データの画素の周辺に位置する少なくとも1つの画素から生成され、
     前記量子化値を前記画素データに復号化する画像復号化方法であって、
     既に復号化された過去の前記画素データから、現在の前記画素データの前記予測値を生成する予測画素生成ステップと、
     前記量子化値を逆量子化し、前記量子化値が逆量子化された前記差分値を生成する逆量子化ステップと、
     符号化された量子化情報及び量子化値から、前記逆量子化ステップにおける量子化幅を画素単位で決定する量子化幅決定ステップとを含み、
     前記量子化幅決定ステップは、前記逆量子化ステップにおける量子化幅を画素単位で適応的に切り替える
     ことを特徴とする画像復号化方法。
  18.  圧縮対象の画素の画素データを入力し、入力された前記画素データを圧縮する画像符号化装置であって、
     圧縮対象の画素の周辺に位置する少なくとも1つの周辺画素から、前記画素データの予測値を生成する予測画素生成部と、
     前記画素データと、前記予測画素生成部で生成された前記予測値との間の差分値を、前記画素データよりも少ないビット数である量子化値へと量子化することにより、前記画素データを、前記量子化値へと圧縮する量子化部と、
     前記量子化部における量子化幅を決定する量子化幅決定部とを備え、
     前記量子化幅決定部は、複数の前記画素から構成するグループ単位で、平坦部とエッジ部とが混在しているか否かを判定し、判定結果に基づいて前記量子化部における量子化幅を画素単位で適応的に切り替える
     ことを特徴とする画像符号化装置。
  19.  入力される符号化データが量子化値を含み、
     前記量子化値は、画素データと前記画素データの予測値との間の差分値を量子化したものであり、前記画素データの予測値は前記画素データの画素の周辺に位置する少なくとも1つの画素から生成され、
     前記量子化値を前記画素データに復号化する画像復号化装置であって、
     既に復号化された過去の前記画素データから、現在の前記画素データの前記予測値を生成する予測画素生成部と、
     前記量子化値を逆量子化し、前記量子化値が逆量子化された前記差分値を生成する逆量子化部と、
     符号化された量子化情報及び量子化値から、前記逆量子化部における量子化幅を画素単位で決定する量子化幅決定部とを備え、
     前記量子化幅決定部は、前記逆量子化部における量子化幅を画素単位で適応的に切り替える
     ことを特徴とする画像復号化装置。
  20.  前記請求項18記載の画像符号化装置であって、
     前記画素データは、撮像素子から入力されたRAWデータである
     ことを特徴とする画像復符号化装置。
  21.  前記請求項18記載の画像符号化装置であって、
     前記画素データは、撮像素子から画像信号処理装置に入力されたRAWデータから、前記画像信号処理装置により生成された輝度信号、又は、色差信号の画素データである
     ことを特徴とする画像符号化装置。
  22.  前記請求項18記載の画像符号化装置であって、
     前記画素データは、伸張装置がJPEG(Joint Photographic Experts Group)画像を伸張することにより、伸張装置が得る輝度信号、又は、色差信号の画素データである
     ことを特徴とする画像符号化装置。
  23.  前記請求項18記載の画像符号化装置と、前記請求項19記載の画像復号化装置とを備えた
     ことを特徴とするデジタルスチルカメラ。
  24.  前記請求項18記載の画像符号化装置と、前記請求項19記載の画像復号化装置とを備えた
     ことを特とするデジタルビデオカメラ。
  25.  前記請求項18記載の画像符号化装置と、前記請求項19記載の画像復号化装置とを備えた
     ことを特徴とする監視カメラ。
  26.  前記請求項18記載の画像符号化装置を備えた
     ことを特徴とする固体撮像素子。
PCT/JP2011/002286 2010-09-03 2011-04-19 画像符号化方法、画像復号化方法、画像符号化装置及び画像復号化装置 WO2012029208A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201180041297.0A CN103081469B (zh) 2010-09-03 2011-04-19 图像编码方法、图像解码方法、图像编码装置以及图像解码装置
US13/778,663 US10223811B2 (en) 2010-09-03 2013-02-27 Image encoding method, image decoding method, image encoding device and image decoding device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2010-197834 2010-09-03
JP2010197834A JP5529685B2 (ja) 2010-09-03 2010-09-03 画像符号化方法、画像復号化方法、画像符号化装置及び画像復号化装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/778,663 Continuation US10223811B2 (en) 2010-09-03 2013-02-27 Image encoding method, image decoding method, image encoding device and image decoding device

Publications (1)

Publication Number Publication Date
WO2012029208A1 true WO2012029208A1 (ja) 2012-03-08

Family

ID=45772335

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2011/002286 WO2012029208A1 (ja) 2010-09-03 2011-04-19 画像符号化方法、画像復号化方法、画像符号化装置及び画像復号化装置

Country Status (4)

Country Link
US (1) US10223811B2 (ja)
JP (1) JP5529685B2 (ja)
CN (1) CN103081469B (ja)
WO (1) WO2012029208A1 (ja)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2725809A3 (en) * 2012-10-03 2014-08-27 Broadcom Corporation Bounded rate near-lossless and lossless image compression
CN104854854A (zh) * 2012-11-29 2015-08-19 索尼公司 图像传感器及其数据传输方法、信息处理装置及方法、电子设备和程序
US9363517B2 (en) 2013-02-28 2016-06-07 Broadcom Corporation Indexed color history in image coding
US9451250B2 (en) 2012-10-03 2016-09-20 Broadcom Corporation Bounded rate compression with rate control for slices
US9805442B2 (en) 2012-10-03 2017-10-31 Avago Technologies General Ip (Singapore) Pte. Ltd. Fine-grained bit-rate control
US9813711B2 (en) 2012-10-03 2017-11-07 Avago Technologies General Ip (Singapore) Pte. Ltd. Hybrid transform-based compression
US9978156B2 (en) 2012-10-03 2018-05-22 Avago Technologies General Ip (Singapore) Pte. Ltd. High-throughput image and video compression

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6145965B2 (ja) * 2012-04-19 2017-06-14 富士ゼロックス株式会社 画像符号化装置及び画像復号化装置並びにプログラム
US9355113B2 (en) * 2013-01-17 2016-05-31 Google Inc. Encoding and decoding delta values
EP3177023B1 (en) * 2014-07-30 2020-02-05 Sk Planet Co., Ltd. Apparatus for cloud streaming service
JP6672363B2 (ja) * 2018-03-23 2020-03-25 シャープ株式会社 符号化装置、表示装置、符号化装置の制御方法、および制御プログラム
CN110971904B (zh) * 2018-10-15 2020-12-04 新相微电子(上海)有限公司 一种图像压缩的控制方法
GB2607692B (en) * 2019-08-23 2023-08-02 Imagination Tech Ltd Random accessible image data compression

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05252499A (ja) * 1991-01-17 1993-09-28 Mitsubishi Electric Corp 映像信号符号化装置
JPH0698306A (ja) * 1992-09-10 1994-04-08 Sharp Corp 画像符号化装置
JP2007020036A (ja) * 2005-07-11 2007-01-25 Toshiba Corp 画像送信装置および画像受信装置
WO2007132539A1 (ja) * 2006-05-17 2007-11-22 Fujitsu Limited 画像圧縮装置、圧縮方法及びプログラム並びに画像復元装置、復元方法及びプログラム
WO2010035433A1 (ja) * 2008-09-25 2010-04-01 パナソニック株式会社 画像符号化装置、デジタルスチルカメラ、デジタルビデオカメラ、撮像素子、プリンタおよび画像符号化方法
JP2010166520A (ja) * 2009-01-19 2010-07-29 Panasonic Corp 画像符号化・復号化装置

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR930000033B1 (ko) * 1990-10-18 1993-01-06 삼성전자 주식회사 에지검출을 이용한 양자화폭 조정회로
US6097757A (en) * 1998-01-16 2000-08-01 International Business Machines Corporation Real-time variable bit rate encoding of video sequence employing statistics
JP2001268565A (ja) * 2000-03-15 2001-09-28 Fuji Xerox Co Ltd 画像符号化装置および画像復号装置
US6831947B2 (en) * 2001-03-23 2004-12-14 Sharp Laboratories Of America, Inc. Adaptive quantization based on bit rate prediction and prediction error energy
TWI295448B (en) * 2005-05-10 2008-04-01 Sunplus Technology Co Ltd Method for object edge detection in macroblock and for deciding quantization scaling factor
JP4769039B2 (ja) 2005-07-26 2011-09-07 パナソニック株式会社 デジタル信号符号化および復号化装置ならびにその方法
JP4895567B2 (ja) 2005-10-07 2012-03-14 パナソニック株式会社 画像符号化方法及び装置、画像復号化方法及び装置、撮像装置
US20070177671A1 (en) * 2006-01-12 2007-08-02 Lg Electronics Inc. Processing multiview video
JP4508132B2 (ja) 2006-02-27 2010-07-21 ソニー株式会社 撮像装置、撮像回路、および撮像方法
KR101037421B1 (ko) * 2006-05-17 2011-05-30 후지쯔 가부시끼가이샤 화상 데이터 압축 장치, 압축 방법 및 프로그램을 기록한 기록 매체 및 화상 데이터 복원 장치, 복원 방법 및 프로그램을 기록한 기록 매체
WO2008084996A1 (en) * 2007-01-11 2008-07-17 Samsung Electronics Co, . Ltd. Method and apparatus for deblocking-filtering video data
TW200840365A (en) * 2007-03-23 2008-10-01 Ind Tech Res Inst Motion-blur degraded image restoration method
US8442337B2 (en) * 2007-04-18 2013-05-14 Microsoft Corporation Encoding adjustments for animation content
WO2009022048A1 (en) * 2007-08-16 2009-02-19 Nokia Corporation A method and apparatuses for encoding and decoding an image
JP4461165B2 (ja) * 2007-09-26 2010-05-12 株式会社東芝 画像処理装置、方法およびプログラム
JP2011004285A (ja) * 2009-06-19 2011-01-06 Sharp Corp 画像データ符号化装置、画像データ符号化方法、画像データ符号量制御方法、および電子情報機器

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05252499A (ja) * 1991-01-17 1993-09-28 Mitsubishi Electric Corp 映像信号符号化装置
JPH0698306A (ja) * 1992-09-10 1994-04-08 Sharp Corp 画像符号化装置
JP2007020036A (ja) * 2005-07-11 2007-01-25 Toshiba Corp 画像送信装置および画像受信装置
WO2007132539A1 (ja) * 2006-05-17 2007-11-22 Fujitsu Limited 画像圧縮装置、圧縮方法及びプログラム並びに画像復元装置、復元方法及びプログラム
WO2010035433A1 (ja) * 2008-09-25 2010-04-01 パナソニック株式会社 画像符号化装置、デジタルスチルカメラ、デジタルビデオカメラ、撮像素子、プリンタおよび画像符号化方法
JP2010166520A (ja) * 2009-01-19 2010-07-29 Panasonic Corp 画像符号化・復号化装置

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104704828A (zh) * 2012-10-03 2015-06-10 美国博通公司 有界率近无损和无损图像压缩
EP2725809A3 (en) * 2012-10-03 2014-08-27 Broadcom Corporation Bounded rate near-lossless and lossless image compression
US9451250B2 (en) 2012-10-03 2016-09-20 Broadcom Corporation Bounded rate compression with rate control for slices
US9805442B2 (en) 2012-10-03 2017-10-31 Avago Technologies General Ip (Singapore) Pte. Ltd. Fine-grained bit-rate control
US9813711B2 (en) 2012-10-03 2017-11-07 Avago Technologies General Ip (Singapore) Pte. Ltd. Hybrid transform-based compression
US9883180B2 (en) 2012-10-03 2018-01-30 Avago Technologies General Ip (Singapore) Pte. Ltd. Bounded rate near-lossless and lossless image compression
US10812829B2 (en) 2012-10-03 2020-10-20 Avago Technologies International Sales Pte. Limited 2D block image encoding
US9978156B2 (en) 2012-10-03 2018-05-22 Avago Technologies General Ip (Singapore) Pte. Ltd. High-throughput image and video compression
CN104704828B (zh) * 2012-10-03 2018-08-21 安华高科技通用Ip(新加坡)公司 有界率近无损和无损图像压缩的方法和系统
CN104854854B (zh) * 2012-11-29 2019-04-05 索尼半导体解决方案公司 图像传感器及其数据传输方法、信息处理装置及方法、电子设备和程序
CN104854854A (zh) * 2012-11-29 2015-08-19 索尼公司 图像传感器及其数据传输方法、信息处理装置及方法、电子设备和程序
EP2928175A4 (en) * 2012-11-29 2016-08-03 Sony Corp IMAGE SENSOR, METHOD FOR TRANSMITTING DATA THEREFROM, INFORMATION PROCESSING DEVICE, INFORMATION PROCESSING METHOD, ELECTRONIC DEVICE AND PROGRAM
US9363517B2 (en) 2013-02-28 2016-06-07 Broadcom Corporation Indexed color history in image coding
US9906817B2 (en) 2013-02-28 2018-02-27 Avago Technologies General Ip (Singapore) Pte. Ltd. Indexed color values in image coding

Also Published As

Publication number Publication date
CN103081469B (zh) 2016-10-05
JP2012054882A (ja) 2012-03-15
US10223811B2 (en) 2019-03-05
JP5529685B2 (ja) 2014-06-25
US20130176431A1 (en) 2013-07-11
CN103081469A (zh) 2013-05-01

Similar Documents

Publication Publication Date Title
JP5529685B2 (ja) 画像符号化方法、画像復号化方法、画像符号化装置及び画像復号化装置
US9106250B2 (en) Image coding method and decoding method, image coding apparatus and decoding apparatus, camera, and imaging device
JP4601623B2 (ja) ノイズ除去装置
US20110200263A1 (en) Image encoder and image decoder
KR20080025048A (ko) 화상 데이터 처리 장치, 화상 데이터 처리 방법 및프로그램
JP2007036566A (ja) デジタル信号符号化および復号化装置ならびにその方法
JP2008294689A (ja) 撮像装置、撮像回路、および撮像方法
JP2016508700A (ja) ビデオカメラ
US8823832B2 (en) Imaging apparatus
JP5092536B2 (ja) 画像処理装置及びそのプログラム
US10477219B2 (en) Image-processing apparatus and lossless image compression method using intra-frame prediction
JP6685198B2 (ja) 撮像装置及びその制御方法及びプログラム
JP6352625B2 (ja) 画像データ圧縮回路、画像データ圧縮方法及び撮像装置
CN114467298A (zh) 一种图像信号转换处理方法、装置及终端设备
US8233729B2 (en) Method and apparatus for generating coded block pattern for highpass coefficients
EP3026908A1 (en) Method and device for quantizing and de-quantizing a picture using scaling factors for chrominance based on luminance
KR101871946B1 (ko) 화상 처리 장치, 화상 처리 방법 및 프로그램
US9942569B2 (en) Image encoding apparatus and control method of the same
US9591332B2 (en) Image processing apparatus performing preprocessing to prevent boundary positions of divided rectangular regions of image data from being separated into dense and sparse portions
JP2009290556A (ja) 画像情報処理装置及び画像情報処理方法
JP2009124278A (ja) 撮像装置
JPH11298762A (ja) 暗電流ノイズ除去装置
JP3945503B2 (ja) 係数データ生成装置および方法
KR20180054623A (ko) Hdr 코딩/디코딩을 위한 컬러 성분 샘플의 코-로케이팅된 루미넌스 샘플의 결정
JP2011171938A (ja) 画像符号化方法、画像符号化装置、画像復号化方法、画像復号化装置、固体撮像素子、ディジタル信号処理素子、ディジタルスチルカメラ及び監視カメラ

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180041297.0

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11821233

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11821233

Country of ref document: EP

Kind code of ref document: A1