US20030058143A1 - Image coding apparatus, variable-length coding apparatus, control apparatus and method thereof - Google Patents
Image coding apparatus, variable-length coding apparatus, control apparatus and method thereof Download PDFInfo
- Publication number
- US20030058143A1 US20030058143A1 US10/245,766 US24576602A US2003058143A1 US 20030058143 A1 US20030058143 A1 US 20030058143A1 US 24576602 A US24576602 A US 24576602A US 2003058143 A1 US2003058143 A1 US 2003058143A1
- Authority
- US
- United States
- Prior art keywords
- data
- variable
- identifier
- length
- length coding
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/42—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/61—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/93—Run-length coding
Definitions
- the present invention relates to an image coding apparatus, and more particularly, to a variable-length coding apparatus which converts symbols into a code data string.
- a still image coded by the JPEG method includes a header portion having information necessary for decoding such as an image size and sampling coefficients of color components, and an entropy coded image data portion (ECS).
- ECS entropy coded image data portion
- the minimum unit in all the coded color component blocks based on sampling coefficients is called a minimum coding unit (MCU).
- MCU minimum coding unit
- restart marker an identifier called “restart marker” can be added to the ECS portion at MCU-based arbitrary periods.
- the influence of the error can be suppressed in the restart marker period.
- the location of the restart marker is defined in the byte boundary of the ECS, if the MCU within an ECS immediately prior to insertion of the restart marker is not ended at the byte boundary, plural (1 to 7 bits) “1”, called “padding bits”, are inserted within the ECS then the restart marker is inserted.
- the MPEG system standardized by the ISO is widely used as a coding scheme for storing a moving image on a storage medium such as a CD-ROM or hard disk and displaying the image, and for broadcasting or bidirectional communication using a moving image via a communication path.
- a moving image coded by the MPEG method includes a header portion having information necessary for decoding such as an image size and quantization scaling value for quantization and uniform scaling of respective pixels, and an entropy-coded image data portion (macro block).
- the macro block structure limited by the MPEG system has a size of 16 pixels ⁇ 16 pixels, and has color components including luminance Y and chrominance Cb and Cr. The respective color components are subsampled at the ratio of 4:1:1 by 8 ⁇ 8 pixel block.
- the MPEG system has a processing unit called a slice including plural macro blocks, and a layer having plural slices is called a slice layer.
- a slice start code is always exists in the byte boundary at the head of slice, if a code data string including an error due to some reason is decoded, the influence of the error can be suppressed in the slice period. If one slice is not ended in the byte boundary, plural (1 to 7 bits) “0”, called “padding bits”, are inserted within the code data string then the slice start code is inserted.
- some image coding apparatuses generate a code data string in cooperation with a main control unit used in a system including the image coding apparatus or a specialized main control unit in the image coding apparatus.
- the main control unit which can perform flexible processing generates the header portion
- a specialized hardware generates the ECS or macro block portion at a high speed.
- FIG. 9 shows an example of conventional image coding apparatus in conformity to the JPEG or MPEG system.
- a header portion outputted from a main control unit 10 in which a control method can be changed by stored software, is selected by a selector 600 and outputted to the outside.
- image data input is started, and coding is performed on the ECS or macro block portion.
- the input image data is converted by a DCT unit 200 into DCT coefficients, then the DCT coefficients are quantized by a quantization unit 300 , and converted by a run-length coding unit 400 into symbols of run-length and level.
- the symbols are variable-length encoded by a variable-length encoder 500 , then padding bits and identifier are inserted in the data, then selected by the selector 600 and outputted as the ECS or macro block portion to the outside.
- variable-length encoder 500 inserts an identifier such as the restart marker or slice start code which differs by coding scheme into the variable-length coded data string
- the apparatus has means for generating these identifiers, means for adding appropriate padding bits to the generated restart marker or slice start code and means for inserting the restart marker or slice start code to which the padding bits are added into the variable-length coded data string, as specialized hardware devices.
- the circuit scale of the apparatus is large.
- the apparatus self-operates until the coding of all the symbols are completed in the variable-length encoder 500 . Accordingly, upon code amount control, even if the amount of generated code exceeds a target amount, the amount of generated code cannot be evaluated before completion of coding of all the ECS portion or picture layer.
- the present invention has been made in consideration of the above problems, and has its object to provide a variable-length coding apparatus having a smaller circuit scale, which flexibly handles identifier insertion processing in correspondence with various coding schemes, and which performs fine code amount control and adaptive erroneous operation control, and an image coding apparatus having the variable-length coding apparatus.
- variable-length coding apparatus which converts quantized data obtained by quantizing image data into variable-length code data and generates a code data string having a predetermined data structure, comprising: coding scheme storage means for storing a coding scheme of said code data string; written data storage means for storing externally-input written data formed with an identifier or a combination of padding bit and identifier; selection means for selecting said written data if the written data is written into said written data storage means, otherwise, selecting said variable-length code data; data combination means for combining data selected by said selection means and generating a data string; number of bits storage means for storing the number of bits of said externally-input written data; and number of significant bits control means for calculating the number of significant bits in the data string generated by said data combination means and outputting the number as a signal to outside.
- FIG. 1 is a block diagram showing an image coding apparatus according to a first embodiment of the present invention
- FIG. 2 is a flowchart showing a processing procedure for inserting an identifier in the JPEG system into a code data string by a main control unit 100 of the image coding apparatus according to the first embodiment;
- FIG. 3 is a flowchart showing in detail restart marker insertion in the processing procedure by the main control unit 100 of the image coding apparatus according to the first embodiment
- FIGS. 4A to 4 H are schematic diagrams showing an identifier position tracking unit 711 in a case where padding bits and a restart marker are written into a data combination unit 706 of the image coding apparatus according to the first embodiment;
- FIGS. 5A to 5 H are schematic diagrams showing the relation between the position of restart marker in the data combination unit 706 and identifier position information generated by an identifier position generation unit 710 in the image coding apparatus according to the first embodiment;
- FIG. 6 is a block diagram showing the image coding apparatus according to a second embodiment of the present invention.
- FIG. 7 is a flowchart showing in detail the restart marker insertion in the processing procedure by the main control unit 100 of the image coding apparatus according to the second embodiment
- FIGS. 8A to 8 J are schematic diagrams showing an identifier position tracking unit 811 in a case where padding bits and a restart marker are written into a data combination unit 806 of the image coding apparatus according to the second embodiment;
- FIG. 9 is a block diagram showing the conventional image coding apparatus in conformity to the JPEG system.
- FIG. 10 is a flowchart showing a code amount control procedure in the image coding apparatus according to the first embodiment of the present invention.
- FIG. 11 is a block diagram showing the image coding apparatus according to the first embodiment of the present invention.
- FIG. 12 is a flowchart showing a processing procedure for inserting an identifier on the MPEG system into a code data string by the main control unit 100 of the image coding apparatus according to the first embodiment.
- FIG. 13 is a flowchart showing in detail a slice header insertion in the processing procedure by the main control unit 100 of the image coding apparatus according to the first embodiment.
- FIG. 1 shows a variable-length coding apparatus and a main control unit according to a first embodiment of the present invention.
- reference numeral 701 denotes a variable-length coding unit which performs variable-length coding on a symbol of level and run-length generated by a run-length coding unit; and 702 , a coding stop control unit which stops coding processing based on the number of symbols processed by the variable-length coding unit 701 , and informs the main control unit 100 of the stoppage of coding processing by the variable-length coding unit 701 .
- numeral 703 denotes a coding start control unit which instructs the variable-length coding unit 701 from the main control unit 100 to start the coding processing; and 704 , a written data storage unit in which data written from the main control unit 100 is stored.
- numeral 705 denotes a selector which selects one of variable-length code data outputted from the variable-length coding unit 701 or data outputted from the written data storage unit 704 ; and 706 , a 32-bit length data combination unit for connection of data selected by the selector 705 .
- numeral 707 denotes a data addition unit which adds a particular data pattern to an identifier if it detects a pattern identical to the identifier in a data string outputted from the data combination unit 706 ;
- 708 a number of written bits storage unit in which the number of bits of data, written from the main control unit 100 into the data combination unit 706 , is stored;
- 709 a number of significant bits control unit which counts and stores the number of significant bits in the data combination unit 706 ;
- 710 an identifier position generation unit which generates 4-bit identifier position information indicating the position of identifier, written from the main control unit 100 through the written data storage unit 704 and the selector 705 , in the 32-bit length data combination unit 706 ;
- 711 an identifier position tracking unit which tracks the 4-bit identifier position information outputted from the identifier position generation unit 710 based on the operation of the data combination unit 706 .
- numeral 712 denotes a coding scheme storage unit used for notifying the coding scheme of processing object image such as JPEG or MPEG scheme, from the main control unit 100 to the variable-length encoder 700 .
- the JPEG scheme is set as a coding scheme for the processing object image in the coding scheme storage unit 712 .
- variable-length encoder 700 variable-length encodes symbols and generates variable-length code data.
- the selector 705 selects the variable-length code data or data written into the data storage unit 704 (including an identifier) and outputs the selected data to the data combination unit 706 .
- the data combination unit 706 connects sequentially-outputted variable-length code data or the like (variable-length code data, identifier or the like) and outputs the data by predetermined data length such as 1 byte to the data addition unit 707 .
- the data addition unit 707 is notified from the coding scheme storage unit 712 that the processing object image is in conformity to the JPEG scheme.
- the data addition unit 707 detects a data pattern specific to the JPEG scheme, 0 ⁇ FF (8-bit length) in the variable-length code data sequentially outputted from the data combination unit 706 within a byte boundary, adds 0 ⁇ 00 (8-bit length) immediately behind the data pattern.
- the variable-length code data 0 ⁇ FF (8-bit length) and the data pattern 0 ⁇ FF (8-bit length) specific to the identifier defined by the JPEG scheme can be discriminated from each other upon decoding.
- variable-length encoder 700 for inserting an identifier into a variable-length code data under an instruction from the main control unit 100 will be described with reference to the flowchart of FIG. 2.
- an identifier which is called restart marker in the JPEG scheme and which is inserted in a code data string by predetermined symbols will be described. Note that the interval of symbols between inserted restart markers is called restart interval.
- the main control unit 100 When the initialization of the count values 1 and 2 and setting of the restart interval have been completed, the main control unit 100 outputs a coding processing start command.
- the variable-length coding unit 701 receives the command via the coding start control unit 703 , and starts variable-length coding.
- the variable-length coding in the variable-length coding unit 701 is performed on the symbols generated by the run-length coding unit by MCU (by minimum coding unit) (step S 1003 ).
- the coding stop control unit 702 increments the count values 1 and 2 by one (step S 1004 ).
- the count value 2 and the restart interval are compared with each other, and if the count value 2 is less than the restart interval, the process returns to step S 1003 to repeat the variable-length coding by MCU.
- the coding stop control unit 702 issues a stop command to the variable-length coding unit 701 so as to stop the variable-length coding, and outputs a signal indicating the stoppage of the variable-length coding to the main control unit 100 .
- the main control unit 100 receives the signal and performs a restart marker insertion procedure (steps S 1005 and S 1006 ).
- the main control unit 100 reads the count value 1 from the coding stop control unit 702 , and compares the count value 1 with the total number of MCUs included in the currently-processed image. If the count value 1 is less than the total number of MCUs, the main control unit 100 outputs a variable-length coding start command to the coding start control unit 703 to repeat the variable-length coding by MCU at step S 1002 .
- step S 1007 if the count value 1 is equal to the total number of MCUs, it is determined that all the symbols have been encoded, and the coding is terminated.
- the coding stop control unit 702 stops coding by the variable-length coding unit 701 when the symbols for the restart interval have been variable-length encoded, and notifies the main control unit 100 of the status where the variable-length coding unit 701 has stopped the variable-length coding. Then the main control unit 100 starts the procedure for inserting the restart marker into the variable-length coded data.
- the restart marker In the JPEG coding, the restart marker must exist in a byte boundary. Accordingly, if the variable-length code data is not ended in a byte boundary upon stoppage of coding by the variable-length coding unit 701 , plural “1”, called padding bits, must be inserted by the byte boundary. Before the number of padding bits is obtained, the number of padding bits as a variable stored in the main control unit 100 is initialized to zero (step S 2001 ).
- the main control unit 100 reads the number of significant bits remaining in the data combination unit 706 at that time from the number of significant bits control unit 709 , and calculates the number of bits necessary for the data to the byte boundary.
- main control unit compares the value of the number of significant bits control unit 709 with zero. If the value of the number of significant bits control unit 709 is not equal to zero, the main control unit calculates the number of padding bits at step S 2003 . On the other hand, if the value of the number of significant bits control unit 709 is zero, it is determined that the data in the data combination unit 706 ends in the byte boundary and no padding bit is required. Then the process proceeds to step S 2004 (step S 2002 ). The calculation of the number of padding bits is made by dividing the number of significant bits of variable-length code data, remaining in the data combination unit 706 obtained from the number of significant bits control unit 709 , by 8 and obtaining a remainder (step S 2003 ).
- step S 2004 it is determined whether or not the number of bits writable into the data combination unit 706 is greater than a value obtained by adding 16 bits necessary for the restart marker to the number of padding bits. Note that the calculation of the number of necessary bits in the 32-bit length data combination unit 706 is made by subtracting the number of significant bits of variable-length code data remaining in the data combination unit 706 from 32.
- the main control unit 100 writes the data where the padding bits and the desired restart marker are combined into the written data storage unit 704 (step S 2005 ).
- step S 2005 0 ⁇ FFD0 (16-bit length) is written as the restart marker.
- the lower-order 4 bits are varied within the range of 0 to 7.
- the actual writing of the padding bits and the restart marker into the data combination unit 706 is made by writing a value obtained by adding 16 bits necessary for the restart marker to the number of padding bits (number of bits) into the number of written bits storage unit 708 , thereby the written data storage unit 704 is notified of the number of significant bits among the data written from the main control unit 100 (step S 2006 ).
- the coding stop control unit 702 stops coding by the variable-length coding unit 701 upon completion of coding of symbols for the restart interval.
- FIG. 4A shows a case where the variable-length code data remaining in the data combination unit 706 at this time is 6 bit data.
- the data combination unit 706 has a 32-bit length shifter.
- the written data is set sequentially from the most significant bit, and outputted by 1 byte from the most significant bit to the data addition unit 707 . Further, as shown in FIG. 4E, since no identifier exists in the data combination unit 706 all the 4 bits of the identifier position tracking unit 711 are zero.
- FIG. 4B shows a case where 18-bit data obtained by combining 2 bit data as padding bits with 16 bit data as the desired restart marker is written from the main control unit 100 through the written data storage unit 704 and the selector 705 into the data combination unit 706 .
- the identifier position generation unit 710 generates 4 bit information indicating the position of the restart marker in the 32-bit length data combination unit 706 .
- FIGS. 5A to 5 H show the relation between the position of the restart marker in the data combination unit 706 and the identifier position information generated by the identifier position generation unit 710 .
- FIGS. 5A and 5E show the 4-bit identifier position information generated by the identifier position generation unit 710 when the head byte of the restart marker exists at the highest-order byte of the data combination unit 706 .
- the position of the identifier in the 32-bit length data combination unit 706 can be indicated by 4 bits.
- FIGS. 5B and 5F show the 4-bit identifier position information generated by the identifier position generation unit 710 when the head byte of the restart marker exists at the second highest-order byte of the data combination unit 706 .
- FIGS. 5C and 5G show the 4-bit identifier position information generated by the identifier position generation unit 710 when the head byte of the restart marker exists at the third highest-order byte of the data combination unit 706 .
- FIGS. 5D and 5H show the 4-bit identifier position information generated by the identifier position generation unit 710 when the head byte of the restart marker exists at the lowest-order byte of the data combination unit 706 .
- the 4-bit identifier position information where the second bit is “1” is generated by the identifier position generation unit 710 as in the case of FIG. 5F and outputted to the identifier position tracking unit 711 .
- the identifier position information is generated from the following expression.
- alphabet x is the number of significant bits in the data combination unit 706 obtained from the number of significant bits control unit 709 , and y, the 4-bit identifier position information represented by using C++ operators.
- the calculation of the identifier position information y differs based on whether or not the remainder of division of the number of significant bits x by 8 as in the expression 1 is zero.
- FIG. 4C shows the status of the data combination unit 706 when the highest-order byte of the data combination unit 706 has been outputted to the data addition unit 707
- FIG. 4G shows the status of the identifier position tracking unit 711 .
- the restart marker is set at the highest-order byte of the data combination unit 706 , and in the identifier position tracking unit 711 , the most significant bit is “1”.
- FIG. 4D shows the status of the data combination unit 706 when the head byte of the restart marker has been outputted to the data addition unit 707
- FIG. 4H shows the status of the identifier position tracking unit 711 .
- the head byte 0 ⁇ FF (8-bit length) of the restart marker is outputted to the data addition unit 707 and at the same time, the most significant bit “1” in the identifier position tracking unit 711 is outputted to the data addition unit 707 , thereby the data addition unit is notified that the written 0 ⁇ FF (8-bit length) is the head byte data of the identifier. Then the data addition unit 707 does not add particular data to the 0 ⁇ FF (8-bit length) data.
- the MPEG scheme is set as a coding scheme for the processing object image in the coding scheme storage unit 712 .
- variable-length encoder 700 variable-length encodes symbols and generates variable-length code data.
- the selector 705 selects the variable-length code data or data written into the data storage unit 704 (including identifiers) and outputs the selected data to the data combination unit 706 .
- the data combination unit 706 connects sequentially-outputted variable-length code data or the like (variable-length code data, identifier or the like) and outputs the data by predetermined data length such as 1 byte to the data addition unit 707 .
- the data addition unit 707 is notified from the coding scheme storage unit 712 that the processing object image is in conformity to the MPEG scheme.
- the data addition unit 707 does not perform any processing on the variable-length code data sequentially outputted from the data combination unit 707 and outputs the data as a code data string.
- variable-length encoder 700 for inserting an identifier into a variable-length code data under an instruction from the main control unit 100 will be described with reference to the flowchart of FIG. 12.
- an identifier called slice start code in the MPEG scheme which exists at the head of slice is inserted.
- the slice may include plural macro blocks, the interval between occurrence of slice start code may differ in each slice.
- count value 1 and count value 2 counted by the coding stop control unit 702 are initialized (steps S 5001 and S 5002 ), and the number of macro blocks to be included in the currently-processed slice is set.
- the main control unit 100 inserts a slice header which begins with the slice start code into the code data string (step S 5003 ).
- the main control unit 100 outputs a coding start command to the variable-length coding unit 701 .
- the variable-length coding unit 701 receives the command via the coding start control unit 703 , and starts variable-length coding.
- the variable-length coding in the variable-length coding unit 701 is performed on the symbols generated by the run-length coding unit by macro block (step S 5004 ).
- the coding stop control unit 702 increments the count values 1 and 2 by one (step S 5005 ).
- the count value 2 and the number of macro blocks in the slice are compared with each other, and if the count value 2 is less than the number of macro blocks in the slice, the process returns to step S 5004 to repeat the variable-length coding by macro block.
- the coding stop control unit 702 issues a stop command to the variable-length coding unit 701 so as to stop the variable-length coding, and outputs a signal indicating the stoppage of the variable-length coding to the main control unit 100 (step S 5006 ).
- the main control unit 100 reads the count value 1 from the coding stop control unit 702 , and compares the count value 1 with the total number of slices included in the currently-processed picture. If the count value 1 is less than the total number of slices, the main control unit 100 outputs a variable-length coding start command to the coding start control unit 703 to repeat the variable-length coding by macro block at step S 5002 .
- step S 5007 if the count value 1 is equal to the total number of MCUs, it is determined that all the symbols have been encoded, and the coding is terminated.
- the main control unit 100 starts the procedure for inserting the slice header into the variable-length code data prior to macro block coding.
- the slice start code as an identifier at the head of the slice header must exist in a byte boundary. Accordingly, if the variable-length code data is not ended in a byte boundary upon stoppage of coding by the variable-length coding unit 701 , plural “0”, called padding bits, must be inserted by the byte boundary.
- the main control unit 100 reads the number of significant bits remaining in the data combination unit 706 at that time from the number of significant bits control unit 709 , and calculates the number of bits necessary for the data to the byte boundary. To obtain the number of padding bits, first, main control unit compares the value of the number of significant bits control unit 709 with zero. If the value of the number of significant bits control unit 709 is not equal to zero, the main control unit calculates the number of padding bits at step S 6002 . On the other hand, if the value of the number of significant bits control unit 709 is zero, it is determined that the data in the data combination unit 706 ends in the byte boundary and no padding bit is required. Then the process proceeds to step S 6005 (step S 6001 ).
- the calculation of the number of padding bits is made by dividing the number of significant bits of variable-length code data, remaining in the data combination unit 706 obtained from the number of significant bits control unit 709 , by 8 and obtaining a remainder (step S 6002 ).
- the padding bits are generated from the obtained number of padding bits, and written into the written data storage unit 704 (step S 6003 ). Further, the number of padding bits is written into the number of bits storage unit 708 , thereby the padding bits are actually written into the data combination unit 706 and the variable-length code data existing in the data combination unit 706 ends in the byte boundary (step S 6004 ).
- step S 6005 to write the 32-bit slice start code into the data combination unit 706 , it is determined whether or not there is no significant variable-length code data remaining the data combination unit 706 indicated by the number of significant bits control unit 709 (step S 6005 ).
- the main control unit 100 writes the desired slice start code into the written data storage unit 704 (step S 6006 ). Then, the unit writes 32 as the bit length of the slice start code into the number of written bits storage unit 708 , thereby the slice start code is actually written into the data combination unit 706 (step S 6007 ).
- the main control unit 100 determines that the value obtained by subtracting the significant variable-length code data remaining in the data combination unit 706 from 32 is equal to or greater than 6 (step S 6008 ).
- the main control unit 100 writes the 6-bit data including the quantization scaling value into the written data storage unit 704 (step S 6009 ). Then the unit writes 6 as the number of bits, obtained by adding the quantization scaling value 5 bits to 1 bit, into the number of written bits storage unit 708 , thereby actually writes the data into the data combination unit 706 (step S 6010 ).
- the conventional variable-length coding unit comprises a specialized hardware device and has a large circuit scale
- a part of processing by the variable-length coding unit e.g. a function of controlling the flow of processing or a function of setting data to be inserted
- the main control unit assigns a part of processing to the main control unit to the main control unit.
- the data to be inserted identifier such as the restart marker or the slice start code
- insertion timing the start interval or the number of macro blocks in slice
- the insertion of restart marker in the JPEG scheme and the insertion of slice header in the MPEG scheme have been described, however, insertion of EOI marker or DNL marker in the JPEG scheme, insertion of picture header necessary in the picture layer as a higher order layer of the slice layer in the MPEG scheme, or insertion of identifier in other different coding schemes can be performed by changing the insertion timing and insertion data.
- FIG. 11 is a block diagram showing the image coding apparatus according to the first embodiment of the present invention.
- a header portion outputted from the main control unit 100 is selected by the selector 601 and outputted to the outside.
- image data input is started, and coding is performed on the ECS in the JPEG system or the picture layer in the MPEG system.
- Numeral 201 denotes a DCT unit which converts the input image data to DCT coefficients.
- the DCT coefficients are quantized by a quantization unit 301 .
- the quantization value is set from the main control unit 100 .
- the quantized values are converted by a run-length coding unit 401 into symbol of run-length and level, and inputted into the above-described variable-length encoder 700 .
- step S 1006 in FIG. 2 in the status where coding is temporarily stopped for restart marker insertion or slice header insertion, the code amount control as shown in FIG. 10 is performed.
- the main control unit 100 reads the total code amount of code data string outputted until the stoppage of the coding, counted by the data addition unit 707 , and compares the amount with a predetermined threshold value (step S 4001 ). If the total code amount is less than the threshold value, the procedure of the code amount control is terminated, while if the total code amount is equal to or greater than the threshold value, the code amount control procedure is started, and quantization values set in the quantization unit 300 are re-set at steps S 4002 to S 4005 .
- a quantization value index i is initialized to zero (step S 4002 ).
- the quantization value currently set in the quantization unit 300 is divided by an arbitrary scaling value, and the quantization value is written into the quantization unit 300 (step S 4003 ). Then the process proceeds to step S 4004 .
- step S 4004 the index i is incremented by 1, and steps S 4003 and S 4004 are repeated until all the 64 quantization values corresponding to the 8 ⁇ 8 pixel block are re-set (step S 4005 ).
- initialization is performed so as to input the image data again (step S 4006 ).
- the apparatus self-operates until all the symbols are encoded in the variable-length coding unit, whereas in the present embodiment, the code amount can be evaluated even if all the symbols have not been encoded, by performing processing while checking the total code amount by MCU, macro block or slice.
- the number of significant bits in the data combination unit 706 is read from the number of significant bits control unit 709 in the status where the variable-length coding is stopped by the coding stop control unit 702 .
- the number of significant bits can also be read during variable-length coding.
- the main control unit 100 counts the number of cycles (the number of MCUs or macro blocks) in the period of insertion of restart marker or slice header, and stores a mean value as a required cycle mean value. In the interval of insertion of arbitrary restart marker or slice header, if the notification of stoppage has not sent from the coding stop control unit 702 even when coding is continued for the required cycle mean value by a predetermined threshold or more, the number of significant bits in the data combination unit 706 is repeatedly read a predetermined number of times through the number of significant bits control unit 709 .
- the main control unit 100 adaptively controls the processing thereafter by inspection of the respective hardware devices or the like.
- the main control unit 100 determines that the coding processing is normally continued. Note that in the present embodiment, the main control unit 100 reads the number of significant bits at the interval of insertion of restart marker or slice header, however, finer control can be made by reading the number of significant bits at an interval of processing on MCU or macro block.
- FIG. 6 is a block diagram showing the image coding apparatus according to a second embodiment of the present invention.
- numeral 801 denotes a variable-length coding unit which performs variable-length coding on symbols of level and run-length generated by a run-length encoder; 802 , a coding stop control unit which stops coding based on the number of symbols processed by the variable-length coding unit 801 and notifies the main control unit 100 that the variable-length coding unit 801 has stopped the coding processing.
- numeral 803 denotes a coding start control unit which sends an instruct from the main control unit 100 to the variable-length coding unit 801 to start the coding processing; and 804 , a written data storage unit in which data written from the main control unit 100 is stored.
- numeral 805 denotes a selector which selects one of variable-length code data outputted from the variable-length coding unit 801 or data outputted from the written data storage unit 804 ; and 806 , a 32-bit length data combination unit for connection of data selected by the selector 805 .
- numeral 807 denotes a data addition unit which adds a particular data pattern to an identifier if it detects a pattern identical to the identifier in a data string outputted from the data combination unit 806 ;
- 808 a number of written bits storage unit in which the number of bits of data, written from the main control unit 100 into the data combination unit 806 , is stored;
- 809 a number of significant bits control unit which counts and stores the number of significant bits in the data combination unit 806 ;
- 810 an identifier position generation unit which generates 4-bit identifier position information indicating the position of identifier, written from the main control unit 100 through the written data storage unit 804 and the selector 805 , in the 32-bit length data combination unit 806 ;
- 811 an identifier position tracking unit which tracks the 4-bit identifier position information outputted from the identifier position generation unit 810 based on the operation of the data combination unit 806 .
- numeral 812 denotes an identifier-writing status storage unit used for storing a status where an identifier is written from the main control unit 100 through the written data storage unit 804 and the selector 805 into the data combination unit 806 .
- numeral 813 denotes a coding scheme storage unit used for notifying the coding scheme of processing object image such as JPEG or MPEG scheme, from the main control unit 100 to the variable-length encoder 800 .
- the JPEG scheme is set as a coding scheme for the processing object image in the coding scheme storage unit 813 .
- the coding stop control unit 802 stops coding by the variable-length coding unit 801 when the symbols for the restart interval have been variable-length encoded, and notifies the main control unit 100 of the status where the variable-length coding unit 801 has stopped the variable-length coding.
- the main control unit 100 notified of the status where the variable-length coding unit 801 has stopped the variable-length coding starts the procedure for inserting the restart marker into the variable-length code data.
- the restart marker must exist in a byte boundary, if the variable-length code data is not ended in a byte boundary upon stoppage of coding by the variable-length coding unit 801 , plural “1”, called padding bits, must be inserted by the byte boundary.
- the number of significant bits remaining in the data combination unit 806 is read from the number of significant bits control unit 809 at that time, and the number of bits necessary for the data to the byte boundary is calculated.
- the number of padding bits first, the value of the number of significant bits control unit 809 is compared with zero. If the value of the number of significant bits control unit 809 is not equal to zero, the number of padding bits is calculated at steps S 3002 to 3004 .
- the padding bits are written into the data combination unit 806 by using the written data storage unit 804 and the written bits storage unit 808 .
- step S 3005 step S 3001 .
- the calculation of the number of padding bits is made by dividing the number of significant bits of variable-length code data, remaining in the data combination unit 806 obtained from the number of significant bits control unit 809 , by 8 and obtaining a remainder (step S 3002 ).
- the padding bits are generated based on the obtained number of padding bits, and written into the written data storage unit 804 (step S 3003 ). Further, as the number of padding bits is written into the number of written bits storage unit 808 , the padding bits are actually written into the data combination unit 806 , thereby the variable-length code data string existing in the data combination unit 806 ends in the byte boundary (step S 3004 ).
- step S 3005 it is determined whether or not the number of bits writable into the data combination unit 806 is greater than a value obtained by adding 16 bits necessary for the restart marker. Note that the calculation of the number of necessary bits in the 32-bit length data combination unit 806 is made by subtracting the number of significant bits of variable-length code data remaining in the data combination unit 806 from 32.
- the main control unit 100 writes “1” into the identifier-writing status storage unit 812 , and notifies the identifier position generation unit 810 of additional writing of the identifier to the variable-length code string which ends in the byte boundary (step S 3006 ).
- step S 3007 the desired restart marker is written into the written data storage unit 804 (step S 3007 ).
- step S 3007 0 ⁇ FFD0 (16-bit length) is written as the restart marker.
- the lower-order 4 bits are varied within the range of 0 to 7.
- the actual writing of the padding bits and the restart marker into the data combination unit 806 is made by writing 16 as the bit-length of the restart marker into the number of written bits storage unit 808 (step S 3008 ).
- the coding stop control unit 802 stops coding by the variable-length coding unit 801 upon completion of coding of symbols for the restart interval.
- FIG. 8A shows a case where the variable-length code data remaining in the data combination unit 806 at this time is 6 bit data.
- the data combination unit 806 has a 32-bit length shifter.
- the written data is set sequentially from the most significant bit, and outputted by 1 byte from the most significant bit to the data addition unit 807 . Further, as shown in FIG. 8F, since no identifier exists in the data combination unit 806 , all the 4 bits of the identifier position tracking unit 811 are zero.
- FIG. 8B shows a case where 2-bit “1” as padding bits are written from the main control unit 100 through the written data storage unit 804 and he selector 805 into the data combination unit 806 , and the variable-length code data string in the data combination unit 806 ends in a byte boundary.
- all the 4 bits of the identifier position tracking unit 811 are zero.
- FIG. 8C shows a case where the desired 16-bit restart marker is written from the main control unit 100 through the written data storage unit 804 and the selector 805 into the data combination unit 806 . Since the identifier position generation unit 810 has been previously notified from the main control unit 100 that the identifier is written through the identifier-writing status storage unit 812 , the identifier position generation unit 810 is informed of the status where the variable-length code data string in the data combination unit 806 ends in the byte boundary. Accordingly, the identifier position generation unit 810 generates the identifier position information by the following expression 2.
- alphabet x is the number of significant bits in the data combination unit 806 obtained from the number of significant bits control unit 809
- y the 4-bit identifier position information represented by using C++ operators. Note that since the identifier position generation unit 810 has been previously notified from the main control unit 100 that the identifier is written through the identifier-writing status storage unit 812 , in the variable-length encoder 800 having the identifier position generation unit 810 , the identifier position information can be obtained by further simple calculation in comparison with the variable-length encoder 700 without the identifier position generation unit 810 .
- the identifier position information in a case where the data combination unit 806 is in the status as shown in FIG. 8C is calculated by the following expression 3.
- FIG. 8D shows the status of the data combination unit 806 when the highest order byte of the data combination unit 806 has been outputted to the data addition unit 807
- FIG. 8J shows the status of the identifier position tracking unit 811 .
- the restart marker is set from the highest order byte of the data combination unit 806 , and the most significant bit in the identifier position tracking unit 811 is “1”.
- FIG. 8E shows the status of the data combination unit 806 when the head byte of the restart marker has been outputted to the data addition unit 807
- FIG. 8J the status of identifier position tracking unit 811 .
- the head byte 0 ⁇ FF (8-bit length) of the restart marker is outputted to the data addition unit 807 and at the same time, the most significant bit “1” in the identifier position tracking unit 811 is outputted to the data addition unit 807 , thereby it is notified that the written 0 ⁇ FF (8-bit length) is the head byte data of the identifier. Then the data addition unit 807 does not add particular data to the 0 ⁇ FF (8-bit length) data.
- the MPEG scheme is set as a coding scheme for the processing object image in the coding scheme storage unit 813 .
- the slice header insertion procedure shown at step S 5003 in FIG. 12 is the same as that of the first embodiment and a slider header is inserted by a procedure shown in the flowchart of FIG. 13. Accordingly, the explanation thereof will be omitted.
- the identifier position generation unit 810 since the identifier position generation unit 810 has been previously notified of identifier in the JPEG scheme from the main control unit 100 through the identifier-writing status storage unit 812 of writing, the identifier position generation unit 810 obtains the identifier position information by further simple calculation in comparison with that of the first embodiment, which further reduces the circuit scale.
- the present invention provides a variable-length coding apparatus having a further reduced circuit scale, which flexibly handles different identifier insertion procedures in various coding schemes, and which performs fine code amount control and adaptive erroneous operation control, and an image coding apparatus having the variable-length coding apparatus.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
Description
- The present invention relates to an image coding apparatus, and more particularly, to a variable-length coding apparatus which converts symbols into a code data string.
- Conventionally, the JPEG system, standardized by the ISO (International Organization for Standardization) is widely used as a coding scheme for storing a still image on a storage medium such as a CD-ROM or hard disk and displaying the image. A still image coded by the JPEG method includes a header portion having information necessary for decoding such as an image size and sampling coefficients of color components, and an entropy coded image data portion (ECS).
- Regarding the ECS portion, in a block interleave scheme for repeatedly encoding color components by 8×8 pixel block, the minimum unit in all the coded color component blocks based on sampling coefficients is called a minimum coding unit (MCU). For example, in an image with luminance Y, color chrominance Cb and Cr as color components, and the sampling coefficients at a ratio of 4:2:2, 4 blocks (Y, Y, Cb, Cr) constitute 1 MCU.
- On the other hand, an identifier called “restart marker” can be added to the ECS portion at MCU-based arbitrary periods. When a code data string including an error due to some reason is decoded, the influence of the error can be suppressed in the restart marker period. As the location of the restart marker is defined in the byte boundary of the ECS, if the MCU within an ECS immediately prior to insertion of the restart marker is not ended at the byte boundary, plural (1 to 7 bits) “1”, called “padding bits”, are inserted within the ECS then the restart marker is inserted.
- Further, the MPEG system, standardized by the ISO is widely used as a coding scheme for storing a moving image on a storage medium such as a CD-ROM or hard disk and displaying the image, and for broadcasting or bidirectional communication using a moving image via a communication path. A moving image coded by the MPEG method includes a header portion having information necessary for decoding such as an image size and quantization scaling value for quantization and uniform scaling of respective pixels, and an entropy-coded image data portion (macro block).
- The macro block structure limited by the MPEG system has a size of 16 pixels×16 pixels, and has color components including luminance Y and chrominance Cb and Cr. The respective color components are subsampled at the ratio of 4:1:1 by 8×8 pixel block.
- On the other hand, the MPEG system has a processing unit called a slice including plural macro blocks, and a layer having plural slices is called a slice layer. As an identifier called slice start code is always exists in the byte boundary at the head of slice, if a code data string including an error due to some reason is decoded, the influence of the error can be suppressed in the slice period. If one slice is not ended in the byte boundary, plural (1 to 7 bits) “0”, called “padding bits”, are inserted within the code data string then the slice start code is inserted.
- In recent years, some image coding apparatuses generate a code data string in cooperation with a main control unit used in a system including the image coding apparatus or a specialized main control unit in the image coding apparatus. In such arrangement, generally, the main control unit which can perform flexible processing generates the header portion, and a specialized hardware generates the ECS or macro block portion at a high speed.
- FIG. 9 shows an example of conventional image coding apparatus in conformity to the JPEG or MPEG system. First, a header portion outputted from a
main control unit 10, in which a control method can be changed by stored software, is selected by aselector 600 and outputted to the outside. Then, image data input is started, and coding is performed on the ECS or macro block portion. The input image data is converted by aDCT unit 200 into DCT coefficients, then the DCT coefficients are quantized by aquantization unit 300, and converted by a run-length coding unit 400 into symbols of run-length and level. Finally, the symbols are variable-length encoded by a variable-length encoder 500, then padding bits and identifier are inserted in the data, then selected by theselector 600 and outputted as the ECS or macro block portion to the outside. - In the conventional image coding apparatus, as the variable-
length encoder 500 inserts an identifier such as the restart marker or slice start code which differs by coding scheme into the variable-length coded data string, the apparatus has means for generating these identifiers, means for adding appropriate padding bits to the generated restart marker or slice start code and means for inserting the restart marker or slice start code to which the padding bits are added into the variable-length coded data string, as specialized hardware devices. Thus the circuit scale of the apparatus is large. - Further, to insert other identifiers, e.g., in the JPEG system, an EOI marker indicating the end of code data string or a DNL marker re-defining the number of input image lines, or in the MPEG system, a picture header necessary in a picture layer constructing one image which is a higher-order layer of the slice layer, into the code data string, hardware devices for the respective identifiers are required. Thus it is difficult to perform flexible identifier insertion processing.
- Further, in the conventional image coding apparatus, once coding of ECS in the JPEG system or picture layer in the MPEG system is started, the apparatus self-operates until the coding of all the symbols are completed in the variable-
length encoder 500. Accordingly, upon code amount control, even if the amount of generated code exceeds a target amount, the amount of generated code cannot be evaluated before completion of coding of all the ECS portion or picture layer. - Further, in the conventional image coding apparatus, in the event of mishap in coding due to some factor during coding of ECS in the JPEG system or picture layer in the MPEG system, it is difficult to detect the mishap and perform adaptive control.
- The present invention has been made in consideration of the above problems, and has its object to provide a variable-length coding apparatus having a smaller circuit scale, which flexibly handles identifier insertion processing in correspondence with various coding schemes, and which performs fine code amount control and adaptive erroneous operation control, and an image coding apparatus having the variable-length coding apparatus.
- To attain the foregoing object, the variable-length coding apparatus of the present invention has the following construction. That is, provided is a variable-length coding apparatus which converts quantized data obtained by quantizing image data into variable-length code data and generates a code data string having a predetermined data structure, comprising: coding scheme storage means for storing a coding scheme of said code data string; written data storage means for storing externally-input written data formed with an identifier or a combination of padding bit and identifier; selection means for selecting said written data if the written data is written into said written data storage means, otherwise, selecting said variable-length code data; data combination means for combining data selected by said selection means and generating a data string; number of bits storage means for storing the number of bits of said externally-input written data; and number of significant bits control means for calculating the number of significant bits in the data string generated by said data combination means and outputting the number as a signal to outside.
- Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same name or similar parts throughout the figures thereof.
- The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
- FIG. 1 is a block diagram showing an image coding apparatus according to a first embodiment of the present invention;
- FIG. 2 is a flowchart showing a processing procedure for inserting an identifier in the JPEG system into a code data string by a
main control unit 100 of the image coding apparatus according to the first embodiment; - FIG. 3 is a flowchart showing in detail restart marker insertion in the processing procedure by the
main control unit 100 of the image coding apparatus according to the first embodiment; - FIGS. 4A to4H are schematic diagrams showing an identifier
position tracking unit 711 in a case where padding bits and a restart marker are written into adata combination unit 706 of the image coding apparatus according to the first embodiment; - FIGS. 5A to5H are schematic diagrams showing the relation between the position of restart marker in the
data combination unit 706 and identifier position information generated by an identifierposition generation unit 710 in the image coding apparatus according to the first embodiment; - FIG. 6 is a block diagram showing the image coding apparatus according to a second embodiment of the present invention;
- FIG. 7 is a flowchart showing in detail the restart marker insertion in the processing procedure by the
main control unit 100 of the image coding apparatus according to the second embodiment; - FIGS. 8A to8J are schematic diagrams showing an identifier
position tracking unit 811 in a case where padding bits and a restart marker are written into adata combination unit 806 of the image coding apparatus according to the second embodiment; - FIG. 9 is a block diagram showing the conventional image coding apparatus in conformity to the JPEG system;
- FIG. 10 is a flowchart showing a code amount control procedure in the image coding apparatus according to the first embodiment of the present invention;
- FIG. 11 is a block diagram showing the image coding apparatus according to the first embodiment of the present invention;
- FIG. 12 is a flowchart showing a processing procedure for inserting an identifier on the MPEG system into a code data string by the
main control unit 100 of the image coding apparatus according to the first embodiment; and - FIG. 13 is a flowchart showing in detail a slice header insertion in the processing procedure by the
main control unit 100 of the image coding apparatus according to the first embodiment. - Preferred embodiments of the present invention will now be described in detail in accordance with the accompanying drawings.
- <Coding Processing by Variable-Length Coding Apparatus and Main Control Unit>
- FIG. 1 shows a variable-length coding apparatus and a main control unit according to a first embodiment of the present invention. In the variable-length coding apparatus in FIG. 1,
reference numeral 701 denotes a variable-length coding unit which performs variable-length coding on a symbol of level and run-length generated by a run-length coding unit; and 702, a coding stop control unit which stops coding processing based on the number of symbols processed by the variable-length coding unit 701, and informs themain control unit 100 of the stoppage of coding processing by the variable-length coding unit 701. - Further,
numeral 703 denotes a coding start control unit which instructs the variable-length coding unit 701 from themain control unit 100 to start the coding processing; and 704, a written data storage unit in which data written from themain control unit 100 is stored. - Further,
numeral 705 denotes a selector which selects one of variable-length code data outputted from the variable-length coding unit 701 or data outputted from the writtendata storage unit 704; and 706, a 32-bit length data combination unit for connection of data selected by theselector 705. - Further,
numeral 707 denotes a data addition unit which adds a particular data pattern to an identifier if it detects a pattern identical to the identifier in a data string outputted from thedata combination unit 706; 708, a number of written bits storage unit in which the number of bits of data, written from themain control unit 100 into thedata combination unit 706, is stored; 709, a number of significant bits control unit which counts and stores the number of significant bits in thedata combination unit 706; 710, an identifier position generation unit which generates 4-bit identifier position information indicating the position of identifier, written from themain control unit 100 through the writtendata storage unit 704 and theselector 705, in the 32-bit lengthdata combination unit 706; and 711, an identifier position tracking unit which tracks the 4-bit identifier position information outputted from the identifierposition generation unit 710 based on the operation of thedata combination unit 706. - Further,
numeral 712 denotes a coding scheme storage unit used for notifying the coding scheme of processing object image such as JPEG or MPEG scheme, from themain control unit 100 to the variable-length encoder 700. - First, a still image coding processing by the JPEG scheme in the present embodiment will be described.
- Prior to all the coding operation, the JPEG scheme is set as a coding scheme for the processing object image in the coding
scheme storage unit 712. - First, the entire flow of generation of code data string by the variable-
length encoder 700 from symbols generated by the run-length coding unit will be described. The variable-length coding unit 701 variable-length encodes symbols and generates variable-length code data. Theselector 705 selects the variable-length code data or data written into the data storage unit 704 (including an identifier) and outputs the selected data to thedata combination unit 706. - The
data combination unit 706 connects sequentially-outputted variable-length code data or the like (variable-length code data, identifier or the like) and outputs the data by predetermined data length such as 1 byte to thedata addition unit 707. Thedata addition unit 707 is notified from the codingscheme storage unit 712 that the processing object image is in conformity to the JPEG scheme. When thedata addition unit 707 detects a data pattern specific to the JPEG scheme, 0×FF (8-bit length) in the variable-length code data sequentially outputted from thedata combination unit 706 within a byte boundary, adds 0×00 (8-bit length) immediately behind the data pattern. By this addition, the variable-length code data 0×FF (8-bit length) and thedata pattern 0×FF (8-bit length) specific to the identifier defined by the JPEG scheme can be discriminated from each other upon decoding. - Next, a procedure by the variable-
length encoder 700 for inserting an identifier into a variable-length code data under an instruction from themain control unit 100 will be described with reference to the flowchart of FIG. 2. In this example, an identifier which is called restart marker in the JPEG scheme and which is inserted in a code data string by predetermined symbols will be described. Note that the interval of symbols between inserted restart markers is called restart interval. - First, in accordance with an instruction from the
main control unit 100,count value 1 and countvalue 2 counted by the codingstop control unit 702 are initialized (steps S1001 and S1002), and the restart interval is set. - When the initialization of the count values1 and 2 and setting of the restart interval have been completed, the
main control unit 100 outputs a coding processing start command. The variable-length coding unit 701 receives the command via the codingstart control unit 703, and starts variable-length coding. The variable-length coding in the variable-length coding unit 701 is performed on the symbols generated by the run-length coding unit by MCU (by minimum coding unit) (step S1003). - On the other hand, every time the variable-
length coding unit 701 variable-length encodes the symbols by MCU, the codingstop control unit 702 increments the count values 1 and 2 by one (step S1004). - Further, the
count value 2 and the restart interval are compared with each other, and if thecount value 2 is less than the restart interval, the process returns to step S1003 to repeat the variable-length coding by MCU. - On the other hand, if the
count value 2 is equal to or greater than the restart interval, the codingstop control unit 702 issues a stop command to the variable-length coding unit 701 so as to stop the variable-length coding, and outputs a signal indicating the stoppage of the variable-length coding to themain control unit 100. Themain control unit 100 receives the signal and performs a restart marker insertion procedure (steps S1005 and S1006). - When the restart marker insertion procedure has been completed, the
main control unit 100 reads thecount value 1 from the codingstop control unit 702, and compares thecount value 1 with the total number of MCUs included in the currently-processed image. If thecount value 1 is less than the total number of MCUs, themain control unit 100 outputs a variable-length coding start command to the codingstart control unit 703 to repeat the variable-length coding by MCU at step S1002. - On the other hand, if the
count value 1 is equal to the total number of MCUs, it is determined that all the symbols have been encoded, and the coding is terminated (step S1007). - Next, the restart marker insertion procedure at step S1006 in FIG. 2, performed by the variable-
length coding unit 701 based on the instruction from themain control unit 100, will be described in detail with reference to the flowchart of FIG. 3. - As described above, the coding
stop control unit 702 stops coding by the variable-length coding unit 701 when the symbols for the restart interval have been variable-length encoded, and notifies themain control unit 100 of the status where the variable-length coding unit 701 has stopped the variable-length coding. Then themain control unit 100 starts the procedure for inserting the restart marker into the variable-length coded data. - In the JPEG coding, the restart marker must exist in a byte boundary. Accordingly, if the variable-length code data is not ended in a byte boundary upon stoppage of coding by the variable-
length coding unit 701, plural “1”, called padding bits, must be inserted by the byte boundary. Before the number of padding bits is obtained, the number of padding bits as a variable stored in themain control unit 100 is initialized to zero (step S2001). - Next, the
main control unit 100 reads the number of significant bits remaining in thedata combination unit 706 at that time from the number of significantbits control unit 709, and calculates the number of bits necessary for the data to the byte boundary. To obtain the number of padding bits, first, main control unit compares the value of the number of significantbits control unit 709 with zero. If the value of the number of significantbits control unit 709 is not equal to zero, the main control unit calculates the number of padding bits at step S2003. On the other hand, if the value of the number of significantbits control unit 709 is zero, it is determined that the data in thedata combination unit 706 ends in the byte boundary and no padding bit is required. Then the process proceeds to step S2004 (step S2002). The calculation of the number of padding bits is made by dividing the number of significant bits of variable-length code data, remaining in thedata combination unit 706 obtained from the number of significantbits control unit 709, by 8 and obtaining a remainder (step S2003). - Next, it is determined whether or not the number of bits writable into the
data combination unit 706 is greater than a value obtained by adding 16 bits necessary for the restart marker to the number of padding bits (step S2004). Note that the calculation of the number of necessary bits in the 32-bit lengthdata combination unit 706 is made by subtracting the number of significant bits of variable-length code data remaining in thedata combination unit 706 from 32. - When the
data combination unit 706 becomes writable, themain control unit 100 writes the data where the padding bits and the desired restart marker are combined into the written data storage unit 704 (step S2005). - At step S2005, 0×FFD0 (16-bit length) is written as the restart marker. The lower-
order 4 bits are varied within the range of 0 to 7. The actual writing of the padding bits and the restart marker into thedata combination unit 706 is made by writing a value obtained by adding 16 bits necessary for the restart marker to the number of padding bits (number of bits) into the number of writtenbits storage unit 708, thereby the writtendata storage unit 704 is notified of the number of significant bits among the data written from the main control unit 100 (step S2006). - Next, prevention of addition of particular data by the
data addition unit 707 to the restart marker (identifier) written from themain control unit 100 through the writtendata storage unit 704 and theselector 705 into thedata combination unit 706 will be described with reference to FIGS. 4A to 4H and 5A to 5H. - First, as described above, the coding
stop control unit 702 stops coding by the variable-length coding unit 701 upon completion of coding of symbols for the restart interval. FIG. 4A shows a case where the variable-length code data remaining in thedata combination unit 706 at this time is 6 bit data. - The
data combination unit 706 has a 32-bit length shifter. The written data is set sequentially from the most significant bit, and outputted by 1 byte from the most significant bit to thedata addition unit 707. Further, as shown in FIG. 4E, since no identifier exists in thedata combination unit 706 all the 4 bits of the identifierposition tracking unit 711 are zero. - Next, FIG. 4B shows a case where 18-bit data obtained by combining 2 bit data as padding bits with 16 bit data as the desired restart marker is written from the
main control unit 100 through the writtendata storage unit 704 and theselector 705 into thedata combination unit 706. As the restart marker is written into thedata combination unit 706, the identifierposition generation unit 710 generates 4 bit information indicating the position of the restart marker in the 32-bit lengthdata combination unit 706. - FIGS. 5A to5H show the relation between the position of the restart marker in the
data combination unit 706 and the identifier position information generated by the identifierposition generation unit 710. FIGS. 5A and 5E show the 4-bit identifier position information generated by the identifierposition generation unit 710 when the head byte of the restart marker exists at the highest-order byte of thedata combination unit 706. As an identifier in the JPEG system always exists in a byte boundary, the position of the identifier in the 32-bit lengthdata combination unit 706 can be indicated by 4 bits. - Next, FIGS. 5B and 5F show the 4-bit identifier position information generated by the identifier
position generation unit 710 when the head byte of the restart marker exists at the second highest-order byte of thedata combination unit 706. FIGS. 5C and 5G show the 4-bit identifier position information generated by the identifierposition generation unit 710 when the head byte of the restart marker exists at the third highest-order byte of thedata combination unit 706. FIGS. 5D and 5H show the 4-bit identifier position information generated by the identifierposition generation unit 710 when the head byte of the restart marker exists at the lowest-order byte of thedata combination unit 706. - If the restart marker is written into the
data combination unit 706 as shown in FIG. 4B, the 4-bit identifier position information where the second bit is “1” is generated by the identifierposition generation unit 710 as in the case of FIG. 5F and outputted to the identifierposition tracking unit 711. In the identifierposition generation unit 710, the identifier position information is generated from the following expression. - (x%8==0)?(y=3−(x>>3)):(y=4−(x>>3)) [Expression 1]
- In the expression, alphabet x is the number of significant bits in the
data combination unit 706 obtained from the number of significantbits control unit 709, and y, the 4-bit identifier position information represented by using C++ operators. In FIG. 4B, as the padding bits with the restart markers are written into thedata combination unit 706, the calculation of the identifier position information y differs based on whether or not the remainder of division of the number of significant bits x by 8 as in theexpression 1 is zero. - Next, FIG. 4C shows the status of the
data combination unit 706 when the highest-order byte of thedata combination unit 706 has been outputted to thedata addition unit 707, and FIG. 4G shows the status of the identifierposition tracking unit 711. At this time, the restart marker is set at the highest-order byte of thedata combination unit 706, and in the identifierposition tracking unit 711, the most significant bit is “1”. - Further, FIG. 4D shows the status of the
data combination unit 706 when the head byte of the restart marker has been outputted to thedata addition unit 707, and FIG. 4H shows the status of the identifierposition tracking unit 711. Thehead byte 0×FF (8-bit length) of the restart marker is outputted to thedata addition unit 707 and at the same time, the most significant bit “1” in the identifierposition tracking unit 711 is outputted to thedata addition unit 707, thereby the data addition unit is notified that the written 0×FF (8-bit length) is the head byte data of the identifier. Then thedata addition unit 707 does not add particular data to the 0×FF (8-bit length) data. - Next, moving image coding processing based on the MPEG system in the present embodiment will be described.
- Prior to all the coding operation, the MPEG scheme is set as a coding scheme for the processing object image in the coding
scheme storage unit 712. - First, the entire flow of generation of code data string by the variable-
length encoder 700 from symbols generated by the run-length coding unit will be described. The variable-length coding unit 701 variable-length encodes symbols and generates variable-length code data. Theselector 705 selects the variable-length code data or data written into the data storage unit 704 (including identifiers) and outputs the selected data to thedata combination unit 706. - The
data combination unit 706 connects sequentially-outputted variable-length code data or the like (variable-length code data, identifier or the like) and outputs the data by predetermined data length such as 1 byte to thedata addition unit 707. Thedata addition unit 707 is notified from the codingscheme storage unit 712 that the processing object image is in conformity to the MPEG scheme. Thedata addition unit 707 does not perform any processing on the variable-length code data sequentially outputted from thedata combination unit 707 and outputs the data as a code data string. - Next, a procedure by the variable-
length encoder 700 for inserting an identifier into a variable-length code data under an instruction from themain control unit 100 will be described with reference to the flowchart of FIG. 12. In this example, an identifier called slice start code in the MPEG scheme which exists at the head of slice is inserted. As the slice may include plural macro blocks, the interval between occurrence of slice start code may differ in each slice. - First, in accordance with an instruction from the
main control unit 100,count value 1 and countvalue 2 counted by the codingstop control unit 702 are initialized (steps S5001 and S5002), and the number of macro blocks to be included in the currently-processed slice is set. - Next, the
main control unit 100 inserts a slice header which begins with the slice start code into the code data string (step S5003). - Further, the
main control unit 100 outputs a coding start command to the variable-length coding unit 701. The variable-length coding unit 701 receives the command via the codingstart control unit 703, and starts variable-length coding. The variable-length coding in the variable-length coding unit 701 is performed on the symbols generated by the run-length coding unit by macro block (step S5004). - On the other hand, every time the variable-
length coding unit 701 variable-length encodes the symbols by macro block, the codingstop control unit 702 increments the count values 1 and 2 by one (step S5005). - Further, the
count value 2 and the number of macro blocks in the slice are compared with each other, and if thecount value 2 is less than the number of macro blocks in the slice, the process returns to step S5004 to repeat the variable-length coding by macro block. - On the other hand, if the
count value 2 is equal to or greater than the number of macro blocks in the slice, the codingstop control unit 702 issues a stop command to the variable-length coding unit 701 so as to stop the variable-length coding, and outputs a signal indicating the stoppage of the variable-length coding to the main control unit 100 (step S5006). - The
main control unit 100 reads thecount value 1 from the codingstop control unit 702, and compares thecount value 1 with the total number of slices included in the currently-processed picture. If thecount value 1 is less than the total number of slices, themain control unit 100 outputs a variable-length coding start command to the codingstart control unit 703 to repeat the variable-length coding by macro block at step S5002. - On the other hand, if the
count value 1 is equal to the total number of MCUs, it is determined that all the symbols have been encoded, and the coding is terminated (step S5007). - Next, the slice header insertion procedure at step S5003 in FIG. 12, performed by the variable-
length coding unit 701 based on the instruction from themain control unit 100, will be described in detail with reference to the flowchart of FIG. 13. - As described above, the
main control unit 100 starts the procedure for inserting the slice header into the variable-length code data prior to macro block coding. - In the MPEG coding, the slice start code as an identifier at the head of the slice header must exist in a byte boundary. Accordingly, if the variable-length code data is not ended in a byte boundary upon stoppage of coding by the variable-
length coding unit 701, plural “0”, called padding bits, must be inserted by the byte boundary. - The
main control unit 100 reads the number of significant bits remaining in thedata combination unit 706 at that time from the number of significantbits control unit 709, and calculates the number of bits necessary for the data to the byte boundary. To obtain the number of padding bits, first, main control unit compares the value of the number of significantbits control unit 709 with zero. If the value of the number of significantbits control unit 709 is not equal to zero, the main control unit calculates the number of padding bits at step S6002. On the other hand, if the value of the number of significantbits control unit 709 is zero, it is determined that the data in thedata combination unit 706 ends in the byte boundary and no padding bit is required. Then the process proceeds to step S6005 (step S6001). - The calculation of the number of padding bits is made by dividing the number of significant bits of variable-length code data, remaining in the
data combination unit 706 obtained from the number of significantbits control unit 709, by 8 and obtaining a remainder (step S6002). The padding bits are generated from the obtained number of padding bits, and written into the written data storage unit 704 (step S6003). Further, the number of padding bits is written into the number ofbits storage unit 708, thereby the padding bits are actually written into thedata combination unit 706 and the variable-length code data existing in thedata combination unit 706 ends in the byte boundary (step S6004). - Next, to write the 32-bit slice start code into the
data combination unit 706, it is determined whether or not there is no significant variable-length code data remaining thedata combination unit 706 indicated by the number of significant bits control unit 709 (step S6005). - When the
data combination unit 706 becomes writable, themain control unit 100 writes the desired slice start code into the written data storage unit 704 (step S6006). Then, the unit writes 32 as the bit length of the slice start code into the number of writtenbits storage unit 708, thereby the slice start code is actually written into the data combination unit 706 (step S6007). - In the slice header, a 5-bit quantization scaling value and a subsequent 1-bit “0” must follow the slice start code. To write the 6-bit header information into the
data combination unit 706, themain control unit 100 determines that the value obtained by subtracting the significant variable-length code data remaining in thedata combination unit 706 from 32 is equal to or greater than 6 (step S6008). - When the
data combination unit 706 becomes writable, themain control unit 100 writes the 6-bit data including the quantization scaling value into the written data storage unit 704 (step S6009). Then the unit writes 6 as the number of bits, obtained by adding the quantization scaling value 5 bits to 1 bit, into the number of writtenbits storage unit 708, thereby actually writes the data into the data combination unit 706 (step S6010). - As described above, the conventional variable-length coding unit comprises a specialized hardware device and has a large circuit scale, whereas in the present embodiment, a part of processing by the variable-length coding unit (e.g. a function of controlling the flow of processing or a function of setting data to be inserted) is assigned to the main control unit, thereby the circuit scale can be reduced. Further, as a part of the processing is assigned to the main control unit, the data to be inserted (identifier such as the restart marker or the slice start code) can be changed or insertion timing (the start interval or the number of macro blocks in slice) can be changed in accordance with coding scheme. Accordingly, in the present embodiment, the insertion of restart marker in the JPEG scheme and the insertion of slice header in the MPEG scheme have been described, however, insertion of EOI marker or DNL marker in the JPEG scheme, insertion of picture header necessary in the picture layer as a higher order layer of the slice layer in the MPEG scheme, or insertion of identifier in other different coding schemes can be performed by changing the insertion timing and insertion data.
- <Code Amount Control in Image Coding Apparatus>
- Next, the code amount control in the image coding apparatus having the above-described variable-
length encoder 700 will be described. - FIG. 11 is a block diagram showing the image coding apparatus according to the first embodiment of the present invention. First, a header portion outputted from the
main control unit 100 is selected by theselector 601 and outputted to the outside. Thereafter, image data input is started, and coding is performed on the ECS in the JPEG system or the picture layer in the MPEG system.Numeral 201 denotes a DCT unit which converts the input image data to DCT coefficients. The DCT coefficients are quantized by aquantization unit 301. At this time, the quantization value is set from themain control unit 100. - After the quantization by the
quantization unit 301, the quantized values are converted by a run-length coding unit 401 into symbol of run-length and level, and inputted into the above-described variable-length encoder 700. - At step S1006 in FIG. 2, in the status where coding is temporarily stopped for restart marker insertion or slice header insertion, the code amount control as shown in FIG. 10 is performed.
- First, the
main control unit 100 reads the total code amount of code data string outputted until the stoppage of the coding, counted by thedata addition unit 707, and compares the amount with a predetermined threshold value (step S4001). If the total code amount is less than the threshold value, the procedure of the code amount control is terminated, while if the total code amount is equal to or greater than the threshold value, the code amount control procedure is started, and quantization values set in thequantization unit 300 are re-set at steps S4002 to S4005. - In the re-setting of the quantization value, first, a quantization value index i is initialized to zero (step S4002). Next, the quantization value currently set in the
quantization unit 300 is divided by an arbitrary scaling value, and the quantization value is written into the quantization unit 300 (step S4003). Then the process proceeds to step S4004. - At step S4004, the index i is incremented by 1, and steps S4003 and S4004 are repeated until all the 64 quantization values corresponding to the 8×8 pixel block are re-set (step S4005). When the resetting of all the quantization values has been completed, initialization is performed so as to input the image data again (step S4006).
- As described above, in the conventional image coding apparatus, once coding of ECS or picture layer is started, the apparatus self-operates until all the symbols are encoded in the variable-length coding unit, whereas in the present embodiment, the code amount can be evaluated even if all the symbols have not been encoded, by performing processing while checking the total code amount by MCU, macro block or slice.
- <Abnormality Determination by Variable-Length Coding Unit and Control Unit>
- Next, a description will be made about a procedure for detecting a mishap of coding due to some factor during coding of ECS in the JPEG scheme or coding of picture layer in the MPEG scheme and performing adaptive control, in the image coding apparatus according to the present embodiment.
- In the above description, the number of significant bits in the
data combination unit 706 is read from the number of significantbits control unit 709 in the status where the variable-length coding is stopped by the codingstop control unit 702. In this example, the number of significant bits can also be read during variable-length coding. - The
main control unit 100 counts the number of cycles (the number of MCUs or macro blocks) in the period of insertion of restart marker or slice header, and stores a mean value as a required cycle mean value. In the interval of insertion of arbitrary restart marker or slice header, if the notification of stoppage has not sent from the codingstop control unit 702 even when coding is continued for the required cycle mean value by a predetermined threshold or more, the number of significant bits in thedata combination unit 706 is repeatedly read a predetermined number of times through the number of significantbits control unit 709. - If the number of significant bits has been less than 8 and not changed in the predetermined number of times of reading, it is determined that there is a mishap in the processing upstream of the
data combination unit 706. On the other hand, if the number of significant bits has been equal to or greater than 8 and not changed, it is determined that there is a mishap in the processing downstream of thedata combination unit 706. Based on the result of determination, themain control unit 100 adaptively controls the processing thereafter by inspection of the respective hardware devices or the like. - If the number of significant bits has been changed in the predetermined number of times of reading, the
main control unit 100 determines that the coding processing is normally continued. Note that in the present embodiment, themain control unit 100 reads the number of significant bits at the interval of insertion of restart marker or slice header, however, finer control can be made by reading the number of significant bits at an interval of processing on MCU or macro block. - <Coding by Variable-Length Coding Unit and Control Unit>
- FIG. 6 is a block diagram showing the image coding apparatus according to a second embodiment of the present invention. In the variable-length coding unit shown in FIG. 6, numeral801 denotes a variable-length coding unit which performs variable-length coding on symbols of level and run-length generated by a run-length encoder; 802, a coding stop control unit which stops coding based on the number of symbols processed by the variable-
length coding unit 801 and notifies themain control unit 100 that the variable-length coding unit 801 has stopped the coding processing. - Further, numeral803 denotes a coding start control unit which sends an instruct from the
main control unit 100 to the variable-length coding unit 801 to start the coding processing; and 804, a written data storage unit in which data written from themain control unit 100 is stored. - Further, numeral805 denotes a selector which selects one of variable-length code data outputted from the variable-
length coding unit 801 or data outputted from the writtendata storage unit 804; and 806, a 32-bit length data combination unit for connection of data selected by theselector 805. - Further, numeral807 denotes a data addition unit which adds a particular data pattern to an identifier if it detects a pattern identical to the identifier in a data string outputted from the
data combination unit 806; 808, a number of written bits storage unit in which the number of bits of data, written from themain control unit 100 into thedata combination unit 806, is stored; 809, a number of significant bits control unit which counts and stores the number of significant bits in thedata combination unit 806; 810, an identifier position generation unit which generates 4-bit identifier position information indicating the position of identifier, written from themain control unit 100 through the writtendata storage unit 804 and theselector 805, in the 32-bit lengthdata combination unit 806; and 811, an identifier position tracking unit which tracks the 4-bit identifier position information outputted from the identifierposition generation unit 810 based on the operation of thedata combination unit 806. - Further, numeral812 denotes an identifier-writing status storage unit used for storing a status where an identifier is written from the
main control unit 100 through the writtendata storage unit 804 and theselector 805 into thedata combination unit 806. - Further, numeral813 denotes a coding scheme storage unit used for notifying the coding scheme of processing object image such as JPEG or MPEG scheme, from the
main control unit 100 to the variable-length encoder 800. - First, still image coding processing by the JPEG scheme in the present embodiment will be described.
- Prior to all the coding operation, the JPEG scheme is set as a coding scheme for the processing object image in the coding
scheme storage unit 813. - In the present embodiment, in the procedure for insertion of identifier into code data string by the
main control unit 100, as the restart marker insertion procedure shown at step S1006 in FIG. 2 is different from that of the first embodiment, the procedure will be described with reference to the flowchart of FIG. 7. - First, the coding
stop control unit 802 stops coding by the variable-length coding unit 801 when the symbols for the restart interval have been variable-length encoded, and notifies themain control unit 100 of the status where the variable-length coding unit 801 has stopped the variable-length coding. - The
main control unit 100 notified of the status where the variable-length coding unit 801 has stopped the variable-length coding starts the procedure for inserting the restart marker into the variable-length code data. In the JPEG coding, as the restart marker must exist in a byte boundary, if the variable-length code data is not ended in a byte boundary upon stoppage of coding by the variable-length coding unit 801, plural “1”, called padding bits, must be inserted by the byte boundary. - First, the number of significant bits remaining in the
data combination unit 806 is read from the number of significantbits control unit 809 at that time, and the number of bits necessary for the data to the byte boundary is calculated. To obtain the number of padding bits, first, the value of the number of significantbits control unit 809 is compared with zero. If the value of the number of significantbits control unit 809 is not equal to zero, the number of padding bits is calculated at steps S3002 to 3004. The padding bits are written into thedata combination unit 806 by using the writtendata storage unit 804 and the writtenbits storage unit 808. - On the other hand, if the value of the number of significant
bits control unit 809 is zero, it is determined that the data in thedata combination unit 806 ends in the byte boundary and no padding bit is required. Then the process proceeds to step S3005 (step S3001). - The calculation of the number of padding bits is made by dividing the number of significant bits of variable-length code data, remaining in the
data combination unit 806 obtained from the number of significantbits control unit 809, by 8 and obtaining a remainder (step S3002). The padding bits are generated based on the obtained number of padding bits, and written into the written data storage unit 804 (step S3003). Further, as the number of padding bits is written into the number of writtenbits storage unit 808, the padding bits are actually written into thedata combination unit 806, thereby the variable-length code data string existing in thedata combination unit 806 ends in the byte boundary (step S3004). - Next, it is determined whether or not the number of bits writable into the
data combination unit 806 is greater than a value obtained by adding 16 bits necessary for the restart marker (step S3005). Note that the calculation of the number of necessary bits in the 32-bit lengthdata combination unit 806 is made by subtracting the number of significant bits of variable-length code data remaining in thedata combination unit 806 from 32. - When the
data combination unit 806 becomes writable, themain control unit 100 writes “1” into the identifier-writingstatus storage unit 812, and notifies the identifierposition generation unit 810 of additional writing of the identifier to the variable-length code string which ends in the byte boundary (step S3006). - Thereafter, the desired restart marker is written into the written data storage unit804 (step S3007). At step S3007, 0×FFD0 (16-bit length) is written as the restart marker. The lower-
order 4 bits are varied within the range of 0 to 7. The actual writing of the padding bits and the restart marker into thedata combination unit 806 is made by writing 16 as the bit-length of the restart marker into the number of written bits storage unit 808 (step S3008). - Finally, “0” is written into the identifier-writing
status storage unit 812, and the identifierposition generation unit 810 is notified of completion of writing of identifier (step S3009). - Next, prevention of addition of particular data by the
data addition unit 807 to the restart marker (identifier) written from themain control unit 100 through the writtendata storage unit 804 and theselector 805 into thedata combination unit 806 will be described with reference to FIGS. 8A to 8J. - First, as described above, the coding
stop control unit 802 stops coding by the variable-length coding unit 801 upon completion of coding of symbols for the restart interval. FIG. 8A shows a case where the variable-length code data remaining in thedata combination unit 806 at this time is 6 bit data. - The
data combination unit 806 has a 32-bit length shifter. The written data is set sequentially from the most significant bit, and outputted by 1 byte from the most significant bit to thedata addition unit 807. Further, as shown in FIG. 8F, since no identifier exists in thedata combination unit 806, all the 4 bits of the identifierposition tracking unit 811 are zero. - Next, FIG. 8B shows a case where 2-bit “1” as padding bits are written from the
main control unit 100 through the writtendata storage unit 804 and heselector 805 into thedata combination unit 806, and the variable-length code data string in thedata combination unit 806 ends in a byte boundary. As shown in FIG. 8G, all the 4 bits of the identifierposition tracking unit 811 are zero. - Next, FIG. 8C shows a case where the desired 16-bit restart marker is written from the
main control unit 100 through the writtendata storage unit 804 and theselector 805 into thedata combination unit 806. Since the identifierposition generation unit 810 has been previously notified from themain control unit 100 that the identifier is written through the identifier-writingstatus storage unit 812, the identifierposition generation unit 810 is informed of the status where the variable-length code data string in thedata combination unit 806 ends in the byte boundary. Accordingly, the identifierposition generation unit 810 generates the identifier position information by the followingexpression 2. - y=3−(x>>3) [Expression 2]
- In the expression, alphabet x is the number of significant bits in the
data combination unit 806 obtained from the number of significantbits control unit 809, and y, the 4-bit identifier position information represented by using C++ operators. Note that since the identifierposition generation unit 810 has been previously notified from themain control unit 100 that the identifier is written through the identifier-writingstatus storage unit 812, in the variable-length encoder 800 having the identifierposition generation unit 810, the identifier position information can be obtained by further simple calculation in comparison with the variable-length encoder 700 without the identifierposition generation unit 810. The identifier position information in a case where thedata combination unit 806 is in the status as shown in FIG. 8C is calculated by the followingexpression 3. - y=3−(8>>3)=3−1=2 [Expression 3]
- As the identifier position information is “2” from the
expression 3, the 4-bit information where the second bit is “1” is outputted from the identifierposition generation unit 810 to the identifierposition tracking unit 811 as shown in FIG. 8H. Next, FIG. 8D shows the status of thedata combination unit 806 when the highest order byte of thedata combination unit 806 has been outputted to thedata addition unit 807, and FIG. 8J shows the status of the identifierposition tracking unit 811. At this time, the restart marker is set from the highest order byte of thedata combination unit 806, and the most significant bit in the identifierposition tracking unit 811 is “1”. - Further, FIG. 8E shows the status of the
data combination unit 806 when the head byte of the restart marker has been outputted to thedata addition unit 807, and FIG. 8J, the status of identifierposition tracking unit 811. Thehead byte 0×FF (8-bit length) of the restart marker is outputted to thedata addition unit 807 and at the same time, the most significant bit “1” in the identifierposition tracking unit 811 is outputted to thedata addition unit 807, thereby it is notified that the written 0×FF (8-bit length) is the head byte data of the identifier. Then thedata addition unit 807 does not add particular data to the 0×FF (8-bit length) data. - Next, moving image coding processing based on the MPEG scheme in the present embodiment will be described.
- Prior to all the coding operation, the MPEG scheme is set as a coding scheme for the processing object image in the coding
scheme storage unit 813. - In the present embodiment, in the procedure for insertion of identifier into code data string by the
main control unit 100, the slice header insertion procedure shown at step S5003 in FIG. 12 is the same as that of the first embodiment and a slider header is inserted by a procedure shown in the flowchart of FIG. 13. Accordingly, the explanation thereof will be omitted. - As described above, in the image coding apparatus having the construction of the present embodiment, since the identifier
position generation unit 810 has been previously notified of identifier in the JPEG scheme from themain control unit 100 through the identifier-writingstatus storage unit 812 of writing, the identifierposition generation unit 810 obtains the identifier position information by further simple calculation in comparison with that of the first embodiment, which further reduces the circuit scale. - As described above, the present invention provides a variable-length coding apparatus having a further reduced circuit scale, which flexibly handles different identifier insertion procedures in various coding schemes, and which performs fine code amount control and adaptive erroneous operation control, and an image coding apparatus having the variable-length coding apparatus.
- As many apparently widely different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the invention is not limited to the specific embodiments thereof except as defined in the appended claims.
Claims (28)
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP297439/2001 | 2001-09-27 | ||
JP2001297439 | 2001-09-27 | ||
JP178935/2002 | 2002-06-19 | ||
JP2002178935A JP2003174650A (en) | 2001-09-27 | 2002-06-19 | Image coding apparatus, variable-length coding apparatus, control apparatus, and method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
US20030058143A1 true US20030058143A1 (en) | 2003-03-27 |
US7375661B2 US7375661B2 (en) | 2008-05-20 |
Family
ID=26623112
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US10/245,766 Active 2026-09-29 US7375661B2 (en) | 2001-09-27 | 2002-09-18 | Image coding apparatus, variable-length coding apparatus, control apparatus and method therof |
Country Status (2)
Country | Link |
---|---|
US (1) | US7375661B2 (en) |
JP (1) | JP2003174650A (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030002743A1 (en) * | 2001-06-18 | 2003-01-02 | Ohta Ken-Ichi | Image processing method and apparatus, computer program, and storage medium |
US20030043905A1 (en) * | 2001-08-29 | 2003-03-06 | Tadayoshi Nakayama | Image processing method and apparatus, computer program, and storage medium |
US20030118240A1 (en) * | 2001-12-25 | 2003-06-26 | Makoto Satoh | Image encoding apparatus and method, program, and storage medium |
US20030219164A1 (en) * | 2002-04-09 | 2003-11-27 | Cannon Kabushiki Kaisha | Entropy coding apparatus |
US20040017855A1 (en) * | 2002-05-29 | 2004-01-29 | Canon Kabushiki Kaisha | Variable-length encoding apparatus and method |
US20040107399A1 (en) * | 2002-08-20 | 2004-06-03 | Canon Kabushiki Kaisha | Image processing apparatus and method therefor |
US20040196167A1 (en) * | 2003-04-01 | 2004-10-07 | Canon Kabushiki Kaisha | Variable-length decoding apparatus and method, computer program, and computer-readable storage medium |
US20050180507A1 (en) * | 2004-02-04 | 2005-08-18 | Arul Thangaraj | System and method for providing data starting from start codes aligned with byte boundaries in multiple byte words |
US20070025630A1 (en) * | 2005-07-27 | 2007-02-01 | Sung Chih-Ta S | Method and apparatus of image compression |
US8018996B2 (en) * | 2007-04-20 | 2011-09-13 | Panasonic Corporation | Arithmetic decoding apparatus and method |
US20120099655A1 (en) * | 2009-04-17 | 2012-04-26 | Scalado Ab | Image encoder and method for encoding images |
US20140169555A1 (en) * | 2011-03-25 | 2014-06-19 | Fujitsu Limited | Information processing apparatus, tampering detection apparatus, information processing method, tampering detection method, and computer product |
CN105007490A (en) * | 2015-08-03 | 2015-10-28 | 深圳市哈工大交通电子技术有限公司 | OmapL138-chip-based Jpeg compression algorithm |
US20190349000A1 (en) * | 2017-11-30 | 2019-11-14 | International Business Machines Corporation | Run-length base-delta encoding for high-speed compression |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4878262B2 (en) * | 2006-10-31 | 2012-02-15 | キヤノン株式会社 | Entropy encoding device |
CN101742329B (en) * | 2008-11-24 | 2013-02-13 | 北京中星微电子有限公司 | Image coding method and device |
US9215473B2 (en) | 2011-01-26 | 2015-12-15 | Qualcomm Incorporated | Sub-slices in video coding |
WO2012164813A1 (en) * | 2011-05-30 | 2012-12-06 | 日本電気株式会社 | Compression device |
US9124895B2 (en) | 2011-11-04 | 2015-09-01 | Qualcomm Incorporated | Video coding with network abstraction layer units that include multiple encoded picture partitions |
US9077998B2 (en) * | 2011-11-04 | 2015-07-07 | Qualcomm Incorporated | Padding of segments in coded slice NAL units |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5140621A (en) * | 1988-04-15 | 1992-08-18 | Thomson Csf | Method of encoding and decoding data in blocks, and encoding and decoding devices implementing this method |
US5479166A (en) * | 1993-11-30 | 1995-12-26 | Texas Instruments Incorporated | Huffman decoding method, circuit and system employing conditional subtraction for conversion of negative numbers |
US5512896A (en) * | 1993-11-30 | 1996-04-30 | Texas Instruments Incorporated | Huffman encoding method, circuit and system employing most significant bit change for size detection |
US5623423A (en) * | 1994-12-12 | 1997-04-22 | Univ. Of Texas | Apparatus and method for video decoding |
US5706460A (en) * | 1991-03-19 | 1998-01-06 | The United States Of America As Represented By The Secretary Of The Navy | Variable architecture computer with vector parallel processor and using instructions with variable length fields |
US5809306A (en) * | 1993-05-27 | 1998-09-15 | Matsushita Electric Industrial Co., Ltd. | Variable address length compiler and processor improved in address management |
US5822558A (en) * | 1995-04-12 | 1998-10-13 | Advanced Micro Devices, Inc. | Method and apparatus for predecoding variable byte-length instructions within a superscalar microprocessor |
US5828784A (en) * | 1992-07-13 | 1998-10-27 | Hitachi Denshi Kabushiki Kaisha | Data coding method and apparatus using a plurality of blocks of different length |
US6470376B1 (en) * | 1997-03-04 | 2002-10-22 | Matsushita Electric Industrial Co., Ltd | Processor capable of efficiently executing many asynchronous event tasks |
US20030088821A1 (en) * | 2000-08-31 | 2003-05-08 | Takashi Yokokawa | Interleaving apparatus |
US7180968B2 (en) * | 2000-08-31 | 2007-02-20 | Sony Corporation | Soft-output decoding |
US7197686B2 (en) * | 2002-10-11 | 2007-03-27 | Nvidia Corporation | Reconfigurable bit-manipulation node |
-
2002
- 2002-06-19 JP JP2002178935A patent/JP2003174650A/en not_active Withdrawn
- 2002-09-18 US US10/245,766 patent/US7375661B2/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5140621A (en) * | 1988-04-15 | 1992-08-18 | Thomson Csf | Method of encoding and decoding data in blocks, and encoding and decoding devices implementing this method |
US5706460A (en) * | 1991-03-19 | 1998-01-06 | The United States Of America As Represented By The Secretary Of The Navy | Variable architecture computer with vector parallel processor and using instructions with variable length fields |
US5828784A (en) * | 1992-07-13 | 1998-10-27 | Hitachi Denshi Kabushiki Kaisha | Data coding method and apparatus using a plurality of blocks of different length |
US5809306A (en) * | 1993-05-27 | 1998-09-15 | Matsushita Electric Industrial Co., Ltd. | Variable address length compiler and processor improved in address management |
US5479166A (en) * | 1993-11-30 | 1995-12-26 | Texas Instruments Incorporated | Huffman decoding method, circuit and system employing conditional subtraction for conversion of negative numbers |
US5512896A (en) * | 1993-11-30 | 1996-04-30 | Texas Instruments Incorporated | Huffman encoding method, circuit and system employing most significant bit change for size detection |
US5623423A (en) * | 1994-12-12 | 1997-04-22 | Univ. Of Texas | Apparatus and method for video decoding |
US5822558A (en) * | 1995-04-12 | 1998-10-13 | Advanced Micro Devices, Inc. | Method and apparatus for predecoding variable byte-length instructions within a superscalar microprocessor |
US6470376B1 (en) * | 1997-03-04 | 2002-10-22 | Matsushita Electric Industrial Co., Ltd | Processor capable of efficiently executing many asynchronous event tasks |
US20030088821A1 (en) * | 2000-08-31 | 2003-05-08 | Takashi Yokokawa | Interleaving apparatus |
US7180968B2 (en) * | 2000-08-31 | 2007-02-20 | Sony Corporation | Soft-output decoding |
US7197686B2 (en) * | 2002-10-11 | 2007-03-27 | Nvidia Corporation | Reconfigurable bit-manipulation node |
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030002743A1 (en) * | 2001-06-18 | 2003-01-02 | Ohta Ken-Ichi | Image processing method and apparatus, computer program, and storage medium |
US7106911B2 (en) | 2001-06-18 | 2006-09-12 | Canon Kabushiki Kaisha | Image processing apparatus and control method for inputting image data and encoding the data |
US20030043905A1 (en) * | 2001-08-29 | 2003-03-06 | Tadayoshi Nakayama | Image processing method and apparatus, computer program, and storage medium |
US7257264B2 (en) | 2001-08-29 | 2007-08-14 | Canon Kabushiki Kaisha | Image processing apparatus and method for compression-encoding image area information |
US20030118240A1 (en) * | 2001-12-25 | 2003-06-26 | Makoto Satoh | Image encoding apparatus and method, program, and storage medium |
US7106909B2 (en) | 2001-12-25 | 2006-09-12 | Canon Kabushiki Kaisha | Method and apparatus for encoding image data in accordance with a target data size |
US20030219164A1 (en) * | 2002-04-09 | 2003-11-27 | Cannon Kabushiki Kaisha | Entropy coding apparatus |
US7224844B2 (en) | 2002-04-09 | 2007-05-29 | Canon Kabushiki Kaisha | Entropy coding apparatus |
US20040017855A1 (en) * | 2002-05-29 | 2004-01-29 | Canon Kabushiki Kaisha | Variable-length encoding apparatus and method |
US7218677B2 (en) | 2002-05-29 | 2007-05-15 | Canon Kabushiki Kaisha | Variable-length encoding apparatus and method |
US7185264B2 (en) | 2002-08-20 | 2007-02-27 | Canon Kabushiki Kaisha | Image processing apparatus and method therefor |
US20040107399A1 (en) * | 2002-08-20 | 2004-06-03 | Canon Kabushiki Kaisha | Image processing apparatus and method therefor |
US20040196167A1 (en) * | 2003-04-01 | 2004-10-07 | Canon Kabushiki Kaisha | Variable-length decoding apparatus and method, computer program, and computer-readable storage medium |
US6937170B2 (en) | 2003-04-01 | 2005-08-30 | Canon Kabushiki Kaisha | Variable-length decoding apparatus and method, computer program, and computer-readable storage medium |
US20050180507A1 (en) * | 2004-02-04 | 2005-08-18 | Arul Thangaraj | System and method for providing data starting from start codes aligned with byte boundaries in multiple byte words |
US8023564B2 (en) * | 2004-02-04 | 2011-09-20 | Broadcom Corporaiton | System and method for providing data starting from start codes aligned with byte boundaries in multiple byte words |
US20070025630A1 (en) * | 2005-07-27 | 2007-02-01 | Sung Chih-Ta S | Method and apparatus of image compression |
US8018996B2 (en) * | 2007-04-20 | 2011-09-13 | Panasonic Corporation | Arithmetic decoding apparatus and method |
US20120099655A1 (en) * | 2009-04-17 | 2012-04-26 | Scalado Ab | Image encoder and method for encoding images |
US9066111B2 (en) * | 2009-04-17 | 2015-06-23 | Mobile Imaging In Sweden Ab | Image encoder and method for encoding images |
US20140169555A1 (en) * | 2011-03-25 | 2014-06-19 | Fujitsu Limited | Information processing apparatus, tampering detection apparatus, information processing method, tampering detection method, and computer product |
US9071420B2 (en) * | 2011-03-25 | 2015-06-30 | Fujitsu Limited | Information processing apparatus, tampering detection apparatus, information processing method, tampering detection method, and computer product |
CN105007490A (en) * | 2015-08-03 | 2015-10-28 | 深圳市哈工大交通电子技术有限公司 | OmapL138-chip-based Jpeg compression algorithm |
US20190349000A1 (en) * | 2017-11-30 | 2019-11-14 | International Business Machines Corporation | Run-length base-delta encoding for high-speed compression |
US11070230B2 (en) * | 2017-11-30 | 2021-07-20 | International Business Machines Corporation | Run-length base-delta encoding for high-speed compression |
Also Published As
Publication number | Publication date |
---|---|
JP2003174650A (en) | 2003-06-20 |
US7375661B2 (en) | 2008-05-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7375661B2 (en) | Image coding apparatus, variable-length coding apparatus, control apparatus and method therof | |
US6829299B1 (en) | Variable length decoder and decoding method | |
EP0665653B1 (en) | Apparatus and method for decoding variable-length code | |
CA2171927C (en) | Encoding apparatus for hierarchically encoding image signal and decoding apparatus for decoding the image signal hierarchically encoded by the encoding apparatus | |
US6219457B1 (en) | Method and system for decoding data encoded in a variable length code word | |
EP0589682B1 (en) | Variable length code decoder | |
US20070160149A1 (en) | Moving picture coding and/or decoding systems, and variable-length coding and/or decoding system | |
EP0613303A2 (en) | Image signal compression apparatus and method thereof | |
JPH0161278B2 (en) | ||
US6188793B1 (en) | Encoding apparatus, decoding apparatus, encoding method and decoding method | |
JPH1065549A (en) | Device for determining length of variable length encoded data value, device for decoding data stream of variable length encoded data value, and method for determining length of variable length encoded data value | |
JP4181887B2 (en) | Variable length coding apparatus and method | |
EP1075087A2 (en) | Variable length coding method and apparatus | |
US6744925B2 (en) | Encoding apparatus, decoding apparatus, encoding method, and decoding method | |
GB2333000A (en) | Finite state machine coding of information | |
Lakhani | Optimal Huffman coding of DCT blocks | |
JP3278948B2 (en) | Variable length coding method | |
JPH05115010A (en) | Picture decoder | |
CN110191341B (en) | Depth data coding method and decoding method | |
JPH08275168A (en) | Method and apparatus for run-length coding | |
JPH05227440A (en) | Device and method of coding data | |
JP2002026737A (en) | Data decoder and its method | |
US6775416B1 (en) | System and method for inserting information in DCT coefficient domain | |
KR0152035B1 (en) | Method and apparatus of variable length decode | |
US7185264B2 (en) | Image processing apparatus and method therefor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: CANON KABUSHIKI KAISHA, JAPAN Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:CHIBA, YUKIO;OTSUKA, KATSUMI;REEL/FRAME:013304/0478 Effective date: 20020909 |
|
STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
CC | Certificate of correction | ||
FPAY | Fee payment |
Year of fee payment: 4 |
|
FPAY | Fee payment |
Year of fee payment: 8 |
|
MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 12TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1553); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 12 |