JP2009175958A - Divider, dividing method, and image encoding device using divider - Google Patents

Divider, dividing method, and image encoding device using divider Download PDF

Info

Publication number
JP2009175958A
JP2009175958A JP2008012784A JP2008012784A JP2009175958A JP 2009175958 A JP2009175958 A JP 2009175958A JP 2008012784 A JP2008012784 A JP 2008012784A JP 2008012784 A JP2008012784 A JP 2008012784A JP 2009175958 A JP2009175958 A JP 2009175958A
Authority
JP
Japan
Prior art keywords
dividend
divisor
bit
bits
quotient
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.)
Pending
Application number
JP2008012784A
Other languages
Japanese (ja)
Inventor
Masahiko Mizoguchi
昌彦 溝口
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2008012784A priority Critical patent/JP2009175958A/en
Publication of JP2009175958A publication Critical patent/JP2009175958A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To quicken division arithmetic processing for quantization processing. <P>SOLUTION: Whether or not dividends of higher order bits than prescribed bits among dividends are smaller than divisors is compared and judged, and when it is judged that the dividends of the high order bits are smaller than the divisors, the quotient of bits corresponding to the high order bits among quotients is turned into zero, and the dividends of lower order bits than the prescribed bits are divided by the divisors, and the quotient of bits corresponding to the low order bits is calculated, so that it is possible to determine the quotient by dividing the dividends by the divisors. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、除算器、特に、画像符号化装置において実行される量子化処理のための除算演算を効率的に行なうことが可能な除算器に関する。   The present invention relates to a divider, and more particularly to a divider capable of efficiently performing a division operation for quantization processing executed in an image encoding device.

画像データの圧縮符号化方式であるJPEG(Joint Photographic Expert Group)やMPEG(Moving Picture Experts Group)による画像データの圧縮符号化では、二次元離散コサイン変換(二次元DCT)により得られたDCT係数を、量子化閾値で除算することにより、その商としての量子化係数を得る量子化処理が実行される。従って、画像データの圧縮符号化を実行する画像符号化装置には、量子化処理を実行する回路として除算演算を実行する除算器が備えられることになる。   In compression coding of image data by JPEG (Joint Photographic Expert Group) or MPEG (Moving Picture Experts Group) which are compression coding methods of image data, DCT coefficients obtained by two-dimensional discrete cosine transform (two-dimensional DCT) are used. Then, by dividing by the quantization threshold, a quantization process for obtaining a quantization coefficient as the quotient is executed. Therefore, an image encoding device that performs compression encoding of image data includes a divider that performs a division operation as a circuit that performs quantization processing.

ここで、除算演算を実行する除算器は、一般的に処理速度が遅いという問題がある。図8は、基本的な除算演算のアルゴリズムを示す説明図である。   Here, there is a problem that a divider that performs a division operation generally has a low processing speed. FIG. 8 is an explanatory diagram showing a basic algorithm for division operation.

まず、[N+1]ビットの被減数Mdの各ビットの値を“0”とするとともに、インデックスiの値を[M−1]とする(ステップS1010)。ここで、Mは被除数Ddのビット数を示し、Nは除数Dsのビット数を示す。   First, the value of each bit of the [N + 1] -bit reduced number Md is set to “0”, and the value of the index i is set to [M−1] (step S1010). Here, M indicates the number of bits of the dividend Dd, and N indicates the number of bits of the divisor Ds.

そして、被減数Mdに、インデックスiに対応するビットDd[i]の値を加算する(ステップS1020)。   Then, the value of the bit Dd [i] corresponding to the index i is added to the divisor Md (step S1020).

次に、被減数Mdが除数Ds以上の場合には(ステップS1030:YES)、被減数Mdから除数Dsを減算し(ステップS1040)、インデックスiに対応するビットの商Q[i]を“1”とする(ステップS1050)。一方、被減数Mdが除数Dsよりも小さい場合には(ステップS1030:NO)、商Q[i]を“0”とする(ステップS1060)。   Next, when the divisor Md is equal to or greater than the divisor Ds (step S1030: YES), the divisor Ds is subtracted from the divisor Md (step S1040), and the bit quotient Q [i] corresponding to the index i is set to “1”. (Step S1050). On the other hand, when the divisor Md is smaller than the divisor Ds (step S1030: NO), the quotient Q [i] is set to “0” (step S1060).

そして、インデックスiが“0”である場合には(ステップS1070:YES)、この除算演算を終了する。一方、インデックスiが“0”でない場合には(ステップS1070:NO)、インデックスiを“1”減算し(ステップS1080)、被減数Mdを1ビット左シフトして、最上位ビットの値を廃棄した値を新たな被減数Mdとした上で(ステップS1090)、ステップS1020に戻ってステップS1020〜ステップS1060の処理を実行する。すなわち、インデックスiが“0”となるまで、ステップS1020〜ステップS1090の処理を繰り返す。   If the index i is “0” (step S1070: YES), the division operation is terminated. On the other hand, if the index i is not “0” (step S1070: NO), the index i is decremented by “1” (step S1080), the subordinate Md is shifted left by 1 bit, and the value of the most significant bit is discarded. After setting the value as a new divisor Md (step S1090), the process returns to step S1020 to execute the processes of steps S1020 to S1060. That is, the processes in steps S1020 to S1090 are repeated until the index i becomes “0”.

以上のように、除算演算の基本的なアルゴリズムは、ステップS1020〜ステップS1090の処理を被除数の最上位ビット(i=[M−1])から最下位ビット(i=0)まで順に繰り返し実行することにより除算結果を得るものである。   As described above, the basic algorithm of the division operation repeatedly executes the processing in steps S1020 to S1090 in order from the most significant bit (i = [M−1]) to the least significant bit (i = 0) of the dividend. By doing so, the division result is obtained.

図9は、除算演算の基本的なアルゴリズムに従った除算器として、演算アルゴリズムにおける被除数Ddの各ビットについての処理を、基準クロックの1クロックの間に、1ビットの処理を実行する場合の構成を示すブロック図である。   FIG. 9 shows a configuration in which processing for each bit of the dividend Dd in the arithmetic algorithm is performed as a divider according to the basic algorithm of division operation, with one bit being processed during one clock of the reference clock. FIG.

この除算器1000は、Mビットの被除数Ddを記憶する被除数レジスタ101と、Nビットの除数Dsを記憶する除数レジスタ102と、Mビットの商Qを記憶する商レジスタ103と、を備える。また、除算器1000は、Mビットの被除数Dd[M−1:0]から1ビットの被除数Dd[i]を選択して出力するセレクタ104と、1ビットの被除数Dd[i]を被減数Mdの最下位ビットとして記憶する[N+1]ビットの被減数レジスタ105と、を備える。さらに、また、除算器1000は、[N+1]ビットの被減数MdからNビットの除数Dsを減算し、そのNビットの減算結果(剰余)を出力する減算器106と、被減数Mdが除数Ds以上であるか否か比較し、その1ビットの比較結果を出力する比較器107と、[N+1]ビットの被減数Mdを1ビット左シフトし、Nビットの被減数Mdを出力する左シフト回路108と、減算器106の出力と左シフト回路108の出力のいずれか一方を選択して出力するセレクタ109と、比較器107の1ビットの出力をMビットの商レジスタ103のいずれのビットに書き込むかを決定するセレクタ110と、セレクタ104およびセレクタ110の動作を制御する制御回路111と、を備える。なお、比較器107の出力は、セレクタ109の制御信号としてセレクタ109にも入力される。   The divider 1000 includes a dividend register 101 that stores an M-bit dividend Dd, a divisor register 102 that stores an N-bit divisor Ds, and a quotient register 103 that stores an M-bit quotient Q. The divider 1000 also selects and outputs a 1-bit dividend Dd [i] from the M-bit dividend Dd [M−1: 0], and outputs a 1-bit dividend Dd [i] to the divisor Md. [N + 1] -bit reduced register 105 that stores the least significant bit. Further, the divider 1000 subtracts the N-bit divisor Ds from the [N + 1] -bit divisor Md, and outputs the N-bit subtraction result (remainder). The subtractor Md is equal to or greater than the divisor Ds. A comparator 107 that compares whether or not there is, and outputs a 1-bit comparison result; a left shift circuit 108 that shifts the [N + 1] -bit divisor Md by 1 bit to the left and outputs an N-bit divisor Md; and subtraction The selector 109 that selects and outputs either the output of the comparator 106 or the output of the left shift circuit 108, and which bit of the M-bit quotient register 103 the 1-bit output of the comparator 107 is written to are determined. The selector 110 and the control circuit 111 that controls the operation of the selector 104 and the selector 110 are provided. Note that the output of the comparator 107 is also input to the selector 109 as a control signal of the selector 109.

セレクタ104および被除数レジスタ105によって、図8のステップS1020の処理、すなわち、被減数Mdに、インデックスiに対応するビットの被除数Dd[i]の値を加算する処理が実行される。   The selector 104 and the dividend register 105 execute the process of step S1020 in FIG. 8, that is, the process of adding the value of the dividend Dd [i] of the bit corresponding to the index i to the dividend Md.

減算器106、比較器107、および、セレクタ110によって、ステップS1030〜S1060の処理、すなわち、被減数Mdが除数Ds以上の場合には、被減数Mdら除数Dsを減算し、インデックスiに対応するビットの商Q[i]を“1”とし、被減数Mdが除数Dsよりも小さい場合には、商Q[i]を“0”とする、処理が実行される。   By the subtractor 106, the comparator 107, and the selector 110, the processing of steps S1030 to S1060, that is, when the dividend Md is equal to or larger than the divisor Ds, the divisor Ds is subtracted from the dividend Md, and the bit corresponding to the index i When the quotient Q [i] is set to “1” and the divisor Md is smaller than the divisor Ds, the quotient Q [i] is set to “0”.

制御回路111、左シフト回路108、および、セレクタ109によって、ステップS1070〜S1090の処理、すなわち、インデックスiを“1”減算し、被減数Mdを1ビット左シフトして、最上位ビットの値を廃棄した値を被減数Mdの上位Nビットの新たな値とする処理が実行される。   By the control circuit 111, the left shift circuit 108, and the selector 109, the processing of steps S1070 to S1090, that is, the index i is decremented by “1”, the subtracted Md is shifted left by 1 bit, and the value of the most significant bit is discarded. A process is performed in which the calculated value is used as a new value of the upper N bits of the subtracted Md.

図9のような構成とした場合には、被除数Ddのビット数Mに等しいクロック数に対応する時間が除算演算処理のために必要となる。例えば、被除数としてのDCT係数は11ビット(符号ナシ)で表され、除数としての量子化係数は8ビットで表されるが、基準クロックの1クロックで1ビットの処理を実行する場合には、11クロック分の時間が除算演算処理のために必要となる。   In the case of the configuration shown in FIG. 9, a time corresponding to the number of clocks equal to the number of bits M of the dividend Dd is required for the division calculation process. For example, a DCT coefficient as a dividend is represented by 11 bits (sign pear), and a quantization coefficient as a divisor is represented by 8 bits. However, when 1-bit processing is performed with 1 reference clock, The time for 11 clocks is required for the division calculation process.

また、図10は、除算演算の基本的なアルゴリズムに従った除算器として、演算アルゴリズムにおける被除数Ddの各ビットについての処理を、基準クロックの1クロックの間に、3ビットの処理を実行する場合の構成を示すブロック図である。   FIG. 10 shows a case where the processing for each bit of the dividend Dd in the arithmetic algorithm is performed as a divider according to the basic algorithm of the division operation, and the processing of 3 bits is performed during one clock of the reference clock. It is a block diagram which shows the structure of these.

この除算器1000Aは、基準クロックの1クロックの間に3ビットの処理を実行するために、図9の除算器1000の減算器106、比較器107、左シフト回路108、および、セレクタ109に換えて、3ビット分の減算器106a〜106c、比較器107a〜107c、左シフト回路108a〜108c、および、セレクタ109a〜109cを3段に備える構成としたものである。また、この構成に対応するために、除算器1000のセレクタ104およびセレクタ110に換えて、Mビットの被除数Dd[M−1:0]から3ビットの被除数Dd[i],Dd[i−1],Dd[i−2]を選択し、減算器106a,106b,106cに入力する[N+1]ビットの被減数Mdのうちの最下位ビットとして出力するセレクタ104Aと、比較器107a〜107cの出力をMビットの商レジスタ103のいずれの3ビットに書き込むかを決定するセレクタ110Aと、を備える。さらに、制御回路111に換えて、セレクタ104Aおよびセレクタ110Aの動作を制御する制御回路111Aを備える。   The divider 1000A replaces the subtractor 106, the comparator 107, the left shift circuit 108, and the selector 109 of the divider 1000 shown in FIG. 9 in order to execute 3-bit processing during one clock of the reference clock. Thus, subtracters 106a to 106c for three bits, comparators 107a to 107c, left shift circuits 108a to 108c, and selectors 109a to 109c are provided in three stages. In order to correspond to this configuration, instead of the selector 104 and the selector 110 of the divider 1000, the M-bit dividend Dd [M-1: 0] to the 3-bit dividends Dd [i] and Dd [i-1 ], Dd [i-2], the selector 104A that outputs as the least significant bit of the [N + 1] -bit divisor Md that is input to the subtractors 106a, 106b, and 106c, and the outputs of the comparators 107a to 107c. And a selector 110A that determines which of the 3 bits of the M-bit quotient register 103 is to be written. Further, instead of the control circuit 111, a control circuit 111A for controlling the operation of the selector 104A and the selector 110A is provided.

図10のような構成とした場合には、図9の構成の場合に比べて、除算演算処理の時間は短くなる。例えば、11ビットのDCT係数を被除数とし、8ビットの量子化係数を除数とする場合、基準クロックの4クロック分の時間で除算演算処理が実行される。しかしながら、一度に処理できるビット数は回路の動作速度や回路を構成する半導体プロセスの種類等に依存するため、まとめて実行可能なビット数には制限がある。また、まとめて実行するビット数が増えるほど、回路規模もそれに比例して増大することになる。   When the configuration shown in FIG. 10 is used, the time required for the division calculation process is shorter than that in the configuration shown in FIG. For example, when an 11-bit DCT coefficient is used as a dividend and an 8-bit quantization coefficient is used as a divisor, the division calculation process is executed in a time corresponding to 4 clocks of the reference clock. However, since the number of bits that can be processed at one time depends on the operation speed of the circuit, the type of semiconductor process that constitutes the circuit, and the like, the number of bits that can be executed collectively is limited. Further, as the number of bits to be executed collectively increases, the circuit scale increases proportionally.

また、一連の処理をパイプライン処理化することで除算器のスループットを向上させることも可能であるが、この場合にも、やはりパイプライン段数分の演算処理回路が増加し、加えてパイプライン・レジスタも必要となるため、回路規模が増加する。   In addition, it is possible to improve the throughput of the divider by pipelining a series of processing, but in this case as well, the number of processing circuits for the number of pipeline stages is increased, and in addition, pipeline processing Since a register is also required, the circuit scale increases.

以上のような問題を解決する除算演算の手法を用いた除算器として、例えば、特許文献1,2に記載の例が提案されている。これらの除算演算の手法は、被除数としてのDCT係数と除数としての量子化閾値とを比較する。そして、DCT係数よりも量子化閾値の方が大きい場合には、被減数から除数を減算する処理を繰り返すことによって実行される除算演算処理を行なわずに、量子化係数としての商を“0”に設定することによって、除算演算処理に必要なクロック数を低減し、全体としての演算処理時間の高速化を図るものである。   As a divider using a division calculation method for solving the above problems, for example, examples described in Patent Documents 1 and 2 have been proposed. These division calculation methods compare a DCT coefficient as a dividend and a quantization threshold as a divisor. If the quantization threshold is larger than the DCT coefficient, the quotient as the quantization coefficient is set to “0” without performing the division operation process executed by repeating the process of subtracting the divisor from the divisor. By setting, the number of clocks required for division calculation processing is reduced, and the overall calculation processing time is increased.

しかしながら、上記除算演算の手法を用いた除算器では、被除数としてのDCT係数が除数としての量子化閾値よりも大きい場合には、結局、被除数としてのDCT係数の各ビットについて最上位ビットから最下位ビットまで順に、ステップS1020〜ステップS1090のような処理を繰り返すことになり、除算演算処理時間の短縮化を図ることができず、全体としての演算処理時間の高速化が不十分であった。   However, in the divider using the above division operation method, when the DCT coefficient as the dividend is larger than the quantization threshold as the divisor, the most significant bit to the least significant bit is eventually obtained for each bit of the DCT coefficient as the dividend. Processing such as step S1020 to step S1090 is repeated in order up to the bit, so that the division operation processing time cannot be shortened, and the speed of the operation processing time as a whole is insufficient.

特開平10−191334号公報JP-A-10-191334 特開平3−85871号公報Japanese Patent Laid-Open No. 3-85871

本発明は、上記課題を解決するためになされたものであり、量子化処理のための除算演算処理の高速化を図ることが可能な技術を提供することを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to provide a technique capable of increasing the speed of division operation processing for quantization processing.

本発明は、上述の課題の少なくとも一部を解決するためになされたものであり、以下の形態又は適用例として実現することが可能である。   SUMMARY An advantage of some aspects of the invention is to solve at least a part of the problems described above, and the invention can be implemented as the following forms or application examples.

[適用例1]
被除数を除数で除算した商を求める除算器であって、
被除数を除数で除算した商を求める除算器であって、
演算手段と、
前記被除数のうち所定ビットよりも上位ビットの前記被除数が、前記除数よりも小さいか否か比較判定するための被除数部分比較手段と、
前記上位ビットの被除数が前記除数よりも小さい場合には、前記商のうち前記上位ビットに対応するビットの商をゼロとするとともに、前記所定ビット以下の下位ビットの前記被除数を前記除数で除算して、前記下位ビットに対応するビットの商を求めることにより、前記被除数を前記除数で除算した商を求めるように、前記演算手段を制御する制御手段と、
を備えることを特徴とする除算器。
[Application Example 1]
A divider for obtaining a quotient obtained by dividing a dividend by a divisor,
A divider for obtaining a quotient obtained by dividing a dividend by a divisor,
Computing means;
A dividend partial comparison means for comparing and determining whether or not the dividend of the higher-order bits of the dividend is smaller than the divisor;
When the dividend of the upper bits is smaller than the divisor, the quotient of the bits corresponding to the upper bits of the quotient is set to zero, and the dividend of the lower bits below the predetermined bit is divided by the divisor. Control means for controlling the computing means so as to obtain a quotient obtained by dividing the dividend by the divisor by obtaining a quotient of a bit corresponding to the lower bit;
A divider comprising:

適用例1記載の除算器では、被除数のうち所定ビットよりも上位ビットの被除数が、除数よりも小さいか否か比較判定し、所定ビットよりも上位ビットの被除数が除数よりも小さい場合には、上位ビットの被除数に対応するビットの商をゼロとするとともに、所定ビット以下の被除数を除数で除算して、所定ビット以下の下位ビットの被除数に対応するビットの商を求めるので、除算を行なう被除数のビットを限定して、除算演算処理に要する時間を短縮化することができるので、除算演算処理の高速化を図ることが可能である。   In the divider described in the application example 1, it is determined whether or not the dividend of the higher bits than the predetermined bit among the dividend is smaller than the divisor, and when the dividend of the higher bits than the predetermined bit is smaller than the divisor, The quotient of the bit corresponding to the dividend of the upper bits is set to zero and the quotient of the bits corresponding to the dividend of the lower bits less than or equal to the predetermined bits is divided by the divisor to obtain the quotient of the bits corresponding to the lower bits of the bits or less. By limiting the number of bits, it is possible to shorten the time required for the division operation processing, so that the division operation processing can be speeded up.

[適用例2]
適用例1記載の除算器であって、
前記所定ビットの大きさが順に異なる複数の被除数部分比較手段を備え、
前記制御手段は、複数の前記所定ビットのうち第1の所定ビットよりも上位ビットの被除数が前記除数よりも大きく、前記第1の所定ビットの次に大きい第2の所定ビットよりも上位ビットの被除数が前記除数よりも小さい場合には、前記商のうち前記第2の所定ビットよりも上位ビットに対応するビットの商をゼロとするとともに、前記第2の所定ビット以下の下位ビットの被除数を前記除数で除算して、前記第2の所定ビット以下の下位ビットに対応するビットの商を求めることにより、前記被除数を前記除数で除算した商を求めるように、前記演算手段を制御する
ことを特徴とする除算器。
[Application Example 2]
A divider according to application example 1,
A plurality of dividend portion comparison means having different predetermined bit sizes,
The control means has a dividend of higher bits than a second predetermined bit larger than the divisor in which a dividend of higher bits than a first predetermined bit among the plurality of predetermined bits is larger than the divisor. If the dividend is smaller than the divisor, the quotient of the bit corresponding to the higher-order bit than the second predetermined bit in the quotient is set to zero, and the lower-bit dividend of the second predetermined bit or less is set as zero. Dividing the divisor to obtain a quotient of bits corresponding to lower bits less than or equal to the second predetermined bit, thereby controlling the computing means to obtain a quotient obtained by dividing the dividend by the divisor. Characteristic divider.

適用例2の除算器では、複数の所定ビットのうち第1の所定ビットよりも上位ビットの被除数が除数よりも大きく、第1の所定ビットの次に大きい第2の所定ビットよりも上位ビットの被除数が除数よりも小さい場合には、第2の所定ビットよりも上位ビットに対応するビットの商をゼロとするとともに、第2の所定ビット以下の下位ビットの被除数を除数で除算して、第2の所定ビット以下の下位ビットの被除数に対応するビットの商を求めるので、除算を行なう被除数のビットを第1の所定ビットだけでなく第2の所定ビットでも限定して、除算演算処理に要する時間を短縮化することができるので、除算演算処理の高速化をさらに図ることが可能である。   In the divider of Application Example 2, the dividend of the higher bits than the first predetermined bit among the plurality of predetermined bits is larger than the divisor and is higher than the second predetermined bit next to the first predetermined bit. When the dividend is smaller than the divisor, the quotient of the bit corresponding to the upper bits than the second predetermined bit is set to zero, and the dividend of the lower bits equal to or lower than the second predetermined bit is divided by the divisor, Since the quotient of the bit corresponding to the dividend of the lower bits equal to or less than 2 predetermined bits is obtained, the bit of the dividend to be divided is limited to not only the first predetermined bit but also the second predetermined bit, which is required for the division operation processing Since the time can be shortened, it is possible to further speed up the division operation processing.

[適用例3]
適用例1または適用例2記載の除算器であって、
さらに、前記被除数が前記除数よりも小さいか否か比較判定するための被除数全体比較手段を備え、
前記制御手段は、前記被除数が前記除数よりも小さい場合には、各ビットの商をゼロとすることにより、前記被除数を前記除数で除算した商を求めるように制御する
ことを特徴とする除算器。
[Application Example 3]
A divider according to application example 1 or application example 2,
Furthermore, it comprises a whole dividend comparison means for comparing and determining whether or not the dividend is smaller than the divisor,
When the dividend is smaller than the divisor, the control means controls to obtain a quotient obtained by dividing the dividend by the divisor by setting a quotient of each bit to zero. .

適用例3記載の除算器では、被除数が除数よりも小さいか否か比較判定し、被除数が除数よりも小さい場合には、各ビットの商をゼロとすることにより、被除数を除数で除算した商を求めて、実際に被除数を除数で除算する処理を省略することができるので、さらに、除算演算処理に要する時間を短縮化し、除算演算処理の高速化を図ることが可能である。   In the divider described in Application Example 3, whether the dividend is smaller than the divisor is compared and determined. If the dividend is smaller than the divisor, the quotient obtained by dividing the dividend by the divisor is set to zero for each bit. Therefore, it is possible to omit the process of actually dividing the dividend by the divisor, thereby further shortening the time required for the division operation process and speeding up the division operation process.

[適用例4]
適用例1ないし適用例4のいずれかに記載の除算器であって、
前記被除数は画像データを離散コサイン変換したDCT係数であり、
前記除数は所定の量子化閾値であり、
前記所定ビットは、前記DCT係数を前記量子化閾値で除算することにより得られる商としての量子化係数の特性に基づいて決定される
ことを特徴とする除算器。
[Application Example 4]
A divider according to any one of Application Example 1 to Application Example 4,
The dividend is a DCT coefficient obtained by discrete cosine transform of image data,
The divisor is a predetermined quantization threshold;
The divider is characterized in that the predetermined bit is determined based on a characteristic of a quantization coefficient as a quotient obtained by dividing the DCT coefficient by the quantization threshold.

適用例4に記載の除算器では、被除数としてのDCT係数を除数としての量子化閾値で除算して、その商としての量子化係数を得る除算演算処理としての量子化処理に要する時間を短縮化し、量子化処理の高速化を図ることが可能である。   In the divider described in Application Example 4, the DCT coefficient as the dividend is divided by the quantization threshold value as the divisor, and the time required for the quantization process as the division operation process to obtain the quantized coefficient as the quotient is shortened. It is possible to speed up the quantization process.

[適用例5]
適用例4記載の除算器を備え、
前記除算器に、前記被除数として前記DCT係数を入力し、前記除数として前記量子化閾値を入力することにより、前記DCT係数を前記量子化閾値で除算して求められる商を前記量子化係数として得ることを特徴とする画像符号化装置。
[Application Example 5]
A divider according to Application Example 4;
The quotient obtained by dividing the DCT coefficient by the quantization threshold is obtained as the quantization coefficient by inputting the DCT coefficient as the dividend and inputting the quantization threshold as the divisor to the divider. An image encoding apparatus characterized by that.

適用例5に記載の画像符号化装置では、適用例4と同様の効果を奏することができる。   The image coding device described in Application Example 5 can achieve the same effects as Application Example 4.

[適用例6]
被除数を除数で除算した商を求める除算方法であって、
前記被除数のうち所定ビットよりも上位ビットの前記被除数が、前記除数よりも小さいか否か比較判定し、
前記上位ビットの被除数が前記除数よりも小さい場合には、前記商のうち前記上位ビットに対応するビットの商をゼロとするとともに、前記所定ビット以下の下位ビットの前記被除数を前記除数で除算して、前記下位ビットに対応するビットの商を求めることにより、前記被除数を前記除数で除算した商を求める、
ことを特徴とする除算方法。
[Application Example 6]
A division method for obtaining a quotient obtained by dividing a dividend by a divisor,
A determination is made as to whether or not the dividend of the higher-order bits of the dividend is smaller than the divisor,
When the dividend of the upper bits is smaller than the divisor, the quotient of the bits corresponding to the upper bits of the quotient is set to zero, and the dividend of the lower bits below the predetermined bit is divided by the divisor. Obtaining a quotient obtained by dividing the dividend by the divisor by obtaining a quotient of a bit corresponding to the lower bit.
A division method characterized by that.

適用例6に記載の除算方法によれば、適用例1と同様の効果を奏することができる。   According to the division method described in Application Example 6, the same effects as in Application Example 1 can be obtained.

A.画像符号化装置の構成:
B.第1実施例の除算器の構成:
B1.除算アルゴリズム:
B2.除算器の具体例:
C.第2実施例の除算器の構成:
C1.除算アルゴリズム:
C2.除算器の具体例:
D.変形例:
A. Configuration of image encoding device:
B. Configuration of the divider of the first embodiment:
B1. Division algorithm:
B2. Specific examples of dividers:
C. Configuration of the divider of the second embodiment:
C1. Division algorithm:
C2. Specific examples of dividers:
D. Variations:

A.画像符号化装置の構成:
図1は、本発明の除算器を量子化部に適用した画像符号化装置の構成を示すブロック図である。図2は、画像符号化装置で実行される量子化処理について示す説明図である。
A. Configuration of image encoding device:
FIG. 1 is a block diagram showing a configuration of an image encoding apparatus in which a divider according to the present invention is applied to a quantization unit. FIG. 2 is an explanatory diagram illustrating quantization processing executed by the image encoding device.

画像符号化装置10は、DCT部20と、量子化部30と、量子化テーブル40と、ハフマン符号化部50と、ハフマンテーブル60と、を備える。   The image encoding device 10 includes a DCT unit 20, a quantization unit 30, a quantization table 40, a Huffman encoding unit 50, and a Huffman table 60.

DCT部20は、図2(A)に示すような[8×8]画素のブロックに分割された各画像について、二次元離散コサイン変換を行なって、図2(B)に示すようなDCT係数を得る機能ブロックである。   The DCT unit 20 performs a two-dimensional discrete cosine transform on each image divided into blocks of [8 × 8] pixels as shown in FIG. 2 (A) to obtain DCT coefficients as shown in FIG. 2 (B). Is a functional block to obtain

量子化部30は、図2(C)に示すような量子化テーブル40に格納されている量子化閾値で各ブロックのDCT係数を除算することにより、図2(D)に示すように、その商としての量子化係数を得る機能ブロックである。   The quantization unit 30 divides the DCT coefficient of each block by the quantization threshold value stored in the quantization table 40 as shown in FIG. 2 (C), as shown in FIG. 2 (D). It is a functional block for obtaining a quantized coefficient as a quotient.

得られた量子化係数は、図2(D)に示すように、番号Q1〜Q64で表される量子化係数の走査順に取り出され、ハフマン符号化部50に入力される。   The obtained quantized coefficients are taken out in the scanning order of the quantized coefficients represented by the numbers Q1 to Q64 and input to the Huffman encoder 50 as shown in FIG.

ハフマン符号化部50は、入力された量子化係数をハフマンテーブル60に従って符号化する機能ブロックである。   The Huffman encoder 50 is a functional block that encodes the input quantization coefficient according to the Huffman table 60.

以上のように、画像符号化装置10は、画像を表す画像データをDCT部20でDCT係数に変換し、除算器を用いた量子化部30で、得られたDCT係数を量子化閾値で除算処理することにより量子化し、得られた量子化係数をハフマン符号化部50で符号化することにより、画像データの表す画像を符号化した符号データを生成する装置である。   As described above, the image encoding device 10 converts image data representing an image into DCT coefficients by the DCT unit 20, and divides the obtained DCT coefficients by the quantization threshold in the quantization unit 30 using a divider. It is an apparatus that generates code data obtained by encoding an image represented by image data by performing quantization by processing and encoding the obtained quantized coefficient by a Huffman encoding unit 50.

B.第1実施例の除算器の構成:
以下では、画像符号化装置10の量子化部30に用いられる第1実施例としての除算器について説明する。
B. Configuration of the divider of the first embodiment:
Below, the divider | division as a 1st Example used for the quantization part 30 of the image coding apparatus 10 is demonstrated.

B1.除算アルゴリズム:
一般的に、自然画像は高周波成分をあまり含んでいないため、画像データをDCT変換することにより得られたDCT係数のうち、高周波成分のDCT係数については除去したとしても、画質の劣化は少ないと考えられる。
B1. Division algorithm:
In general, since a natural image does not contain much high-frequency components, even if the DCT coefficients of high-frequency components are removed from the DCT coefficients obtained by DCT conversion of image data, there is little deterioration in image quality. Conceivable.

そこで、画像符号化装置10の量子化テーブル40としては、通常、量子化部30の除算演算による量子化処理において、低周波成分を残し、高周波成分を除去するように、低周波成分に対応する量子化閾値は小さく、高周波成分に対応する量子化閾値は大きい値に設定されたものが用いられる。   Therefore, the quantization table 40 of the image encoding device 10 usually corresponds to the low frequency component so that the low frequency component is left and the high frequency component is removed in the quantization processing by the division operation of the quantization unit 30. The quantization threshold is small, and the quantization threshold corresponding to the high frequency component is set to a large value.

従って、このような自然画像の性質により、量子化部30における量子化処理としての除算演算で求められる商としての量子化係数の値には、以下のような偏りが認められる。   Therefore, due to the nature of such a natural image, the following bias is recognized in the value of the quantization coefficient as the quotient obtained by the division operation as the quantization process in the quantization unit 30.

JPEG方式による画像圧縮符号化処理の場合には、量子化処理として、[DCT係数(符号ナシ11ビット)÷量子化閾値(符号ナシ8ビット)]で表される除算演算が実行され、その商としての量子化係数(符号ナシ11ビット)は、[0x000]〜[0x7FF]の範囲となる。   In the case of JPEG image compression coding processing, as a quantization processing, a division operation represented by [DCT coefficient (code no 11 bits) ÷ quantization threshold (code no 8 bits)] is executed, and the quotient thereof. The quantized coefficient (sign pear 11 bits) is in the range of [0x000] to [0x7FF].

ここで、実際の自然画像、例えば、デジタルカメラで撮像した5Mピクセルの写真を、高品質モードでJPEG方式による画像圧縮符号化処理を実行した場合において、量子化処理としての除算演算の商である量子化係数は、「0x000」が65〜80%、[0x001]〜[0x007](3ビット以下の値)が15〜30%、[0x008]〜[0x03F](6ビット以下の値)が3〜6%、[0x040]〜[0x1FF](9ビット以下の値)が0.3〜0.6%、[0x200]〜[0x7FF](11ビット以下の値)が0%であった。すなわち、[0x000]が全体の半数以上を占めており、3ビット以下の値を含めると全体の90%以上を占めていることがわかった。   Here, when an actual natural image, for example, a 5M pixel photograph taken with a digital camera, is subjected to JPEG image compression encoding processing in the high quality mode, it is a quotient of division operation as quantization processing. As for the quantization coefficient, “0x000” is 65 to 80%, [0x001] to [0x007] (value of 3 bits or less) is 15 to 30%, and [0x008] to [0x03F] (value of 6 bits or less) is 3. -6%, [0x040]-[0x1FF] (value of 9 bits or less) was 0.3-0.6%, and [0x200]-[0x7FF] (value of 11 bits or less) were 0%. That is, it was found that [0x000] accounted for more than half of the whole, and if a value of 3 bits or less was included, it accounted for 90% or more of the total.

そこで、以上の点に着目すると、以下で説明するように、除算演算処理の高速化を図ることが可能であると考えられる。   Therefore, focusing on the above points, it is considered possible to increase the speed of the division calculation process as described below.

[1]量子化係数が[0x000]であることは、DCT係数(被除数)が量子化閾値(除数)よりも小さいことを示している。そこで、従来例でも説明したように、DCT係数と量子化閾値とを比較し、DCT係数<量子化閾値である場合には、除算演算の商としての量子化係数を[0x000]として、従来アルゴリズムで説明したDCT係数(被除数)のビットごとに実行する減算処理(図8のステップS1020〜S1090の処理参照)を省略する。これにより、例えば、上記実際の自然画像の量子化処理としての除算演算処理のうち、65〜80%の除算演算処理における処理時間の短縮化を図ることができ、全体として除算演算処理の高速化を図ることができる。 [1] A quantization coefficient of [0x000] indicates that the DCT coefficient (dividend) is smaller than the quantization threshold (divisor). Therefore, as described in the conventional example, the DCT coefficient is compared with the quantization threshold, and when DCT coefficient <quantization threshold, the quantization coefficient as the quotient of the division operation is set to [0x000] and the conventional algorithm is used. The subtraction process (see the processes in steps S1020 to S1090 in FIG. 8) executed for each bit of the DCT coefficient (dividend) described in the above is omitted. Thereby, for example, among the division calculation processing as the actual natural image quantization processing, the processing time in the division calculation processing of 65 to 80% can be shortened, and the speed of the division calculation processing as a whole is increased. Can be achieved.

[2]量子化係数が[0x001]〜[0x007]の3ビットで表される値であることは、11ビットのDCT係数(被除数)のうちの4ビット目〜11ビット目までで表される数(11ビットのDCT係数を3ビット右シフトした数)が量子化閾値(除数)よりも小さいことを示している。そこで、11ビットのDCT係数のうちの4ビット目〜11ビット目までで表される数が量子化閾値より小さい場合には、量子化係数のうち4ビット目〜11ビット目の各ビットの値を“0”とし、3ビット目〜1ビット目の各ビットについてのみ除算処理を行なうことにより、11ビット目〜4ビット目のビットごとに実行する減算処理(図8のステップS1020〜S1090の処理参照)を省略する。これにより、例えば、上記実際の自然画像の量子化処理としての除算演算処理のうち、15〜30%の除算演算処理における処理時間の短縮化を図ることができ、全体として除算演算処理の高速化を図ることができる。 [2] That the quantization coefficient is a value represented by 3 bits from [0x001] to [0x007] is represented by the 4th to 11th bits of the 11-bit DCT coefficient (dividend). The number (the number obtained by shifting the 11-bit DCT coefficient to the right by 3 bits) is smaller than the quantization threshold (divisor). Therefore, when the number represented by the 4th to 11th bits of the 11-bit DCT coefficient is smaller than the quantization threshold, the value of each bit of the 4th to 11th bits of the quantization coefficient. Is set to “0”, and the subtraction process executed for each of the 11th to 4th bits is performed by performing the division process only for each of the 3rd to 1st bits (the processes of steps S1020 to S1090 in FIG. 8). Reference) is omitted. Accordingly, for example, among the division calculation processing as the actual natural image quantization processing, the processing time in the division calculation processing of 15 to 30% can be shortened, and the division calculation processing is accelerated as a whole. Can be achieved.

以上のように、除算演算の商としての量子化係数がKビット(Kは除数のビット数よりも小さい)の範囲内であることは、被除数としてのDCT係数の[K+1]ビット目以上の値(被除数としてのDCT係数をKビット右シフトした数)と、除数としての量子化閾値と、を比較することにより判定可能であり、この比較結果を用いて減算処理を開始するビット位置を限定することができる。これにより、除算演算処理の高速化が可能となる。   As described above, the fact that the quantization coefficient as the quotient of the division operation is in the range of K bits (K is smaller than the number of bits of the divisor) indicates that the value is not less than the [K + 1] -th bit of the DCT coefficient as the dividend. This can be determined by comparing (the number obtained by shifting the DCT coefficient as the dividend to the right by K bits) and the quantization threshold as the divisor, and the bit position at which the subtraction process is started is limited using the comparison result. be able to. This makes it possible to speed up the division operation process.

図3は、第1実施例としての除算演算のアルゴリズムを示す説明図である。なお、以下の説明では、Mビットの被除数Ddとして11ビット(符号ナシ)のDCT係数を、Nビットの除数Dsとして8ビットの量子化係数を例示する。   FIG. 3 is an explanatory diagram showing an algorithm of division operation as the first embodiment. In the following description, an 11-bit (sign-less) DCT coefficient is exemplified as the M-bit dividend Dd, and an 8-bit quantization coefficient is exemplified as the N-bit divisor Ds.

まず、Mビット(=11ビット)の被除数DdがNビット(=8ビット)の除数Dsよりも小さい場合には(ステップS101:NO)、Mビット(=11ビット)の商Q[M−1]〜Q[0]の各ビットの値を“0”とし(ステップS102)、この除算演算を終了する。一方、被除数Ddが除数Ds以上である場合には(ステップS101:YES)、さらに、被除数DdのKビット目(K<N)よりも上位ビットの被除数Dd[M−1:K]が除数Ds以上であるか否かに応じて(ステップS103)、次の処理を実行する。なお、ここでは、Kを“3”として例示する。   First, when the dividend Dd of M bits (= 11 bits) is smaller than the divisor Ds of N bits (= 8 bits) (step S101: NO), the quotient Q [M−1 of M bits (= 11 bits) ] To Q [0] are set to “0” (step S102), and the division operation is terminated. On the other hand, when the dividend Dd is greater than or equal to the divisor Ds (step S101: YES), the dividend Dd [M−1: K] of the higher bits than the K-th bit (K <N) of the dividend Dd is also the divisor Ds. Depending on whether or not this is the case (step S103), the following processing is executed. Here, K is exemplified as “3”.

被除数DdのKビット(=3ビット)目よりも上位ビットの被除数Dd[M−1:K](=Dd[10:3])が除数Ds以上である場合には(ステップS103:YES)、[N+1]ビット(=9ビット)の被減数Mdの各ビットの値を“0”とし、インデックスiの値を[M−1](=10)とし(ステップS104)、さらに、被減数Mdに、インデックスiに対応するビットDd[i]の値を加算する(ステップS105)。一方、被除数DdのKビット(=3ビット)目よりも上位ビットの被除数Dd[M−1:K](=Dd[10:3])が除数Dsよりも小さい場合には(ステップS103:NO)、被除数Dd[M−1:K−1](=Dd[10:2])を被減数Mdとし、インデックスiの値を[K−1](=2)とするとともに、商QのKビット(=3ビット)目よりも上位ビットの商Q[M−1]〜Q[K]の各ビットの値を“0”とする(ステップS106)。   When the dividend Dd [M−1: K] (= Dd [10: 3]) of the higher bits than the K bit (= 3 bit) of the dividend Dd is equal to or greater than the divisor Ds (step S103: YES). The value of each bit of the reduced number Md of [N + 1] bits (= 9 bits) is set to “0”, the value of the index i is set to [M−1] (= 10) (step S104), and the index Md is assigned an index. The value of bit Dd [i] corresponding to i is added (step S105). On the other hand, when the dividend Dd [M−1: K] (= Dd [10: 3]) of the higher bits than the K bit (= 3 bits) of the dividend Dd is smaller than the divisor Ds (step S103: NO). ), The dividend Dd [M-1: K-1] (= Dd [10: 2]) is the dividend Md, the value of the index i is [K-1] (= 2), and K bits of the quotient Q The value of each bit of the quotients Q [M−1] to Q [K], which are higher bits than (= 3 bits), is set to “0” (step S106).

次に、被減数Mdが除数Ds以上の場合には(ステップS107:YES)、被減数Mdから除数Dsを減算し(ステップS108)、インデックスiに対応するビットの商Q[i]を“1”とする(ステップS109)。一方、被減数Mdが除数Dsよりも小さい場合には(ステップS107:NO)、商Q[i]を“0”とする(ステップS110)。   Next, when the dividend Md is equal to or larger than the divisor Ds (step S107: YES), the divisor Ds is subtracted from the dividend Md (step S108), and the bit quotient Q [i] corresponding to the index i is set to “1”. (Step S109). On the other hand, when the divisor Md is smaller than the divisor Ds (step S107: NO), the quotient Q [i] is set to “0” (step S110).

そして、インデックスiが“0”である場合には(ステップS111:YES)、この除算演算を終了する。一方、インデックスiが“0”でない場合には(ステップS111:NO)、インデックスiを“1”減算し(ステップS112)、被減数Mdを1ビット左シフトして、最上位ビットの値を廃棄した値を新たな被減数Mdとした上で(ステップS113)、ステップS105に戻ってステップS105〜ステップS110の処理を実行する。すなわち、インデックスiが“0”となるまで、ステップS105〜ステップS113の処理を繰り返す。なお、このステップS105〜ステップS107の処理は、図8に示した基本的な除算演算のアルゴリズムにおけるステップS1020〜ステップS1090の処理と同じである。   When the index i is “0” (step S111: YES), this division operation is terminated. On the other hand, if the index i is not “0” (step S111: NO), the index i is decremented by “1” (step S112), the subtracted Md is shifted left by 1 bit, and the value of the most significant bit is discarded. After setting the value to a new divisor Md (step S113), the process returns to step S105 to execute the processes of steps S105 to S110. That is, the processes in steps S105 to S113 are repeated until the index i becomes “0”. Note that the processing from step S105 to step S107 is the same as the processing from step S1020 to step S1090 in the basic division calculation algorithm shown in FIG.

以上のように、本実施例のアルゴリズムでは、第1に、被除数Ddが除数Ds以上である場合には、Mビットの商Q[M−1]〜Q[0](=Q[10]〜Q[0])の各ビットの値を“0”とすることにより除算結果を得るものである。第2に、Kビット(=3ビット)目より上位ビットの被除数Dd[M−1:K](=Dd[10:3])が除数Dsより小さい場合には、Kビット目よりも上位ビットの商Q[M−1]〜Q[K]の各ビットの値を“0”とし、ステップS105〜ステップS113の処理を被除数のKビット目(i=[K−1]=2)から最下位ビット(i=0)まで順に繰り返し実行することにより除算結果を得るものである。第3に、Kビット(=3ビット)目より上位ビットの被除数Dd[M−1:K](=Dd[10:3])が除数Ds以上である場合には、ステップS105〜ステップS113の処理を被除数の最上位ビット(i=[M−1])から最下位ビット(i=0)まで順に繰り返し実行することにより除算結果を得るものである。従って、被除数Ddが除数Dsよりも小さい場合には、ステップS105〜ステップS113の処理を省略することができる。また、Kビット(=3ビット)目より上位ビットの被除数Dd[M−1:K](=Dd[10:3])が除数Dsより小さい場合には、ステップS105〜ステップS113の処理の繰り返し回数をK回(=3回)に限定することができる。   As described above, according to the algorithm of the present embodiment, first, when the dividend Dd is equal to or larger than the divisor Ds, M-bit quotients Q [M−1] to Q [0] (= Q [10] to The division result is obtained by setting the value of each bit of Q [0]) to “0”. Second, if the dividend Dd [M−1: K] (= Dd [10: 3]) of the higher bits than the K bit (= 3 bits) is smaller than the divisor Ds, the higher bits than the K bit The value of each bit of the quotients Q [M−1] to Q [K] is set to “0”, and the processing in steps S105 to S113 is performed from the Kth bit (i = [K−1] = 2) of the dividend. The division result is obtained by repeatedly executing in order up to the lower bit (i = 0). Third, when the dividend Dd [M−1: K] (= Dd [10: 3]) of the higher bits from the K-th bit (= 3 bits) is equal to or greater than the divisor Ds, the process proceeds from step S105 to step S113. The division result is obtained by repeatedly executing the processing in order from the most significant bit (i = [M−1]) to the least significant bit (i = 0) of the dividend. Therefore, when the dividend Dd is smaller than the divisor Ds, the processing from step S105 to step S113 can be omitted. When the dividend Dd [M−1: K] (= Dd [10: 3]) of the higher bits from the K-th bit (= 3 bits) is smaller than the divisor Ds, the processes in steps S105 to S113 are repeated. The number of times can be limited to K times (= 3 times).

例えば、上記したように、1枚の自然画像のJPEG方式による画像圧縮符号化処理の場合において、量子化処理としての除算演算の商である量子化係数が[0x000]となる場合、すなわち、Mビットの被除数Ddとしての11ビットのDCT係数がNビットの除数Dsとしての8ビットの量子化閾値よりも小さくなる場合が65〜80%である。また、[0x001]〜[0x007]となる場合、すなわち、Kビット(=3ビット)目より上位ビットの被除数Dd[M−1:K](=Dd[10:3]が除数Dsより小さくなる場合が15〜30%である。従って、量子化係数が[0x000]〜[0x007]となる場合、すなわち、量子化係数としての商Qが3ビットの範囲内となる場合が、1枚の自然画像に対する処理結果のうちの90%以上であることになる。従って、本実施例のアルゴリズムでは、1枚の自然画像に対する除算演算の90%以上の処理において、除算演算処理時間の短縮化を図ることが可能である。この結果、除算演算処理の高速化を図ることが可能である。   For example, as described above, in the case of image compression encoding processing of a single natural image by the JPEG method, the quantization coefficient that is the quotient of the division operation as quantization processing is [0x000], that is, M The case where the 11-bit DCT coefficient as the bit dividend Dd is smaller than the 8-bit quantization threshold as the N-bit divisor Ds is 65 to 80%. Further, in the case of [0x001] to [0x007], that is, the dividend Dd [M−1: K] (= Dd [10: 3] of the upper bits from the K bit (= 3 bits) is smaller than the divisor Ds. Therefore, when the quantization coefficient is [0x000] to [0x007], that is, when the quotient Q as the quantization coefficient is within the range of 3 bits, Therefore, the algorithm is 90% or more of the processing result for the image, and therefore, in the algorithm of this embodiment, the division operation processing time is shortened in the processing of 90% or more of the division operation for one natural image. As a result, it is possible to speed up the division calculation process.

B2.除算器の具体例:
図4は、第1実施例としての除算演算のアルゴリズムに従った除算器として、被除数Ddの各ビットについての処理を、基準クロックの1クロックの間に、1ビットの処理を実行する場合の構成を示すブロック図である。
B2. Specific examples of dividers:
FIG. 4 shows a configuration in which processing for each bit of the dividend Dd is executed as 1-bit processing during one clock of the reference clock as a divider according to the division operation algorithm as the first embodiment. FIG.

この除算器100は、図9に示した基本的な除算演算のアルゴリズムに従った除算器1000の構成に加えて、2つの比較器112,113と、セレクタ114と、を備える。また、セレクタ110と商レジスタ103との間に、セレクタ115を備える。さらに、制御回路111に換えて、制御回路116を備える。   The divider 100 includes two comparators 112 and 113 and a selector 114 in addition to the configuration of the divider 1000 according to the basic division calculation algorithm shown in FIG. A selector 115 is provided between the selector 110 and the quotient register 103. Further, a control circuit 116 is provided instead of the control circuit 111.

比較器112は、Mビット(=11ビット)の被除数Ddと、Nビット(=8ビット)の除数Dsと、を比較し、その比較結果を制御回路116へ出力する機能ブロックである。   The comparator 112 is a functional block that compares the M-bit (= 11 bits) dividend Dd with the N-bit (= 8 bits) divisor Ds and outputs the comparison result to the control circuit 116.

セレクタ114は、Mビット(=11ビット)の被除数Ddのうち、Kビット目よりも上位のビットの被除数Dd[M−1:K](=Dd[10:3])を選択し出力する機能ブロックである。   The selector 114 selects and outputs a dividend Dd [M−1: K] (= Dd [10: 3]) of bits higher than the Kth bit among the dividend Dd of M bits (= 11 bits). It is a block.

比較器113は、被除数Dd[M−1:K](=Dd[10:3])と、除数Dsと、を比較し、その比較結果を制御回路116へ出力する機能ブロックである。   The comparator 113 is a functional block that compares the dividend Dd [M−1: K] (= Dd [10: 3]) with the divisor Ds and outputs the comparison result to the control circuit 116.

セレクタ115は、セレクタ110の出力を商レジスタ103に書き込むか、“0”を書き込むか選択する機能ブロックである。   The selector 115 is a functional block that selects whether the output of the selector 110 is written in the quotient register 103 or “0”.

制御回路116は、比較器112および比較器113の比較結果に応じて、セレクタ104、セレクタ110、および、セレクタ115の動作を制御する機能ブロックである。   The control circuit 116 is a functional block that controls the operations of the selector 104, the selector 110, and the selector 115 according to the comparison results of the comparator 112 and the comparator 113.

比較器112、セレクタ115、および、制御回路116によって、図3のステップS101およびステップS102の処理、すなわち、Mビット(=11ビット)の被除数DdがNビット(=8ビット)の除数Dsよりも小さい場合には、Mビット(=11ビット)の商Q[M−1]〜Q[0](=Q[10]〜Q[0])の各ビットの値を“0”とする処理が実行される。   Comparator 112, selector 115, and control circuit 116 perform the processing of step S101 and step S102 in FIG. 3, that is, the M-bit (= 11 bits) dividend Dd is greater than the N-bit (= 8 bits) divisor Ds. In the case of being small, there is a process of setting the value of each bit of the quotients Q [M−1] to Q [0] (= Q [10] to Q [0]) of M bits (= 11 bits) to “0”. Executed.

セレクタ114、比較器113、セレクタ104、セレクタ115、および、制御回路116によって、ステップS103〜S106の処理、すなわち、被除数DdのKビット(=3ビット)目よりも上位ビットの被除数Dd[M−1:k](=Dd[10:3])が除数Ds以上である場合には、[N+1]ビット(=9ビット)の被減数Mdの各ビットの値を“0”とするとともに、インデックスiの値を[M−1](=10)とし、さらに、被減数Mdに、インデックスiに対応するビットDd[i]の値を加算する処理が実行される。また、被除数DdのKビット(=3ビット)目よりも上位ビットの被除数Dd[M−1:K](=Dd[10:3])が除数Dsよりも小さい場合には、被除数Dd[M−1:K−1](=Dd[10:2])を被減数Mdとし、インデックスiの値を[K−1](=2)とするとともに、Kビット(=3ビット)目よりも上位ビットの商Q[M−1]〜Q[K]の各ビットの値を“0”とする処理が実行される。   By the selector 114, the comparator 113, the selector 104, the selector 115, and the control circuit 116, the processing in steps S103 to S106, that is, the dividend Dd [M− of the higher bits than the K bit (= 3 bits) of the dividend Dd. 1: k] (= Dd [10: 3]) is greater than or equal to the divisor Ds, the value of each bit of the divisor Md of [N + 1] bits (= 9 bits) is set to “0” and the index i Is set to [M−1] (= 10), and a process of adding the value of the bit Dd [i] corresponding to the index i to the subtracted Md is executed. Further, when the dividend Dd [M−1: K] (= Dd [10: 3]) of the higher bits than the K bit (= 3 bit) of the dividend Dd is smaller than the divisor Ds, the dividend Dd [M −1: K−1] (= Dd [10: 2]) is the reduced number Md, the value of the index i is [K−1] (= 2), and higher than the K bit (= 3 bits) Processing for setting the value of each bit of bit quotients Q [M−1] to Q [K] to “0” is executed.

減算器106、比較器107、および、セレクタ110によって、ステップS107〜S110の処理、すなわち、被減数Mdが除数Ds以上の場合には、被減数Mdら除数Dsを減算し、インデックスiに対応するビットの商Q[i]を“1”とし、被減数Mdが除数Dsよりも小さい場合には、商Q[i]を“0”とする、処理が実行される。   The processing of steps S107 to S110 by the subtractor 106, the comparator 107, and the selector 110, that is, when the dividend Md is greater than or equal to the divisor Ds, the divisor Ds is subtracted from the dividend Md, and the bit corresponding to the index i When the quotient Q [i] is set to “1” and the divisor Md is smaller than the divisor Ds, the quotient Q [i] is set to “0”.

制御回路116、左シフト回路108、および、セレクタ109によって、ステップS111〜S113の処理、すなわち、インデックスiを“1”減算し、被減数Mdを1ビット左シフトして、最上位ビットの値を廃棄した値を被減数Mdの上位Nビットの新たな値とする処理が実行される。   The control circuit 116, the left shift circuit 108, and the selector 109 perform the processing of steps S111 to S113, that is, the index i is decremented by “1”, the subordinate Md is shifted left by 1 bit, and the value of the most significant bit is discarded. A process is performed in which the calculated value is used as a new value of the upper N bits of the subtracted Md.

この除算器100の構成では、図3に示した除算演算のアルゴリズムに従った除算演算を実行することができ、画像圧縮符号化装置における量子化処理としての除算演算の処理時間の短縮化を図ることができるので、量子化処理のための除算演算処理の高速化を図ることが可能である。   In the configuration of the divider 100, a division operation according to the algorithm of the division operation shown in FIG. 3 can be executed, and the processing time of the division operation as the quantization processing in the image compression encoding device is shortened. Therefore, it is possible to speed up the division calculation process for the quantization process.

また、この除算器100の構成では、基本的には、従来の除算器1000(図9参照)に、2つの比較器112,113と、2つのセレクタ114,115と、を追加するのみで構成することができるので、例えば、汎用プロセッサに備えられる除算器のような複雑かつ回路規模の大きい除算器と比較して、効率が良い。   In addition, the configuration of the divider 100 is basically configured by simply adding two comparators 112 and 113 and two selectors 114 and 115 to the conventional divider 1000 (see FIG. 9). Therefore, the efficiency is higher than that of a divider having a large circuit scale such as a divider provided in a general-purpose processor.

また、除算演算処理時間の短縮化を図ることができないような被除数Ddの場合には、従来と同様の除算演算処理が実行されるので、少なくとも従来の除算器1000と同様に動作することができる。   Further, in the case of a dividend Dd for which the division operation processing time cannot be shortened, the division operation processing similar to the conventional one is executed, so that at least the operation similar to the conventional divider 1000 can be performed. .

図5は、第1実施例としての除算演算のアルゴリズムに従った除算器として、被除数Ddの各ビットについての処理を、基準クロックの1クロックの間に、3ビットの処理を実行する場合の構成を示すブロック図である。   FIG. 5 shows a configuration in which the processing for each bit of the dividend Dd is performed as a divider according to the algorithm of the division operation as the first embodiment and the processing of 3 bits is performed during one clock of the reference clock. FIG.

この除算器100Aは、図10に示した基本的な除算演算のアルゴリズムに従った除算器1000Aの構成に加えて、図4に示した除算器100と同様に、2つの比較器112,113と、セレクタ114と、を備える。また、セレクタ110Aと商レジスタ103との間に、セレクタ115を備える。さらに、制御回路111Aに換えて、制御回路116Aを備える。   In addition to the configuration of the divider 1000A according to the basic division calculation algorithm shown in FIG. 10, the divider 100A includes two comparators 112 and 113, similar to the divider 100 shown in FIG. , And selector 114. A selector 115 is provided between the selector 110A and the quotient register 103. Further, a control circuit 116A is provided instead of the control circuit 111A.

制御回路116Aは、比較器112および比較器113の比較結果に応じて、セレクタ104A、セレクタ110A、および、セレクタ115の動作を制御する機能ブロックである。   The control circuit 116A is a functional block that controls the operations of the selector 104A, the selector 110A, and the selector 115 in accordance with the comparison results of the comparator 112 and the comparator 113.

この除算器100Aの構成では、図4に示した除算器100と同様に、図3に示した除算演算のアルゴリズムに従った除算演算を実行することができ、画像圧縮符号化装置における量子化処理としての除算演算の処理時間の短縮化を図ることができるので、量子化処理のための除算演算処理の高速化を図ることが可能である。また、この除算器100Aの構成では、図4に示した除算器100が、基準クロックの1クロックの間に1ビットの処理を実行するのに対して、3ビットの処理を実行することができるので、除算器100に比べて、図3のステップS105〜ステップS113において繰り返し実行される処理の時間をさらに短縮化することができるので、量子化処理のための除算演算処理の高速化を図ることが可能である。   In the configuration of the divider 100A, similarly to the divider 100 shown in FIG. 4, the division operation according to the algorithm of the division operation shown in FIG. 3 can be executed, and the quantization process in the image compression encoding apparatus is performed. As a result, it is possible to shorten the processing time of the division operation as described above, so that it is possible to increase the speed of the division operation processing for the quantization processing. Further, in the configuration of the divider 100A, the divider 100 shown in FIG. 4 can execute 1-bit processing during one clock of the reference clock, but can execute 3-bit processing. Therefore, compared with the divider 100, the processing time repeatedly executed in steps S105 to S113 in FIG. 3 can be further shortened, so that the division operation processing for the quantization processing can be speeded up. Is possible.

また、この除算器100Aの構成も、基本的には、従来の除算器1000A(図10参照)に、2つの比較器112,113と、2つのセレクタ114,115と、を追加するのみで構成することができるので、例えば、汎用プロセッサに備えられる除算器のような複雑かつ回路規模の大きい除算器と比較して、効率が良い。   The configuration of the divider 100A is basically configured by adding only two comparators 112 and 113 and two selectors 114 and 115 to the conventional divider 1000A (see FIG. 10). Therefore, the efficiency is higher than that of a divider having a large circuit scale such as a divider provided in a general-purpose processor.

また、除算演算処理時間の短縮化を図ることができないような被除数Ddの場合には、従来と同様の除算演算処理が実行されるので、少なくとも従来の除算器1000Aと同様に動作することができる。   Further, in the case of a dividend Dd for which the division operation processing time cannot be shortened, the division operation processing similar to the conventional one is executed, so that at least the operation similar to the conventional divider 1000A can be performed. .

なお、上記除算器100,100Aにおいて、比較器112が本発明の被除数全体比較手段に相当し、比較器113およびセレクタ114が本発明の被除数部分比較手段に相当する。また、制御回路116,116Aが本発明の制御手段に相当する。さらに、また、上記演算器100において、セレクタ104、被減数レジスタ105、減算器106、比較器107、左シフト回路108、セレクタ109、セレクタ110、および、セレクタ115が、本発明の演算手段に相当する。また、上記演算器100Aにおいて、セレクタ104A、被減数レジスタ105、減算器106a〜106c、比較器107a〜07c、左シフト回路108a〜08c、セレクタ109a〜109c、セレクタ110A、および、セレクタ115が、本発明の演算手段に相当する。   In the dividers 100 and 100A, the comparator 112 corresponds to the entire dividend comparison means of the present invention, and the comparator 113 and the selector 114 correspond to the dividend partial comparison means of the present invention. The control circuits 116 and 116A correspond to the control means of the present invention. Further, in the arithmetic unit 100, the selector 104, the attenuator register 105, the subtractor 106, the comparator 107, the left shift circuit 108, the selector 109, the selector 110, and the selector 115 correspond to the arithmetic means of the present invention. . In the arithmetic unit 100A, the selector 104A, the attenuator register 105, the subtractors 106a to 106c, the comparators 107a to 07c, the left shift circuits 108a to 08c, the selectors 109a to 109c, the selector 110A, and the selector 115 are included in the present invention. It corresponds to the calculation means.

C.第2実施例の除算器の構成:
C1.除算アルゴリズム:
図6は第2実施例としての除算演算のアルゴリズムの一部を示す説明図である。このアルゴリズムは、図3の第1実施例としての除算演算のアルゴリズムのステップS103とステップS104との間に、ステップS103a,ステップS103bが挿入されたものであり、その部分のみを示している。
C. Configuration of the divider of the second embodiment:
C1. Division algorithm:
FIG. 6 is an explanatory diagram showing a part of the algorithm of division operation as the second embodiment. In this algorithm, steps S103a and S103b are inserted between step S103 and step S104 of the algorithm of division operation as the first embodiment of FIG. 3, and only that portion is shown.

具体的には、Kビット(3ビット)目よりも上位の被除数Dd[M−1:K](=Dd[10:3])が除数Ds以上である場合において(ステップS103:YES)、さらに、Lビット(L>K)目よりも上位ビットの被除数Dd[M−1:L]が除数Ds以上であるか否かに応じて(ステップS103a)、ステップS104の処理を実行するか、ステップS103bの処理を実行する。なお、ここでは、L=6を例として説明する。   Specifically, when the dividend Dd [M−1: K] (= Dd [10: 3]) higher than the K bit (3 bits) is greater than or equal to the divisor Ds (step S103: YES), Depending on whether or not the dividend Dd [M−1: L] of the higher bits than the Lth bit (L> K) is greater than or equal to the divisor Ds (step S103a), the process of step S104 is executed, The process of S103b is executed. Here, L = 6 will be described as an example.

被除数DdのLビット(=6ビット)目よりも上位ビットの被除数Dd[M−1:L](=Dd[10:6])が除数Ds以上である場合には(ステップS103a:YES)、[N+1]ビット(=9ビット)の被減数Mdの各ビットの値を“0”とし、インデックスiの値を[M−1](=10)とし(ステップS104)、図3のステップS105以降の処理を実行する。一方、被除数DdのLビット(=6ビット)目よりも上位ビットの被除数Dd[M−1:L](=Dd[10:6])が除数Dsよりも小さい場合には(ステップS103a:NO)、被除数Dd[M−1:L−1](=Dd[10:4])を被減数Mdとし、インデックスiの値を[L−1](=5)とするとともに、Lビット(=6ビット)目よりも上位ビットの商Q[M−1]〜Q[L]の各ビットの値を“0”とする(ステップS103a)とし、図3のステップS107以降の処理を実行する。   When the dividend Dd [M−1: L] (= Dd [10: 6]) of the higher bits than the Lth bit (= 6th bit) of the dividend Dd is equal to or greater than the divisor Ds (step S103a: YES). The value of each bit of the [N + 1] -bit (= 9-bit) dividend Md is set to “0”, the value of the index i is set to [M−1] (= 10) (step S104), and after step S105 in FIG. Execute the process. On the other hand, when the dividend Dd [M−1: L] (= Dd [10: 6]) of the higher bits than the Lth bit (= 6th bit) of the dividend Dd is smaller than the divisor Ds (step S103a: NO). ), The dividend Dd [M−1: L−1] (= Dd [10: 4]) is set as the dividend Md, the value of the index i is set as [L−1] (= 5), and L bits (= 6). The value of each bit of the quotients Q [M−1] to Q [L], which are higher bits than the (bit) -th bit, is set to “0” (step S103a), and the processing after step S107 in FIG.

本実施例のアルゴリズムは、図3に示した第1実施例のアルゴリズムの場合に加えて、Lビット(=6ビット)目より上位ビットの被除数Dd[M−1:L](=Dd[10:6])が除数Dsより小さい場合には、Lビット目より上位ビットの商Q[M−1]〜Q[L]の各ビットの値を“0”とし、ステップS105〜ステップS113の処理を被除数のLビット目(i=[L−1]=5)から最下位ビット(i=0)まで順に繰り返し実行することにより除算結果を得るものである。従って、Lビット(=6ビット)目より上位ビットの被除数Dd[M−1:L](=Dd[10:6])が除数Dsより小さい場合には、ステップS105〜ステップS113の処理の繰り返し回数をL回(=6回)に限定することができる。   In addition to the algorithm of the first embodiment shown in FIG. 3, the algorithm of the present embodiment is a dividend Dd [M−1: L] (= Dd [10] of higher bits than the L bit (= 6 bits). : 6]) is smaller than the divisor Ds, the value of each bit of the quotients Q [M−1] to Q [L] of the higher bits from the L-th bit is set to “0”, and the processing in steps S105 to S113 is performed. Is repeatedly executed in order from the Lth bit (i = [L-1] = 5) of the dividend to the least significant bit (i = 0) to obtain a division result. Accordingly, when the dividend Dd [M−1: L] (= Dd [10: 6]) of the higher bits from the L-th bit (= 6th bit) is smaller than the divisor Ds, the processing in steps S105 to S113 is repeated. The number of times can be limited to L times (= 6 times).

例えば、上記したように、1枚の自然画像のJPEG方式による画像圧縮符号化処理の場合において、量子化処理としての除算演算の商である量子化係数が[0x008]〜[0x03F]となる場合、すなわち、Lビット(=6ビット)目より上位ビットの被除数Dd[M−1:L](=Dd[10:6]が除数Dsより小さくなる場合が3〜6%である。従って、量子化係数が[0x000]〜[0x03F]となる場合、すなわち、量子化係数としての商Qが6ビットの範囲内となる場合が、1枚の自然画像に対する処理結果のうちの93%以上であることになる。従って、1枚の自然画像に対する除算演算の93%以上の処理において、除算演算処理時間の短縮化を図ることが可能である。この結果、第1実施例の場合よりもさらに、除算演算処理の高速化を図ることが可能である。   For example, as described above, in the case of image compression coding processing of one natural image by the JPEG method, a quantization coefficient that is a quotient of division operation as quantization processing is [0x008] to [0x03F]. In other words, the dividend Dd [M−1: L] (= Dd [10: 6]) of the higher bits from the Lth bit (= 6th bit) is 3 to 6% when it is smaller than the divisor Ds. When the quantization coefficient is from [0x000] to [0x03F], that is, when the quotient Q as the quantization coefficient is in the range of 6 bits, it is 93% or more of the processing result for one natural image. Accordingly, it is possible to shorten the division calculation processing time in the processing of 93% or more of the division calculation with respect to one natural image, and as a result, it is possible to further reduce the time required for the division calculation processing. It is possible to increase the speed of division operation processing.

C2.除算器の具体例:
図7は、第2実施例としての除算演算のアルゴリズムに従った除算器として、被除数Ddの各ビットについての処理を、基準クロックの1クロックの間に、1ビットの処理を実行する場合の構成の一部を示すブロック図である
C2. Specific examples of dividers:
FIG. 7 shows a configuration in which processing for each bit of the dividend Dd is performed as 1-bit processing during one clock of the reference clock as a divider according to the division operation algorithm as the second embodiment. It is a block diagram which shows a part of

この除算器200は、図4に示した第1実施例の除算器100の構成に加えて、セレクタ118および比較器117を備える。また、制御回路116に換えて制御回路119を備える。   The divider 200 includes a selector 118 and a comparator 117 in addition to the configuration of the divider 100 of the first embodiment shown in FIG. Further, a control circuit 119 is provided instead of the control circuit 116.

セレクタ118は、Mビット(=11ビット)の被除数Ddのうち、Lビット(=6ビット)目よりも上位のビットの被除数Dd[M−1:L](=Dd[10:6])を選択し出力する機能ブロックである。   The selector 118 selects the dividend Dd [M−1: L] (= Dd [10: 6]) of bits higher than the L bit (= 6 bits) of the dividend Dd of M bits (= 11 bits). It is a functional block that selects and outputs.

比較器117は、被除数Dd[M−1:L](=Dd[10:6])と、除数Dsと、を比較し、その比較結果を制御回路119へ出力する機能ブロックである。   The comparator 117 is a functional block that compares the dividend Dd [M−1: L] (= Dd [10: 6]) with the divisor Ds and outputs the comparison result to the control circuit 119.

制御回路119は、比較器112、比較器113、および、比較器117の比較結果に基づいて、セレクタ104、セレクタ110、およびセレクタ115の動作を制御する機能ブロックである。   The control circuit 119 is a functional block that controls the operations of the selector 104, the selector 110, and the selector 115 based on the comparison results of the comparator 112, the comparator 113, and the comparator 117.

セレクタ118、比較器117、セレクタ104、セレクタ115、および、制御回路119によって、ステップS103a,S103bの処理、すなわち、被除数DdのLビット(=6ビット)目よりも上位ビットの被除数Dd[M−1:L](=Dd[10:6])が除数Dsよりも小さい場合には、被除数Dd[M−1:L−1](=Dd[10:5])を被減数Mdとし、インデックスiの値を[L−1](=5)とするとともに、Lビット(=6ビット)目よりも上位ビットの商Q[M−1]〜Q[L]の各ビットの値を“0”とする処理が実行される。   By the selector 118, the comparator 117, the selector 104, the selector 115, and the control circuit 119, the processing in steps S103a and S103b, that is, the dividend Dd [M− of higher bits than the L bit (= 6 bits) of the dividend Dd. 1: L] (= Dd [10: 6]) is smaller than the divisor Ds, the dividend Dd [M-1: L-1] (= Dd [10: 5]) is set as the divisor Md, and the index i Is set to [L−1] (= 5), and the value of each bit of the quotients Q [M−1] to Q [L] of higher bits than the Lth bit (= 6th bit) is “0”. Is executed.

この除算器200によれば、図6に示した第2実施例としての除算演算のアルゴリズムに従った除算演算を実行することができ、画像圧縮符号化装置における量子化処理としての除算演算の処理時間の短縮化を図ることができる。   According to the divider 200, division operation according to the division operation algorithm as the second embodiment shown in FIG. 6 can be executed, and division operation processing as quantization processing in the image compression coding apparatus is possible. Time can be shortened.

また、この除算器200の構成も、基本的には、従来の除算器1000(図9参照)に、3つの比較器112,113,117と、3つのセレクタ114,115,118と、を追加するのみで構成することができるので、例えば、汎用プロセッサに備えられる除算器のような複雑かつ回路規模の大きい除算器と比較して、効率が良い。   Also, the configuration of the divider 200 basically includes three comparators 112, 113, 117 and three selectors 114, 115, 118 added to the conventional divider 1000 (see FIG. 9). Therefore, the efficiency is higher than that of a divider having a large circuit scale such as a divider provided in a general-purpose processor.

また、除算演算処理時間の短縮化を図ることができないような被除数Ddの場合には、従来と同様の除算演算処理が実行されるので、少なくとも従来の除算器1000と同様に動作することができる。   Further, in the case of a dividend Dd for which the division operation processing time cannot be shortened, the division operation processing similar to the conventional one is executed, so that at least the operation similar to the conventional divider 1000 can be performed. .

なお、図示および説明を省略するが、図5に示した第1実施例の除算器100Aに加えて、セレクタ118および比較器117を備え、制御回路116に換えて制御回路119を備える構成として、被除数Ddの各ビットについての処理を、基準クロックの1クロックの間に、3ビットの処理を実行する構成とすることも可能である。   Although not shown and described, the configuration includes a selector 118 and a comparator 117 in addition to the divider 100A of the first embodiment shown in FIG. 5 and includes a control circuit 119 instead of the control circuit 116. The processing for each bit of the dividend Dd can be configured to execute 3-bit processing during one clock of the reference clock.

なお、上記除算器200において、比較器113およびセレクタ114と、比較器117とセレクタ118と、が本発明の複数の被除数部分比較手段に相当する。また、制御回路119が本発明の制御手段に相当する。   In the divider 200, the comparator 113 and the selector 114, the comparator 117 and the selector 118 correspond to a plurality of dividend partial comparison means of the present invention. The control circuit 119 corresponds to the control means of the present invention.

D.変形例:
なお、本発明は上記した実施例や実施形態に限られるものではなく、その要旨を逸脱しない範囲において種々の態様にて実施することが可能である。
D. Variations:
The present invention is not limited to the above-described examples and embodiments, and can be implemented in various modes without departing from the scope of the invention.

D1.変形例1:
上記した第1実施例では、Kビット目より上位ビットの被除数Dd[M−1:K]が除数Dsよりも小さいか否か判断することにより、除算演算処理に要する時間を短縮化する場合を説明しており、その例示として、ある自然画像の量子化係数の分布特性に基づいて、K=3(<N=8)の場合を示している。しかしながら、これに限定されるものではなく、量子化係数の分布特性に基づいて、除数のビット数Nよりも小さい種々の値とすることができる。
D1. Modification 1:
In the first embodiment described above, a case where the time required for the division operation process is shortened by determining whether or not the dividend Dd [M−1: K] of the upper bits from the K-th bit is smaller than the divisor Ds. As an example, the case of K = 3 (<N = 8) is shown based on the distribution characteristic of the quantization coefficient of a certain natural image. However, the present invention is not limited to this, and various values smaller than the divisor bit number N can be set based on the distribution characteristics of the quantization coefficients.

D2.変形例2:
上記した第2実施例では、Kビット目より上位ビットの被除数Dd[M−1:K]が除数Dsよりも小さいか否か判断するともに、Lビット目(N>L>K)より上位ビットの被除数Dd[M−1:L]が除数Dsよりも小さいか否か判断することにより、除算演算処理に要する時間を短縮化する場合を説明しているが、これに限定されるものではなく、さらに、Oビット目(N>O>L)より上位ビットの被除数Dd[M−1:O]が除数Dsよりも小さいか否か判断することにより除算演算処理に要する時間を短縮化するようにしてもよい。すなわち、複数の異なった所定ビットよりも上位ビットの被除数のそれぞれが、除数よりも小さいか否かを判断することにより除算演算処理に要する時間を短縮化するようにしてもよい。
D2. Modification 2:
In the second embodiment described above, it is determined whether or not the dividend Dd [M−1: K] of the higher bits than the Kth bit is smaller than the divisor Ds, and the higher bits than the Lth bit (N>L> K). Although the case where the time required for the division operation processing is shortened by determining whether or not the dividend Dd [M−1: L] of D is smaller than the divisor Ds has been described, the present invention is not limited to this. Further, the time required for the division operation process is shortened by determining whether or not the dividend Dd [M−1: O] of the higher bits than the Oth bit (N>O> L) is smaller than the divisor Ds. It may be. That is, the time required for the division operation process may be shortened by determining whether each of the dividends of the higher bits than a plurality of different predetermined bits is smaller than the divisor.

D3.変形例3:
上記した実施例では、除算器の具体例として、1クロックの間に1ビットの処理を実行する場合の構成の例と、1クロックの間に3ビットの処理を実行する場合の構成の例を示したが、これに限定されるものではなく、1クロックの間に2ビットの処理を実行する場合や、4ビット以上の処理を実行する場合の構成等、1クロックの間に複数ビットの処理を実行する場合の構成に適用可能である。
D3. Modification 3:
In the above-described embodiment, as a specific example of the divider, an example of a configuration in which 1-bit processing is executed during one clock and an example of a configuration in which 3-bit processing is executed during one clock. Although shown, the present invention is not limited to this, and a multi-bit processing is performed during one clock, such as a configuration in which 2-bit processing is performed during one clock, or a configuration in which four or more bits are processed. It is applicable to the configuration when executing

D4.変形例4:
上記した実施例では、自然画像の画像データを二次元離散コサイン変換することにより得られたDCT係数を被除数とし、量子化閾値を除数とし、除算演算の商として量子化係数を得る場合を例として除算器のアルゴリズムおよびその構成を説明したが、これに限定されるものではなく、種々の場合に適用可能である。特に、量子化係数の特性分布のように被除数を除数で除した商の値が除数よりも小さい値に偏っているような特性分布を有している場合に有効である。
D4. Modification 4:
In the above-described embodiment, as an example, a DCT coefficient obtained by performing two-dimensional discrete cosine transform on image data of a natural image is a dividend, a quantization threshold is a divisor, and a quantization coefficient is obtained as a quotient of a division operation. Although the algorithm of the divider and the configuration thereof have been described, the present invention is not limited to this, and can be applied to various cases. This is particularly effective when the characteristic distribution is such that the value of the quotient obtained by dividing the dividend by the divisor is biased to a value smaller than the divisor, such as the characteristic distribution of the quantization coefficient.

本発明の除算器を量子化部に適用した画像符号化装置の構成を示すブロック図である。It is a block diagram which shows the structure of the image coding apparatus which applied the divider of this invention to the quantization part. 画像符号化装置で実行される量子化処理について示す説明図である。It is explanatory drawing shown about the quantization process performed with an image coding apparatus. 第1実施例としての除算演算のアルゴリズムを示す説明図である。It is explanatory drawing which shows the algorithm of the division operation as 1st Example. 第1実施例としての除算演算のアルゴリズムに従った除算器として被除数Ddの各ビットについての処理を基準クロックの1クロックの間に1ビットの処理を実行する場合の構成を示すブロック図である。It is a block diagram which shows the structure in the case of performing the process about each bit of the dividend Dd as a divider according to the algorithm of the division operation as 1st Example between 1 clocks of a reference | standard clock. 第1実施例としての除算演算のアルゴリズムに従った除算器として被除数Ddの各ビットについての処理を基準クロックの1クロックの間に3ビットの処理を実行する場合の構成を示すブロック図である。It is a block diagram which shows the structure in the case of performing the process about each bit of the dividend Dd as a divider according to the algorithm of the division operation as 1st Example between 1 clock of reference clocks. 第2実施例としての除算演算のアルゴリズムの一部を示す説明図である。It is explanatory drawing which shows a part of algorithm of the division operation as 2nd Example. 第2実施例としての除算演算のアルゴリズムに従った除算器として被除数Ddの各ビットについての処理を基準クロックの1クロックの間に1ビットの処理を実行する場合の構成の一部を示すブロック図であるThe block diagram which shows a part of structure in the case of performing the process about each bit of the dividend Dd as a divider according to the algorithm of the division operation as 2nd Example between 1 clock of reference clocks Is 基本的な除算演算のアルゴリズムを示す説明図である。It is explanatory drawing which shows the algorithm of a basic division operation. 除算演算の基本的なアルゴリズムに従った除算器として演算アルゴリズムにおける被除数Ddの各ビットについての処理を基準クロックの1クロックの間に1ビットの処理を実行する場合の構成を示すブロック図である。It is a block diagram which shows the structure in the case of performing the process about each bit of the dividend Dd in an arithmetic algorithm as 1 time of a reference clock as a divider according to the basic algorithm of a division operation. 除算演算の基本的なアルゴリズムに従った除算器として演算アルゴリズムにおける被除数Ddの各ビットについての処理を基準クロックの1クロックの間に3ビットの処理を実行する場合の構成を示すブロック図である。It is a block diagram which shows the structure in the case of performing the process about each bit of the dividend Dd in an arithmetic algorithm as a divider according to the basic algorithm of a division operation in 1 clock of reference clocks.

符号の説明Explanation of symbols

10…画像符号化装置
20…DCT部
30…量子化部
40…量子化テーブル
50…ハフマン符号化部
60…ハフマンテーブル
100…除算器
100A…除算器
101…被除数レジスタ
102…除数レジスタ
103…商レジスタ
105…被減数レジスタ
104…セレクタ
104A…セレクタ
106…減算器
107…比較器
108…左シフト回路
109…セレクタ
106a〜106c…減算器
107a〜107c…比較器
108a〜108c…左シフト回路
109a〜109c…セレクタ
110…セレクタ
110A…セレクタ
111…制御回路
111A…制御回路
112…比較器
113…比較器
114…セレクタ
115…セレクタ
116…制御回路
116A…制御回路
117…比較器
118…セレクタ
119…制御回路
DESCRIPTION OF SYMBOLS 10 ... Image coding apparatus 20 ... DCT part 30 ... Quantization part 40 ... Quantization table 50 ... Huffman coding part 60 ... Huffman table 100 ... Divider 100A ... Divider 101 ... Dividend register 102 ... Divide register 103 ... Quotient register 105 ... Subtracted register 104 ... Selector 104A ... Selector 106 ... Subtractor 107 ... Comparator 108 ... Left shift circuit 109 ... Selector 106a-106c ... Subtractor 107a-107c ... Comparator 108a-108c ... Left shift circuit 109a-109c ... Selector DESCRIPTION OF SYMBOLS 110 ... Selector 110A ... Selector 111 ... Control circuit 111A ... Control circuit 112 ... Comparator 113 ... Comparator 114 ... Selector 115 ... Selector 116 ... Control circuit 116A ... Control circuit 117 ... Comparator 118 ... Selector 119 ... Control circuit

Claims (6)

被除数を除数で除算した商を求める除算器であって、
演算手段と、
前記被除数のうち所定ビットよりも上位ビットの前記被除数が、前記除数よりも小さいか否か比較判定するための被除数部分比較手段と、
前記上位ビットの被除数が前記除数よりも小さい場合には、前記商のうち前記上位ビットに対応するビットの商をゼロとするとともに、前記所定ビット以下の下位ビットの前記被除数を前記除数で除算して、前記下位ビットに対応するビットの商を求めることにより、前記被除数を前記除数で除算した商を求めるように、前記演算手段を制御する制御手段と、
を備えることを特徴とする除算器。
A divider for obtaining a quotient obtained by dividing a dividend by a divisor,
Computing means;
A dividend partial comparison means for comparing and determining whether or not the dividend of the higher-order bits of the dividend is smaller than the divisor;
When the dividend of the upper bits is smaller than the divisor, the quotient of the bits corresponding to the upper bits of the quotient is set to zero, and the dividend of the lower bits below the predetermined bit is divided by the divisor. Control means for controlling the computing means so as to obtain a quotient obtained by dividing the dividend by the divisor by obtaining a quotient of a bit corresponding to the lower bit;
A divider comprising:
請求項1記載の除算器であって、
前記所定ビットの大きさが順に異なる複数の被除数部分比較手段を備え、
前記制御手段は、複数の前記所定ビットのうち第1の所定ビットよりも上位ビットの被除数が前記除数よりも大きく、前記第1の所定ビットの次に大きい第2の所定ビットよりも上位ビットの被除数が前記除数よりも小さい場合には、前記商のうち前記第2の所定ビットよりも上位ビットに対応するビットの商をゼロとするとともに、前記第2の所定ビット以下の下位ビットの被除数を前記除数で除算して、前記第2の所定ビット以下の下位ビットに対応するビットの商を求めることにより、前記被除数を前記除数で除算した商を求めるように、前記演算手段を制御する
ことを特徴とする除算器。
The divider according to claim 1, wherein
A plurality of dividend portion comparison means having different predetermined bit sizes,
The control means has a dividend of higher bits than a second predetermined bit larger than the divisor in which a dividend of higher bits than a first predetermined bit among the plurality of predetermined bits is larger than the divisor. If the dividend is smaller than the divisor, the quotient of the bit corresponding to the higher-order bit than the second predetermined bit in the quotient is set to zero, and the lower-bit dividend of the second predetermined bit or less is set as zero. Dividing the divisor to obtain a quotient of bits corresponding to lower bits less than or equal to the second predetermined bit, thereby controlling the computing means to obtain a quotient obtained by dividing the dividend by the divisor. Characteristic divider.
請求項1または請求項2記載の除算器であって、
さらに、前記被除数が前記除数よりも小さいか否か比較判定するための被除数全体比較手段を備え、
前記制御手段は、前記被除数が前記除数よりも小さい場合には、各ビットの商をゼロとすることにより、前記被除数を前記除数で除算した商を求めるように、前記演算手段を制御する
ことを特徴とする除算器。
A divider according to claim 1 or claim 2, wherein
Furthermore, it comprises a whole dividend comparison means for comparing and determining whether or not the dividend is smaller than the divisor,
The control means controls the arithmetic means so as to obtain a quotient obtained by dividing the dividend by the divisor by setting a quotient of each bit to zero when the dividend is smaller than the divisor. Characteristic divider.
請求項1ないし請求項3のいずれかに記載の除算器であって、
前記被除数は画像データを離散コサイン変換したDCT係数であり、
前記除数は所定の量子化閾値であり、
前記所定ビットは、前記DCT係数を前記量子化閾値で除算することにより得られる商としての量子化係数の特性に基づいて決定される
ことを特徴とする除算器。
A divider according to any one of claims 1 to 3, wherein
The dividend is a DCT coefficient obtained by discrete cosine transform of image data,
The divisor is a predetermined quantization threshold;
The divider is characterized in that the predetermined bit is determined based on a characteristic of a quantization coefficient as a quotient obtained by dividing the DCT coefficient by the quantization threshold.
請求項4記載の除算器を備え、
前記除算器に、前記被除数として前記DCT係数を入力し、前記除数として前記量子化閾値を入力することにより、前記DCT係数を前記量子化閾値で除算して求められる商を前記量子化係数として得ることを特徴とする画像符号化装置。
A divider according to claim 4,
The quotient obtained by dividing the DCT coefficient by the quantization threshold is obtained as the quantization coefficient by inputting the DCT coefficient as the dividend and inputting the quantization threshold as the divisor to the divider. An image encoding apparatus characterized by that.
被除数を除数で除算した商を求める除算方法であって、
前記被除数のうち所定ビットよりも上位ビットの前記被除数が、前記除数よりも小さいか否か比較判定し、
前記上位ビットの被除数が前記除数よりも小さい場合には、前記商のうち前記上位ビットに対応するビットの商をゼロとするとともに、前記所定ビット以下の下位ビットの前記被除数を前記除数で除算して、前記下位ビットに対応するビットの商を求めることにより、前記被除数を前記除数で除算した商を求める、
ことを特徴とする除算方法。
A division method for obtaining a quotient obtained by dividing a dividend by a divisor,
A determination is made as to whether or not the dividend of the higher-order bits of the dividend is smaller than the divisor,
When the dividend of the upper bits is smaller than the divisor, the quotient of the bits corresponding to the upper bits of the quotient is set to zero, and the dividend of the lower bits below the predetermined bit is divided by the divisor. Obtaining a quotient obtained by dividing the dividend by the divisor by obtaining a quotient of a bit corresponding to the lower bit.
A division method characterized by that.
JP2008012784A 2008-01-23 2008-01-23 Divider, dividing method, and image encoding device using divider Pending JP2009175958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008012784A JP2009175958A (en) 2008-01-23 2008-01-23 Divider, dividing method, and image encoding device using divider

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008012784A JP2009175958A (en) 2008-01-23 2008-01-23 Divider, dividing method, and image encoding device using divider

Publications (1)

Publication Number Publication Date
JP2009175958A true JP2009175958A (en) 2009-08-06

Family

ID=41030991

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008012784A Pending JP2009175958A (en) 2008-01-23 2008-01-23 Divider, dividing method, and image encoding device using divider

Country Status (1)

Country Link
JP (1) JP2009175958A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017507571A (en) * 2014-01-30 2017-03-16 クアルコム,インコーポレイテッド Low complexity sample adaptive offset coding

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0385871A (en) * 1989-08-29 1991-04-11 Fujitsu Ltd Method and apparatus for picture data coding
WO1995016951A1 (en) * 1993-12-15 1995-06-22 Silicon Graphics Inc. Method and apparatus for integer division
JPH08137672A (en) * 1994-11-15 1996-05-31 Fuji Film Micro Device Kk Divider circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0385871A (en) * 1989-08-29 1991-04-11 Fujitsu Ltd Method and apparatus for picture data coding
WO1995016951A1 (en) * 1993-12-15 1995-06-22 Silicon Graphics Inc. Method and apparatus for integer division
JPH08137672A (en) * 1994-11-15 1996-05-31 Fuji Film Micro Device Kk Divider circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017507571A (en) * 2014-01-30 2017-03-16 クアルコム,インコーポレイテッド Low complexity sample adaptive offset coding

Similar Documents

Publication Publication Date Title
EP0469841A1 (en) Data round-off device
JPH0793586B2 (en) Data compression model selection method and system
JP4717780B2 (en) Encoding apparatus and control method thereof
EP1235353A2 (en) Arithmetic coding apparatus and image processing apparatus
JP2006054865A (en) Binary arithmetic decoding apparatus and methods using pipelined structure
US7953285B2 (en) Method and circuit of high performance variable length coding and decoding for image compression
CN1253338A (en) Transform region correction of actual region error
US7834785B2 (en) CABAC type encoding device and method
KR20080016881A (en) Compression and decompression using corrections of predicted values
CN111818335B (en) Entropy coding method and device and electronic equipment
JP2009021775A (en) Coder and coding method
GB2496210A (en) Context adaptive (CABAC) data encoding and decoding
JP2009175958A (en) Divider, dividing method, and image encoding device using divider
JP2009175959A (en) Divider, division method, and image encoding device using divider
CN107277553B (en) Binary arithmetic coder
KR100241069B1 (en) Calculating the average of four integer numbers rounded away from zero in a single instruction cycle
JPH104557A (en) Unit, and method for image processing and storage medium storing the method
JP2002519957A (en) Method and apparatus for processing a sign function
JP4148356B2 (en) Quantization step parameter determination device, quantization step parameter determination method, quantization step parameter determination program, and nonlinear quantization method, nonlinear quantization device, and nonlinear quantization program
US9615111B2 (en) Complexity-adaptive compression of color images using binary arithmetic coding
JPH06121172A (en) Picture encoder
TWI780796B (en) Converting digital image data
JP2594767B2 (en) How to decompress compressed data
JP2008131526A (en) Moving image coding apparatus, and moving image coding program
JP2006060553A (en) Quantizer and inverse quantizer

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20101203

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120724

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120725

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120919

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130312