WO2011113290A1 - Method for processing arithmetic entropy coding in real time at high-speed based on joint photographic experts group (jpeg) 2000 standard - Google Patents

Method for processing arithmetic entropy coding in real time at high-speed based on joint photographic experts group (jpeg) 2000 standard Download PDF

Info

Publication number
WO2011113290A1
WO2011113290A1 PCT/CN2010/080584 CN2010080584W WO2011113290A1 WO 2011113290 A1 WO2011113290 A1 WO 2011113290A1 CN 2010080584 W CN2010080584 W CN 2010080584W WO 2011113290 A1 WO2011113290 A1 WO 2011113290A1
Authority
WO
WIPO (PCT)
Prior art keywords
probability
value
symbol
normalization
double
Prior art date
Application number
PCT/CN2010/080584
Other languages
French (fr)
Chinese (zh)
Inventor
刘凯
王柯俨
李云松
曾伟
Original Assignee
西安电子科技大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN 201010128830 external-priority patent/CN101848388B/en
Priority claimed from CN 201010128710 external-priority patent/CN101841707B/en
Priority claimed from CN 201010128736 external-priority patent/CN101848387A/en
Application filed by 西安电子科技大学 filed Critical 西安电子科技大学
Publication of WO2011113290A1 publication Critical patent/WO2011113290A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods 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
    • H04N19/436Methods 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 using parallelised computational arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/63Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using sub-band based transform, e.g. wavelets

Definitions

  • JPEG Joint Photographic Experts Group
  • the invention relates to a high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard, which is used for image compression coding of various digital devices, in particular high-speed real-time satellite image compression coding.
  • Background technique
  • the existing still image compression standard JPEG can no longer meet the requirements of current practical applications, for which the International Organization for Standardization In November 2000, a new still image compression standard JPEG2000 was developed.
  • One of the core technologies of the standard is to use the arithmetic entropy coding method to encode the wavelet transformed data to achieve image data compression processing.
  • the basic encoding process of JPEG2000 can be simply described as follows: First, the input image is subjected to discrete wavelet transform, and the wavelet transformed data is called wavelet coefficient; then the wavelet coefficients are quantized and encoded in units of code blocks, and the size of the code block is usually 32x32. Or 64x64; In the encoding process, the corresponding context model is established according to the wavelet coefficient bit plane order, and the context symbol pair CXD is encoded by the arithmetic entropy coding method, thereby obtaining the coded data of the corresponding code block; finally, according to the preset compression ratio The coded data corresponding to each code block is selectively outputted, and the encoding process of the single image is completed.
  • the input of the arithmetic entropy coding is a context symbol pair CXD, including a context label CX and a context decision D, where CX represents a context label generated by the current coded pixel, and the value ranges from 0 to 18, and D represents a decision of the corresponding context, and the value range is It is 0-1.
  • the output of the arithmetic entropy encoding of the context symbol pair is the corresponding compressed code stream.
  • the probability of the corresponding decision D is adaptively selected according to the input context label CX, and the symbol values to be encoded according to the judgment D are prepared, that is, the high probability coding symbol MPS and the small probability coding symbol LPS, and small Probability encodes the probability Qe corresponding to the symbol LPS, then adjusts the corresponding probability interval value, and outputs the encoded value to the code value register.
  • the probability interval value is represented by a 16-bit unsigned integer, which is 32 bits and is divided into 5 different fields, that is, bits 31 to 28 represent 4-bit zero data, and bit 27 represents "into Bit "bit, bits 26 to 19 indicate the coded output bits, bits 18 to 16 indicate the 3-bit division bits used to block the carry propagation, and bits 15 to 0 represent the decimal places of the code value.
  • the arithmetic entropy encoder is implemented by an array of 47 indexes, which is called a probability estimation table PET, and each item in the table corresponds to a Qe value of a 16-bit LPS symbol. According to the JPEG2000 standard, the current coding symbol is corresponding.
  • the context label CX serves as an address to access an array of size 19 X 6 to obtain an entry index Index of the probability estimation table PET, and then reads the corresponding LPS symbol probability value Qe in the PET table by using the Index as the address, and combines the current probability interval value. And the code value determines the specific coding process. If the current probability interval value is less than or equal to 0.75, the value corresponds to 0x8000 in hexadecimal. In order to prevent overflow, the probability interval value and the code value need to be normalized, by left The probability interval value and the code value make the probability interval larger than 0x8000. At the same time of normalization, if the code stream forms a whole byte in the code value, the code stream output process is performed, that is, Final encoded output stream. To prevent carry propagation, by setting specific bits are filled into the transfer position to intercept.
  • the conventional arithmetic entropy coding method has the following problems: If the implementation complexity is low, the processing speed is also low; if the processing speed is increased, the implementation complexity is drastically increased. Summary of the invention
  • the present invention has been made in view of the above problems, and an object thereof is to avoid the above-mentioned deficiencies of the prior art, and to provide a high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard, so as to improve the coding system while maintaining the same complexity. Processing speed.
  • a high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard of the present invention includes: a probability interval value determining step of determining a coded symbol type according to two context symbol pairs input in parallel, and according to the Encoding symbol type, updating the probability interval value and the encoding parameter; the code value normalization step, updating the code value according to the above coding symbol type, determining the current normalization type according to the updated probability interval value and the coding parameter Performing normalization processing, and outputting the normalized code stream and the empty code stream; the code stream buffering step, according to the order of output of the code stream, according to the outputted byte number of the normalized code stream and the empty code stream And respectively classifying and buffering the normalized code stream and the empty code stream, and outputting in parallel; and outputting, according to the normalized code stream and the empty code stream output in parallel in the code stream buffer step of
  • DRAWINGS 1 is a flow chart of an arithmetic entropy coding method of the present invention.
  • Fig. 2 is a detailed flowchart of the probability interval value determining process of the present invention.
  • 3 is a flow chart of the double-probability symbol probability interval value update subroutine of the present invention.
  • FIG. 4 is a flow chart of the high probability/small probability symbol probability interval value update subroutine of the present invention.
  • Figure 5 is a flow chart showing the small probability/high probability symbol probability interval value update subroutine of the present invention.
  • FIG. 6 is a flow chart of the double small probability symbol probability interval value update subroutine of the present invention.
  • Figure 7 is a detailed flow chart of the normalization method of the present invention.
  • Figure 8 is a flow chart of the double-high probability symbol code value normalization type judgment sub-routine of the present invention.
  • Fig. 9 is a flow chart showing the judgment of the large probability/small probability symbol code value normalization type of the present invention.
  • Fig. 10 is a flow chart showing the small probability/high probability symbol code value normalization type judgment sub-render of the present invention.
  • Figure 11 is a flow chart of the single normalization process of the present invention.
  • Figure 12 is a flow chart of a type of double normalization process of the present invention.
  • Figure 13 is a flow chart of the second-class double normalization process of the present invention.
  • Figure 15 is a detailed flow chart showing the operation of the code stream of the output classification buffer of the present invention. detailed description
  • the encoding method of the present invention is implemented on Xilinx's model XC2V3000-6BG728 using Xilinx ISE 9.1 integrated development software and VHDL, Verilog HDL language.
  • FIG. 1 is a flow chart of the above arithmetic entropy encoding method.
  • the arithmetic coding method of the present invention includes: Step S1, determining a type of a double context symbol pair; Step S2, updating a probability interval value; Step S3, normalizing the code value; Step S4: The code value is subjected to the emptying process; step S5, the classifying buffer outputs the code stream; and step S6: and outputting the code stream of the classifying buffer.
  • Step S1 and step S2 constitute a probability interval value determining step
  • step S3 and step S4 form a code value normalization step.
  • Step S1 determining the type of the double context symbol pair.
  • Step S11 reading the double-encoded index and the double-large probability symbol identifier. Simultaneously inputting a first context symbol pair (CX0, DO) and a second context symbol pair (CX1, D1), respectively, using the first context label CX0 and the second context label CX1 as addresses, from a preset array of encoded indices And reading a corresponding first coding index Index0 and a second coding index Index1, and a first large probability symbol identifier MPS_CX0 and a second large probability symbol identifier MPS_CX1 respectively corresponding to the first context label CX0 and the second context label CX1.
  • the encoded index array has a capacity of 19x7 bits.
  • CX0 and CX1 have a value range of 0-18, represented by a 5-bit binary bit string.
  • IndexO and Indexl range from 0 to 46, represented by a 6-bit binary string.
  • MPS_CX0 and MPS_CX1 have a value range of 0-1. It is represented by a 1-bit binary bit string.
  • Step S12 Determine the probability type of the pair of double context symbols.
  • the probability of the two context symbol pairs is determined by the relationship between the two large probability symbols obtained in step S11 and the input two context decisions D0, D1.
  • the probability types include the double probability symbol MPSMPS, the large probability/small probability symbol MPSLPS, the small probability/high probability symbol LPSMPS and the double small probability symbol LPSLPS, which are represented by a 2-bit binary bit string.
  • the probability type of the double context symbol pair is determined as a double large probability symbol MPSMPS;
  • the probability type of the double context symbol pair is determined to be a large probability/small probability symbol MPSLPS;
  • the probability type of the double context symbol pair is determined to be a small probability/high probability symbol LPSMPS ;
  • the probability type of the double context symbol pair is determined to be the double small probability symbol LPSLPS.
  • Step S13 Determine the similarity and difference of the context labels according to the input double context label.
  • Step S14 According to the similarity and the same type of the context label and the probability type of the double context symbol pair, the type of the double context symbol pair is determined as follows.
  • the double context symbol pair type is the same as the double large probability symbol
  • the double context symbol pair type is the same as the large probability/small probability symbol
  • the double context symbol pair type is the same as the small probability/large probability symbol
  • the double context symbol pair type is the same as the double small probability symbol
  • the double context symbol pair type is a large probability/small probability symbol different
  • the double context symbol pair type is a small probability/large probability symbol different
  • the double context symbol pair type is a double small probability symbol.
  • Step S2 The probability interval value is updated (step S15 to step S17).
  • step S15 Obtaining two corresponding small probability symbol probability values from the set probability estimation table according to the double coding index obtained in step S11 (step S15), and obtaining the step probability information according to the obtained small probability symbol probability value.
  • the eight types of double context symbol pairs are respectively subjected to probability interval value updating, and the encoding parameters are calculated, the encoding parameters including two probability interval value shift count values and a normalization process identifier (step S16).
  • the updated probability interval value is output (step S17). Thereby, the determination of the probability interval value is ended.
  • step S1 designing a specific probability estimate table PET, according to the first coding index IndexO and the second coding index Index1 obtained in step S1, respectively obtaining the corresponding first small probability symbol probability value QeO and the first from the probability estimation table Two small probability symbol probability value Qel.
  • the probability evaluation table PET designed by the present invention is composed of four sub-tables, which are: (a) a small probability symbol probability value table for storing a small probability symbol probability value Qe;
  • a preamble zero count value table for storing the leading zero count value of the small probability symbol probability value, that is, 16 minus all possible differences of the most significant bit position of the small probability symbol probability value, ranging from 1 to 15.
  • each probability table is represented by a 16-bit binary number, but since the lowest two bits of the probability value given in the standard are "01", and the highest bit is "0". ", therefore, 13 bits can be used for storage, instead of 16 bits to represent a single probability value.
  • each probability value table stores probability values corresponding to 47 indexes, there are cases where the probability values are the same, such as values of Qe [0], Qe [6], Qe [14], Qe [46]. Both are hexadecimal values 0x5601, so only different probability values need to be stored during storage, and each memory cell is located by a simple operation.
  • the depth of both tables is 32, and the width is 13 bits, capacity is 32x13 bits.
  • the table has a depth of 30, a width of 13 bits, and a capacity of 30x13 bits.
  • the table has a depth of 32, a width of 4 bits, and a capacity of 32x4 bits.
  • the specific contents of the probability valuation table are shown in Table 1, Table 2, and Table 3, respectively.
  • the probability interval value update is divided into four different cases, including double large probability symbol probability interval value update, large probability/small probability symbol probability interval value update, small probability/high probability Symbol probability interval value update and double small probability symbol probability interval value update.
  • double large probability symbol probability interval value update large probability/small probability symbol probability interval value update
  • small probability/high probability Symbol probability interval value update small probability/high probability Symbol probability interval value update
  • double small probability symbol probability interval value update For each case, the current probability interval values are updated separately, and the detailed process is shown in Figure 3 to Figure 6:
  • first, the first, second, and third temporary variables are established, and the first small probability symbol probability value QeO and the second small probability symbol probability value Qel are respectively saved to the first temporary variable temp2 and the second In the temporary variable tempO, the difference between the current probability interval value A and the first small probability symbol probability value QeO, that is, A-Qe0, is simultaneously calculated and saved in the third temporary variable tempi;
  • the first, second and third temporary variable values are respectively updated, wherein: for the first temporary variable temp2, if the first temporary variable value is smaller than the hexadecimal value 0x8000, the first temporary variable value is shifted to the left One bit, the process is repeated thereafter until the first temporary variable value is greater than or equal to the hexadecimal value 0x8000; for the second temporary variable tempO, if the distinct tag value is 0, the readout is performed from the probability estimate table A context symbol is a probability value NT_NMPS_QE1 of a large probability symbol, and the second temporary variable value is updated to NT_NMPS_QE1 ; for the third temporary variable tempi, the update process is the same as the first temporary variable temp2;
  • the probability interval temporary variable value A_temp is calculated according to the size of the probability interval value A: If the probability interval value A is greater than or equal to 2xQeO, the relationship between the third temporary variable tempi and the second temporary variable tempO is compared, if tempi is less than 2xtemp0, Bay J A_temp Equivalent to tempO, otherwise, A_temp is equal to templ-tempO; If the probability interval value A is less than 2> ⁇ QeO, the relationship between the first temporary variable temp2 and the second temporary variable tempO is compared, and if temp2 is less than 2xtemp0, then A_temp Equal to tempO, otherwise, A—temp is equal to temp2-temp0;
  • the probability interval temporary variable value A_temp is corrected. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, the probability interval temporary variable value is shifted to the left by one bit, and the judgment process is repeated until the probability The interval temporary variable value is greater than or equal to the hexadecimal value 0x8000; Finally, the probability interval value A is updated, and the probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
  • first, the first, second, and third temporary variables are established, and the first small probability symbol probability value QeO and the second small probability symbol probability value Qel are respectively saved to the first temporary variable temp2 and the second In the temporary variable tempO, the difference between the current probability interval value A and the first small probability symbol probability value QeO, that is, A-Qe0, is simultaneously calculated and saved in the third temporary variable tempi;
  • the first, second and third temporary variable values are respectively updated, wherein: for the first temporary variable temp2, if the first temporary variable value is smaller than the hexadecimal value 0x8000, the first temporary variable value is shifted to the left One bit, the process is repeated thereafter until the first temporary variable value is greater than or equal to the hexadecimal value 0x8000; for the second temporary variable tempO, if the distinct tag value is 0, the readout is performed from the probability estimate table A context symbol is a probability value NT_NMPS_QE1 of a large probability symbol, and the second temporary variable value is updated to NT_NMPS_QE1; for the third temporary variable tempi, the update process is the same as the first temporary variable temp2;
  • the probability interval temporary variable value A_temp is calculated according to the size of the probability interval value A : if the probability interval value A is greater than or equal to 2xQeO, the relationship between the third temporary variable tempi and the second temporary variable tempO is compared, and if tempi is greater than or equal to 2xtemp0, then A—temp is equal to tempO, otherwise, A—temp is equal to templ-tempO; if the probability interval value A is less than 2xQeO, the relationship between the first temporary variable temp2 and the second temporary variable tempO is compared. If temp2 is greater than or equal to 2xtemp0, then A_temp is equal to tempO Otherwise, A_temp is equal to temp2-temp0;
  • the probability interval temporary variable value A_temp is corrected. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, the probability interval temporary variable value is shifted to the left by one bit, and the judgment process is repeated until the probability The interval temporary variable value is greater than or equal to the hexadecimal value 0x8000;
  • the probability interval value A is updated, and the probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
  • the first, second and third temporary variable values are respectively updated, wherein: for the first temporary variable temp2, if the first temporary variable value is smaller than the hexadecimal value 0x8000, the first temporary variable value is shifted to the left One bit, the process is repeated thereafter until the first temporary variable value is greater than or equal to the hexadecimal value 0x8000; for the second temporary variable tempO, if the distinct tag value is 0, the readout is performed from the probability estimate table A context symbol is a probability value NT_NLPS_QE1 of a small probability symbol, and the second temporary variable value is updated to NT_NLPS_QE1; for the third temporary variable tempi, the update process is the same as the first temporary variable temp2;
  • the probability interval temporary variable value A_temp is calculated according to the magnitude of the probability interval value A. If the probability interval value A is less than 2xQeO, the relationship between the third temporary variable tempi and the second temporary variable tempO is compared, if tempi is less than 2xtemp0, the shell I" A_temp is equal to tempO, otherwise, A_temp is equal to templ-tempO; if the probability interval value A is greater than or equal to 2> ⁇ QeO, the relationship between the first temporary variable temp2 and the second temporary variable tempO is compared, if temp2 is less than 2 ⁇ temp0, Bay lj A – temp is equal to tempO, otherwise A_temp is equal to temp2-temp0;
  • the probability interval temporary variable value A_temp is corrected. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, the probability interval temporary variable value is shifted to the left by one bit, and the judgment process is repeated until the probability The interval temporary variable value is greater than or equal to the hexadecimal value 0x8000; finally, the probability interval value A is updated, and the probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
  • first, the first, second, and third temporary variables are established, and the first small probability symbol probability value QeO and the second small probability symbol probability value Qel are respectively saved to the first temporary variable temp2 and the second In the temporary variable tempO, the difference between the current probability interval value A and the first small probability symbol probability value QeO, that is, A-Qe0, is simultaneously calculated and saved in the third temporary variable tempi;
  • the first, second and third temporary variable values are respectively updated, wherein: for the first temporary variable temp2, if the first temporary variable value is smaller than the hexadecimal value 0x8000, the first temporary variable value is shifted to the left One bit, after which the process is repeated until the value of the first temporary variable is greater than or equal to sixteen
  • the second temporary variable tempO if the distinct tag value is 0, the next context symbol is read from the probability estimate table as the probability value NT_NLPS_QE1 of the small probability symbol, and the second is The temporary variable value is updated to NT_NLPS_QE1; for the third temporary variable tempi, the update process is the same as the first temporary variable temp2;
  • the probability interval temporary variable value A_temp is calculated according to the size of the probability interval value A. If the probability interval value A is less than 2xQeO, the relationship between the third temporary variable tempi and the second temporary variable tempO is compared, if tempi is greater than or equal to 2 X tempO , then A_temp is equal to tempO, no shell lj, A_temp is equal to templ-tempO; if the probability interval value A is greater than or equal to 2 ⁇ QeO, the relationship between the first temporary variable temp2 and the second temporary variable tempO is compared, if temp2 is greater than or equal to 2> ⁇ temp0, then A-temp is equal to tempO, no shell lj, A-temp is equal to temp2-temp0;
  • the probability interval temporary variable value A_temp is corrected. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, the probability interval temporary variable value is shifted to the left by one bit, and the judgment process is repeated until the probability The interval temporary variable value is greater than or equal to the hexadecimal value 0x8000; finally, the probability interval value A is updated, and the probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
  • the probability estimation table of the present invention fully considers the relationship between the fields in the probability estimation table, and its capacity is only 1350 bits, whereas the probability estimation table adopted by M.
  • Dyer in the prior art requires 47 X 32.
  • X 2 3008 bits.
  • Step S3 normalizing the code values.
  • the code values are respectively updated correspondingly; according to the probability interval value, the normalization process identifier and the small probability symbol probability value, the current return is determined.
  • a normalization type including zero normalization, single normalization, one type of double normalization, and two types of double normalization; for zero-order normalized type code values, Normalization Rational, there is no corresponding code stream output; for single normalization, one type of double normalization and two types of double normalization type code values, respectively, normalization processing, and generate corresponding single normalization
  • the code stream, a type of double normalized code stream and a second type of double normalized code stream details as follows:
  • Step S31 Read the necessary parameters of the encoding
  • the coding necessary parameters include: a probability interval value A, a normalization process identifier RenormTag, a first probability interval value shift count value NumSLA0, a second probability interval value shift count value NumSLAl, a first small probability symbol probability value QeO, and a second Small probability symbol probability value Qel.
  • the normalization process identifier RenormTag represents the probability type of the pair of double context symbols, that is, 0 indicates a double small probability symbol, 1 indicates a double large probability symbol, 2 indicates a large probability/small probability symbol, and 3 indicates a small probability/large probability symbol.
  • Step S32 Update the code value, and determine the code value left shift count value CT
  • RenormTag is identified according to the input normalization process. If the first context symbol pair is a large probability symbol, that is, the RenormTag is 1 or 2, the sum of the second small probability symbol probability value Qel and the current code value C is calculated, and the code is The value C is updated to the sum value; otherwise, the code value C is kept unchanged;
  • determining the code value left shift count value CT in the following manner, that is, if the code value normalization process is performed on the context symbol pair for the first time, the CT is assigned according to the initialization method given by the JPEG2000 standard, otherwise, the CT is maintained. The value does not change.
  • Step S33 determining the current normalization type
  • Step S331 If the normalization process identifier RenormTag is 1, the double-probability symbol code value normalization type judgment is performed. The detailed process is shown in Figure 8.
  • Step S3311 If the probability interval value A is less than twice the first small probability symbol probability value QeO, step S3312 is performed; otherwise, step S3314 is performed;
  • Step S3312 Adjusting the first small probability symbol probability value QeO, that is, shifting QeO to the left until QeO is greater than or equal to the hexadecimal value 0x8000, if the adjusted first small probability symbol probability value SHIFT_V(Qe0) is smaller than The second small probability symbol probability value Qel is twice, then the normalization type is a type of double normalization, and a type of double normalization type indication is set, otherwise, step S3313 is performed; step S3313: if the adjustment The difference between the first small probability symbol probability value SHIFT_V(Qe0) and the second small probability symbol probability value Qel is less than the hexadecimal value 0x8000, then the normalization type is the second class double normalization, and Set two types of double normalization type indication; otherwise, the normalization type is single normalization, and set a single normalization type indication; Step S3314: If the difference between the probability interval value A and the first small probability symbol probability value QeO is less than the he
  • Step S3315 Adjusting the difference between the probability interval value A and the first small probability symbol probability value QeO, if the adjusted difference SHIFT_V (A-QeO) is less than twice the first small probability symbol probability value QeO, then returning The normalization type is a type of double normalization, and a type of double normalization type indication is set; otherwise, step S3316 is performed;
  • Step S3316 If the adjusted difference SHIFT_V (A-QeO) is smaller than the sum of the second small probability symbol probability value Qel and the hexadecimal value 0x8000, the normalization type is the second class double normalization, and is set. The second type of double normalization type indication; otherwise, the normalization type is single normalization, and a single normalization type indication is set;
  • Step S3317 If the difference between the probability interval value A and the first small probability symbol probability value QeO is less than twice the second small probability symbol probability value Qel, the normalization type is a single normalization, and a single return is set. a type indication; otherwise, step S3318;
  • Step S3318 If the difference between the probability interval value A and the first small probability symbol probability value QeO is smaller than the sum of the second small probability symbol probability value Qel and the hexadecimal value 0x8000, the normalization type is a single normalization. , and set a single normalization type indication; otherwise, the normalization type is zero normalization, and set zero normalization type indication.
  • Step S332 If the normalization process identifier RenormTag is 2, the large probability/small probability symbol code value normalization type judgment is performed. The detailed process is shown in Figure 9.
  • Step S3321 If the probability interval value A is less than twice the first small probability symbol probability value QeO, then step S3322 is performed; otherwise, step S3323 is performed;
  • Step S3322 Adjust the first small probability symbol probability value QeO, that is, shift QeO to the left until QeO is greater than or equal to the hexadecimal value 0x8000. If the adjusted first small probability symbol probability value SHIFT_V(Qe0) is less than twice the second small probability symbol probability value Qel, the normalization type is a second-class double-order normalization, and the second-class double-order is set. Normalized type indication; otherwise, the normalized type is a type of double normalization, and a type of double normalization type indication is set;
  • Step S3323 If the difference between the probability interval value A and the first small probability symbol probability value QeO is less than the hexadecimal value 0x8000, step S3324 is performed; otherwise, the normalization type is single normalization, and a single return is set. a type indication;
  • Step S3324 Performing a difference between the probability interval value A and the first small probability symbol probability value QeO Adjustment, if the adjusted difference SHIFT_V(A-QeO) is less than twice the first small probability symbol probability value QeO, the normalization type is a class of double-order normalization, and a class of double-return is set. The type indication; otherwise, the normalization type is the second-class double normalization, and the second-class double-normalization type indication is set.
  • Step S333 If the normalization process identifier RenormTag is 3, the small probability/high probability symbol code value normalization type judgment is performed. The detailed process is shown in Fig. 10.
  • Step S3331 If the probability interval value A is less than twice the first small probability symbol probability value QeO, step S3332 is performed; otherwise, step S3334 is performed;
  • Step S3332 If the difference between the probability interval value A and the first small probability symbol probability value QeO is adjusted to be less than twice the second small probability symbol probability value Qel, the normalization type is a class of double normalization, And setting a type of double normalization type indication; otherwise, performing step S3333;
  • Step S3333 Adjust the difference between the probability interval value A and the first small probability symbol probability value QeO, if the adjusted difference SHIFT_V (A-QeO) is smaller than the second small probability symbol probability value Qel and hexadecimal value
  • the normalization type is the second-class double-normalization, and the second-class double-normalization type indication is set; otherwise, the normalization type is single normalization, and a single normalization is set.
  • Step S3334 Adjusting the first small probability symbol probability value QeO, if the adjusted first small probability symbol probability value SHIFT_V(Qe0) is less than twice the second small probability symbol probability value Qel, the normalization type For the second-class double-order normalization, and set the second-class double-substitution type indication; otherwise, perform step S3335;
  • Step S3335 If the difference between the adjusted first small probability symbol probability value SHIFT_V(Qe0) and the second small probability symbol probability value Qel is less than the hexadecimal value 0x8000, the normalization type is a class of double times Normalize, and set two types of double normalization type indication; otherwise, the normalization type is a type of double normalization, and set a single normalization type indication.
  • the single normalization type indication in the above step indicates that the code value of the dual context symbol pair is only normalized once, and a type of double normalization type indication and a second type of double normalization type indication indicate that The code value of the double context symbol pair will be normalized twice, and the zero normalization type indication indicates that the code value of the double context symbol pair is not normalized. These four normalized type indications are used to select the corresponding normalization process.
  • Step 34 Normalize according to the normalized type.
  • the single normalization type and the first-order double normalization are respectively
  • the code values under the type and the second-order double normalization type are subjected to corresponding normalization processing, and a corresponding normalized code stream is generated.
  • the code value is subjected to a single normalization process, and the reference figure
  • Step 341 If the first probability interval value shift count value NumSLAO or the second probability interval value shift count value NumSLAl is smaller than the code value left shift count CT, the code value C is shifted to the left by NumSLAO or NumSLAl times, and there is no corresponding single-time normalization. Streaming the stream output, ending the current normalization process; otherwise, performing step 342;
  • Step 342 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set the code value temporary left shift count value NewCT to 7, and then perform step 345; otherwise, execute Step 343;
  • Step 343 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, perform step 344; otherwise, set the code value temporary left shift count value NewCT to 8, and then execute Step 345;
  • Step 344 If the current code value C is greater than or equal to the hexadecimal value 0x8000000, set the code value temporary left shift count value NewCT to 7, otherwise set NewCT to 8; then perform step S345; step 345: code value C left Move NumSLA0-CT times, and then perform step 346;
  • Step 346 If the difference between the first probability interval value shift count value NumSLAO or the second probability interval value shift count value NumSLAl and the code value left shift count value CT is greater than or equal to 0, and is less than the code value temporary left shift count value NewCT, single byte output; otherwise two bytes output.
  • the normalization type is a type of double normalization type
  • a class of double normalization processing is performed. Referring to FIG. 12, the specific implementation is as follows:
  • Step S351 If NumSLA0-CT is less than zero, step S352 is performed; no shell I", step S353 is performed;
  • Step S352 If NumSLAl -(CT-NumSLA0) is less than zero, shift the code value C to the left by NumSLAO+NumSLAl times, and then end the current normalization process; otherwise, the shell lj, execute step S3521;
  • Step S3521 shift the code value C to the left by NumSLAO times, and update NewCT with NewCT-NumSLAO, and then perform step S3522;
  • Step S3522 If NumSLAl-NewCT is greater than or equal to zero, the code value C is left. Move NewCT times, and then perform step S3523; otherwise, end the current normalization process; Step S3523: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT Is 7, then step S3526; otherwise, step S3524;
  • Step S3524 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, step S3525 is performed; otherwise, setting NewCT to 8, performing step S3526;
  • Step S3525 If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3526;
  • Step S3526 If the difference between NumSLAl and CT is smaller than NewCT, then a single byte output is performed, and then the current normalization process is ended; otherwise, two byte outputs are performed, and then the current normalization process is ended;
  • Step S353 shifting the code value C to the left by CT times, and executing step S3531;
  • Step S3531 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT to 7, and execute step S3534; otherwise, execute step S3532: ;
  • Step S3532 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, perform step S3533; otherwise, set NewCT to 8, and perform step S3534;
  • Step S3533 If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; execute step S3534;
  • Step S3534 If the difference between the shift count NumSLAO and the CT is less than NewCT, step S3535 is performed, otherwise step S35310 is performed;
  • Step S3535 If the difference between the NumSLAl minus the CT is less than zero, the single byte output is performed, and then the current normalization process is ended; otherwise, step S3536 is performed;
  • Step S3536 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT to 7, and then execute step S3539; otherwise, execute step S3537;
  • Step S3537 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, step S3538 is performed; otherwise, the NewCT is set to 8, Then step S3539 is performed;
  • Step S3538 If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3539;
  • Step S3539 If the difference between the shift count NumSLAl and the CT is smaller than NewCT, the byte output is performed twice, and then the current normalization process is ended; otherwise, the three-byte output is performed, and then the current normalization process is ended;
  • Step S35310 If the difference between the NumSLAl minus the CT is less than zero, the byte output is performed twice, and then the current normalization process is ended; otherwise, the step S35311 is performed;
  • Step S35311 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT to 7, and then execute step S35314; otherwise, execute step S35312;
  • Step S35312 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value of 0xFE, execute step S35313; otherwise, set NewCT to 8, and then execute step S35314;
  • Step S35313 If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S35314;
  • Step S35314 If the difference between NumSLAl and CT is smaller than NewCT, the output is three bytes, and then the current normalization process is ended; otherwise, the fourth byte output is performed, and then the current normalization process is ended.
  • the normalization type is a second-class double-normalization type
  • the second-class double-order normalization processing is performed. Referring to FIG. 13, the specific implementation is as follows:
  • Step S361 If NumSLAO-CT is less than zero, step S362 is performed; otherwise, step S363 is performed;
  • Step S362 If NumSLAl-(CT-NumSLAO) is less than zero, first shift the code value C to the left by NumSLAO times, and add the left shifted code value to Qel, then shift the sum value to the left by NumSLAl times, and then end the current Normalization process; otherwise, step S3621 is performed;
  • Step S3621 First shift the code value C to the left by NumSLAO times, then update the code value C with the left-shifted code value and the Qel sum value, and update the NewCT with NewCT-NumSLAO, and execute step S3622;
  • Step S3622 If NumSLAl-NewCT is greater than or equal to zero, the code value C is left Shift NewCT times, and then step S3623; otherwise, end the current normalization process; Step S3623: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value of 0xFF, set NewCT Is 7, then step S3626; otherwise, step S3624;
  • Step S3624 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, step S3625 is performed; otherwise, NewCT is set to 8, and then step S3626 is performed;
  • Step S3625 If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3626;
  • Step S3626 If NumSLAl-CT is smaller than NewCT, perform single byte output, and then end the current normalization process, otherwise perform two byte output, and then end the current normalization process;
  • Step S363 shift the code value C to the left by CT times, and then perform step S3631;
  • Step S3631 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value of 0xFF, set NewCT to 7, and then execute step S3634; otherwise, execute step S3632;
  • Step S3632 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, execute step S3633; otherwise, set NewCT to 8, and then execute step S3634;
  • Step S3633 If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3634;
  • Step S3634 If the difference between the NumSLAO and the CT is smaller than the NewCT, first update the code value C with the sum of the code values C and Qel, and then perform step S3635; otherwise, first update the code value with the sum of the code value C and Qel. Then step S36310 is performed;
  • Step S3635 If NumSLAl-CT is less than zero, a single byte output is performed, and then the current normalization process is ended; otherwise, step S3636 is performed;
  • Step S3636 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value of 0xFF, set NewCT to 7, and then execute step S3639; otherwise, execute step S3637;
  • Step S3637 If the last double context symbol pair is the last of the normalized code stream generated One byte is a hexadecimal value OxFE, step S3638 is performed; otherwise, NewCT is set to 8, and then step S3639 is performed;
  • Step S3638 If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3639;
  • Step S3639 If the difference between NumSLAl and CT is smaller than NewCT, perform two bytes of output, and then end the current normalization process; otherwise, perform three-byte output, and then end the current normalization process;
  • Step S36310 If NumSLAl-CT is less than zero, perform two byte output, and then end the current normalization process; otherwise, execute step S36311;
  • Step S36311 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT to 7, and then execute step S36314; otherwise, execute step S36312;
  • Step S36312 If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, step S36313 is performed; otherwise, NewCT is set to 8, and then step S36314 is performed;
  • Step S36313 If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S36314;
  • Step S36314 If the difference between NumSLAl and CT is smaller than NewCT, the output is three bytes, and then the current normalization process is ended; otherwise, the fourth byte output is performed, and then the current normalization process is ended.
  • SHIFT_V(X) indicates that the operand X is shifted to the left until the X value after the left shift is greater than or equal to the hexadecimal value 0x8000.
  • the "previous code stream byte" represents the last byte of the normalized code stream produced by the last double context symbol pair.
  • step S4 the code value is drained.
  • Step S5 classifying the buffer output code stream.
  • Step S51 If the code stream outputs only one byte, write the byte into the first byte buffer to prepare output.
  • Step S52 If the code stream outputs two bytes, the first byte is written into the first byte cache, and the second byte is written into the second byte buffer.
  • Step S53 If the code stream outputs three bytes, the first byte is written into the first byte buffer, the second byte is written into the second byte buffer, and the third byte is written. Into the third byte cache;
  • Step S54 If the code stream outputs four bytes, the first byte is written into the first byte buffer, the second byte is written into the second byte buffer, and the third byte is written. Enter the third byte buffer and write the fourth byte to the fourth byte buffer.
  • Step S6 Output the code stream of the classification cache.
  • the code streams in the first to fourth byte buffers are sequentially read and output, and the arithmetic entropy coding of the dual context symbol pairs is completed.
  • the specific process includes:
  • Step S61 If the first byte buffer is not empty, reading the data of one byte in the first byte buffer and outputting, and then performing step S62; otherwise, directly performing step S62;
  • Step S62 If the second byte buffer is not empty, reading the data of one byte in the second byte buffer and outputting, and then executing step S63; otherwise, directly executing step S63;
  • Step S63 If the third byte buffer is not empty, reading the data of one byte in the third byte buffer and outputting, and then executing step S64; otherwise, directly executing step S64;
  • Step S64 If the fourth byte buffer is not empty, the data of one byte in the fourth byte buffer is read and output, and then step S61 is performed; otherwise, step S65 is directly performed;
  • Step S65 If all the input context symbol pairs have been processed, the entire encoding process is ended, otherwise, the process returns directly to step S61.
  • Table 4 shows the FPGA chip XC2V3000 and Altera using Xilinx respectively.
  • the main technical specifications of the encoding method implemented by the FPGA chip STRATX include the FPGA resource utilization, ie the number of Slice and LC usage, the number of internally occupied memory bits, and the clock frequency and throughput rate associated with the processing speed.
  • the present invention achieves arithmetic entropy coding of dual context symbol pairs in a single clock, with a significant increase in coding speed and efficiency.
  • Table 5 gives a qualitative comparison of the present invention with the prior art in terms of coding speed and implementation complexity. It can be seen that, in terms of processing speed, the present invention and the existing fifth encoding method have the highest processing speed, both of which reach 2 context/clock, but in terms of complexity, the current complexity of the fifth encoding method Significantly higher than the present invention, the internal storage capacity of the method is 8192 bits, while the internal storage capacity of the present invention is only 1509 bits.
  • the present invention significantly improves the encoding speed, enables high-speed real-time encoding processing, and achieves low complexity.

Abstract

A method for processing arithmetic entropy coding in real time at a high-speed based on the Joint Photographic Experts Group (JPEG) 2000 standard is disclosed. The method comprises: a probability interval value determining step, judging a coding symbol type according to two context symbol pairs inputted in parallel, and updating probability interval values and coding parameters according to the coding symbol type; a code value normalization step, updating code values according to the coding symbol type, judging current normalization type and performing normalization according to the updated probability interval values and coding parameters, and outputting a normalization code stream and an emptying code stream; a code stream buffering step, in accordance with the order of code stream output, classifying and buffering the normalization code stream and the emptying code stream respectively according to an amount of output bytes of the normalization code stream and the emptying code stream, and outputting the normalization code stream and the emptying code stream in parallel; and an output step, according to a prescribed priority order, outputting the normalization code stream and the emptying code stream outputted in parallel at the code stream buffering step in serial and in turn.

Description

说 明 书  Description
基于联合图象专家组 (JPEG) 2000标准的高速实时処理算术熵编码方法  High-speed real-time processing arithmetic entropy coding method based on Joint Photographic Experts Group (JPEG) 2000 standard
技术领域 Technical field
本发明涉及一种基于 JPEG2000标准的高速实时处理算术熵编码方法, 用于各种数字设备的图像压缩编码, 特别是高速实时卫星图像压缩编码。 背景技术  The invention relates to a high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard, which is used for image compression coding of various digital devices, in particular high-speed real-time satellite image compression coding. Background technique
随着多媒体和网络技术的发展及其在医学影像、 遥感图像和数字图像 / 视频传输等方面的应用, 已有的静止图像压缩标准 JPEG已不能满足当前实 际应用的要求, 为此国际标准化组织于 2000年 11月制定了新的静止图像压 縮标准 JPEG2000。 该标准的核心技术之一就是采用算术熵编码方法对小波 变换后的数据进行编码, 实现图像数据的压缩处理。  With the development of multimedia and network technologies and their applications in medical imaging, remote sensing imagery and digital image/video transmission, the existing still image compression standard JPEG can no longer meet the requirements of current practical applications, for which the International Organization for Standardization In November 2000, a new still image compression standard JPEG2000 was developed. One of the core technologies of the standard is to use the arithmetic entropy coding method to encode the wavelet transformed data to achieve image data compression processing.
JPEG2000 的基本编码流程可以简单描述为: 首先对输入图像进行离散 小波变换, 小波变换后的数据称为小波系数; 然后以码块为单位对小波系数 进行量化、 编码, 码块的大小通常为 32x32或者 64x64; 在编码过程中, 按 小波系数位平面顺序建立相应上下文模型, 并采用算术熵编码方法对上下文 符号对 CXD进行编码, 从而得到对应码块的编码数据; 最后根据预设的压 縮比,有选择地输出各个码块对应的编码数据,完成对单幅图像的编码处理。  The basic encoding process of JPEG2000 can be simply described as follows: First, the input image is subjected to discrete wavelet transform, and the wavelet transformed data is called wavelet coefficient; then the wavelet coefficients are quantized and encoded in units of code blocks, and the size of the code block is usually 32x32. Or 64x64; In the encoding process, the corresponding context model is established according to the wavelet coefficient bit plane order, and the context symbol pair CXD is encoded by the arithmetic entropy coding method, thereby obtaining the coded data of the corresponding code block; finally, according to the preset compression ratio The coded data corresponding to each code block is selectively outputted, and the encoding process of the single image is completed.
所述的算术熵编码方法的编码原理叙述如下:  The coding principle of the arithmetic entropy coding method is described as follows:
算术熵编码的输入为上下文符号对 CXD,包括上下文标号 CX和上下文 判决 D,其中 CX表示由当前编码像素生成的上下文标号,取值范围为 0-18, D表示对应上下文的判决, 取值范围为 0-1。 对上下文符号对进行算术熵编 码的输出是对应的压缩码流。 在算术熵编码时, 根据输入的上下文标号 CX 自适应地选择相应判决 D的概率,依据判决 D的值得出准备进行编码的符号 值, 即大概率编码符号 MPS和小概率编码符号 LPS, 以及小概率编码符号 LPS对应的概率 Qe,然后调整相应的概率区间值,并输出编码值到码值寄存 器。 该概率区间值采用 16位无符号整数表示, 该码值寄存器为 32位, 并且 划分为 5个不同的字段, 即第 31到 28位表示 4位零数据, 第 27位表示 "进 位"位, 第 26到 19位表示编码输出位, 第 18到 16位表示用于隔断进位传 播的 3位分割位,第 15到 0位表示码值的小数位。对于编码符号的概率 Qe, 算术熵编码器采用一个具有 47个索引的数组实现, 该数组称为概率估计表 PET, 表中每一项对应一个 16位的 LPS符号的 Qe值。 依据 JPEG2000标准 的规定, 将当前编码符号对应的上下文标号 CX作为地址来访问一个大小为 19 X 6的数组,得到概率估计表 PET的入口索引 Index,然后以 Index为地址 读取 PET表中对应 LPS符号概率值 Qe, 并结合当前概率区间值和码值判定 具体编码的过程。 如果当前概率区间值小于等于 0.75, 该值对应于十六进制 下为 0x8000, 为了防止溢出, 需要对概率区间值和码值进行归一化处理, 通 过左移概率区间值和码值使概率区间大于 0x8000。在归一化的同时, 如果码 值中码流组成整字节, 则进行码流输出过程, 即得到最终的编码输出码流。 为了防止进位传递, 通过设置特定的比特位填充以截断进位的传递。 The input of the arithmetic entropy coding is a context symbol pair CXD, including a context label CX and a context decision D, where CX represents a context label generated by the current coded pixel, and the value ranges from 0 to 18, and D represents a decision of the corresponding context, and the value range is It is 0-1. The output of the arithmetic entropy encoding of the context symbol pair is the corresponding compressed code stream. In the arithmetic entropy coding, the probability of the corresponding decision D is adaptively selected according to the input context label CX, and the symbol values to be encoded according to the judgment D are prepared, that is, the high probability coding symbol MPS and the small probability coding symbol LPS, and small Probability encodes the probability Qe corresponding to the symbol LPS, then adjusts the corresponding probability interval value, and outputs the encoded value to the code value register. The probability interval value is represented by a 16-bit unsigned integer, which is 32 bits and is divided into 5 different fields, that is, bits 31 to 28 represent 4-bit zero data, and bit 27 represents "into Bit "bit, bits 26 to 19 indicate the coded output bits, bits 18 to 16 indicate the 3-bit division bits used to block the carry propagation, and bits 15 to 0 represent the decimal places of the code value. For the probability Qe of the coded symbols, The arithmetic entropy encoder is implemented by an array of 47 indexes, which is called a probability estimation table PET, and each item in the table corresponds to a Qe value of a 16-bit LPS symbol. According to the JPEG2000 standard, the current coding symbol is corresponding. The context label CX serves as an address to access an array of size 19 X 6 to obtain an entry index Index of the probability estimation table PET, and then reads the corresponding LPS symbol probability value Qe in the PET table by using the Index as the address, and combines the current probability interval value. And the code value determines the specific coding process. If the current probability interval value is less than or equal to 0.75, the value corresponds to 0x8000 in hexadecimal. In order to prevent overflow, the probability interval value and the code value need to be normalized, by left The probability interval value and the code value make the probability interval larger than 0x8000. At the same time of normalization, if the code stream forms a whole byte in the code value, the code stream output process is performed, that is, Final encoded output stream. To prevent carry propagation, by setting specific bits are filled into the transfer position to intercept.
作为如上所述的算术编码方法, 例如公开了如下技术:  As the arithmetic coding method as described above, for example, the following technique is disclosed:
( 1 )中国台湾学者 K.-K. Ong和 Jen-Shiun Chiang分别在 2002年 Int. Conf. Image Process. 禾卩 2004年 IEEE Int. Symp. Circuits and Systems国际会 议上发表的文章 "A high throughput low cost context-based adaptive arithmetic codec for multiple standards "(2002, vol.1, pp.1872— 1875 )和" High-speeds EBCOT with dual context- modeling coding architecture for JPEG2000 " ( 2004, vol. 3, pp. 865-868. )中提出的高速算术熵编码方法,其中按照单一的上下文符号对进行 概率区间值的更新处理以及码值的归一化处理, 使得其吞吐率均为单个时钟 处理 1个上下文符号对。  (1) Chinese Taiwan scholars K.-K. Ong and Jen-Shiun Chiang, respectively, at the 2002 Int. Conf. Image Process. He Wei 2004 IEEE Int. Symp. Circuits and Systems International Conference "A high throughput" Low cost context-based adaptive arithmetic codec for multiple standards "(2002, vol.1, pp.1872 - 1875) and "High-speeds EBCOT with dual context- modeling coding architecture for JPEG2000" (2004, vol. 3, pp. The high-speed arithmetic entropy coding method proposed in 865-868.), wherein the update process of the probability interval value and the normalization of the code value are performed according to a single context symbol pair, so that the throughput rate is one context symbol for a single clock. Correct.
( 2 )国内学者梅魁志等人在 2007年 IEEE Trans, on Circuits and System for Video Technology 期刊上发表的文章 " VLSI Design of a High-Speed and Area-Efficient JPEG2000 Encoder" (2007年第 17卷, 第 8期, 第 1065- 1078 页) 中给出的算术熵编码方法, 其中虽然采用多输入同步流水技术实现算数 熵编码, 但也是基于单个上下文符号对进行概率区间值的更新处理以及码值 的归一化处理, 其整体处理速度只有单个时钟处理 0.625个上下文符号对,编 码速度低。  (2) The article "VLSI Design of a High-Speed and Area-Efficient JPEG2000 Encoder" published by domestic scholar Mei Kuizhi and others in the IEEE Trans, on Circuits and System for Video Technology 2007 (Vol. 17, 2007, The arithmetic entropy coding method given in the eighth issue, pages 1065-1078, in which the arithmetic entropy coding is implemented by the multi-input synchronous pipeline technique, but the update of the probability interval value and the code value are also based on a single context symbol pair. Normalized processing, the overall processing speed is only 0.625 context symbol pairs processed by a single clock, and the encoding speed is low.
( 3 ) 国内学者许超在 2005年 Conf. Image Process. (ICIP'05) 国际会 议上发表的文章 "A Dual-Symbol Coding Arithmetic Coder Architecture Design for High Speed EBCOT Coding Engine in JPEG2000 "中给出的算术熵编码方 法, 在两个上下文符号对的上下文标号不同时, 概率区间值的更新处理以及 码值的归一化处理的速度达到单个时钟处理 2个上下文符号对, 但是在两个 上下文符号对的上下文标号相同时, 无法并行处理两个上下文符号对的概率 区间值的更新, 使得后续对码值进行归一化也只能串行处理, 造成了整个编 码处理的停顿, 其处理能力仅为每时钟处理 1个上下文符号对。 (3) Domestic expert Xu Chao's article at the 2005 Conf. Image Process. (ICIP'05) International Conference "A Dual-Symbol Coding Arithmetic Coder Architecture Design For High Speed EBCOT Coding Engine in JPEG2000 "The arithmetic entropy coding method is given. When the context labels of two context symbol pairs are different, the update processing of the probability interval value and the normalization processing of the code value reach a single clock processing. Two context symbol pairs, but when the context labels of the two context symbol pairs are the same, the update of the probability interval values of the two context symbol pairs cannot be processed in parallel, so that the subsequent normalization of the code values can only be processed serially. This caused a pause in the entire encoding process, and its processing power is only one context symbol pair per clock.
(4) 澳大利亚学者 M. Dyer在 2006年 IEEE Transactions on Circuits and Systems-I: Regular Papers 期干 ll发表的文章 " Concurrency Techniques for Arithmetic Coding in JPEG2000 " (vol. 53, no. 6, pp. 1203-1213, June 2006 ) 中 描述的高速算术熵编码方法, 该方法可以实现双上下文符号对并行处理, 但 所需的内部存储位都较多, 对芯片设计造成一定困难。  (4) Australian scholar M. Dyer published in 2006 IEEE Transactions on Circuits and Systems-I: Regular Papers article "Concurrency Techniques for Arithmetic Coding in JPEG2000" (vol. 53, no. 6, pp. 1203- The high-speed arithmetic entropy coding method described in 1213, June 2006), which can implement parallel processing of dual context symbol pairs, but requires more internal memory bits, which poses certain difficulties for chip design.
如上所述, 以往的算术熵编码方法存在如下问题: 若实现复杂度较低, 则处理速度也较低; 若提高处理速度, 则实现复杂度随之急剧增加。 发明内容  As described above, the conventional arithmetic entropy coding method has the following problems: If the implementation complexity is low, the processing speed is also low; if the processing speed is increased, the implementation complexity is drastically increased. Summary of the invention
本发明是鉴于以上问题而作出的, 其目的在于避免上述已有技术的不足, 提供一种基于 JPEG2000标准的高速实时处理算术熵编码方法,以实现在保持 复杂度不变的条件下提高编码系统的处理速度。  The present invention has been made in view of the above problems, and an object thereof is to avoid the above-mentioned deficiencies of the prior art, and to provide a high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard, so as to improve the coding system while maintaining the same complexity. Processing speed.
为了实现上述目的, 本发明的基于 JPEG2000标准的高速实时处理算术 熵编码方法, 其特征在于, 包括: 概率区间值确定步骤, 根据并行输入的两 个上下文符号对, 判断编码符号类型, 并根据该编码符号类型, 对概率区间 值与编码参数进行更新; 码值归一化步骤, 根据上述编码符号类型对码值进 行更新, 根据更新后的概率区间值以及编码参数, 判断当前归一化类型并进 行归一化处理, 并且, 输出归一化码流和排空码流; 码流缓存步骤, 按照码 流输出的先后顺序, 根据上述归一化码流和排空码流的输出字节数, 对上述 归一化码流和排空码流分别进行分类缓存, 并且并行输出; 以及输出步骤, 将在上述码流缓存步骤中并行输出的上述归一化码流和排空码流按照规定的  In order to achieve the above object, a high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard of the present invention includes: a probability interval value determining step of determining a coded symbol type according to two context symbol pairs input in parallel, and according to the Encoding symbol type, updating the probability interval value and the encoding parameter; the code value normalization step, updating the code value according to the above coding symbol type, determining the current normalization type according to the updated probability interval value and the coding parameter Performing normalization processing, and outputting the normalized code stream and the empty code stream; the code stream buffering step, according to the order of output of the code stream, according to the outputted byte number of the normalized code stream and the empty code stream And respectively classifying and buffering the normalized code stream and the empty code stream, and outputting in parallel; and outputting, according to the normalized code stream and the empty code stream output in parallel in the code stream buffer step of
附图说明 图 1是本发明的算术熵编码方法的流程图。 DRAWINGS 1 is a flow chart of an arithmetic entropy coding method of the present invention.
图 2是本发明的概率区间值确定处理的详细流程图。  Fig. 2 is a detailed flowchart of the probability interval value determining process of the present invention.
图 3是本发明的双大概率符号概率区间值更新子流程图。  3 is a flow chart of the double-probability symbol probability interval value update subroutine of the present invention.
图 4是本发明的大概率 /小概率符号概率区间值更新子流程图。  4 is a flow chart of the high probability/small probability symbol probability interval value update subroutine of the present invention.
图 5是本发明的小概率 /大概率符号概率区间值更新子流程图。  Figure 5 is a flow chart showing the small probability/high probability symbol probability interval value update subroutine of the present invention.
图 6是本发明的双小概率符号概率区间值更新子流程图。  6 is a flow chart of the double small probability symbol probability interval value update subroutine of the present invention.
图 7是本发明的归一化方法的详细流程图。  Figure 7 is a detailed flow chart of the normalization method of the present invention.
图 8是本发明的双大概率符号码值归一化类型判断子流程图。  Figure 8 is a flow chart of the double-high probability symbol code value normalization type judgment sub-routine of the present invention.
图 9是本发明的大概率 /小概率符号码值归一化类型判断子流程图。  Fig. 9 is a flow chart showing the judgment of the large probability/small probability symbol code value normalization type of the present invention.
图 10是本发明的小概率 /大概率符号码值归一化类型判断子流程图。  Fig. 10 is a flow chart showing the small probability/high probability symbol code value normalization type judgment sub-render of the present invention.
图 11是本发明的单次归一化处理子流程图。  Figure 11 is a flow chart of the single normalization process of the present invention.
图 12是本发明的一类双次归一化处理子流程图。  Figure 12 is a flow chart of a type of double normalization process of the present invention.
图 13是本发明的二类双次归一化处理子流程图。  Figure 13 is a flow chart of the second-class double normalization process of the present invention.
图 14是本发明的分类缓存输出码流的动作的详细流程图;  14 is a detailed flowchart of the operation of the classification buffer output code stream of the present invention;
图 15是本发明的输出分类缓存的码流的动作的详细流程图。 具体实施方式  Figure 15 is a detailed flow chart showing the operation of the code stream of the output classification buffer of the present invention. detailed description
本发明的编码方法采用 Xilinx ISE 9.1集成开发软件和 VHDL、 Verilog HDL语言, 在 Xilinx公司的型号为 XC2V3000-6BG728的 FPGA上实现。  The encoding method of the present invention is implemented on Xilinx's model XC2V3000-6BG728 using Xilinx ISE 9.1 integrated development software and VHDL, Verilog HDL language.
以下参照图 1, 说明本发明的基于 JPEG2000标准的高速实时处理算术 熵编码方法。 图 1是上述算术熵编码方法的流程图。  The high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard of the present invention will be described below with reference to FIG. 1 is a flow chart of the above arithmetic entropy encoding method.
如图 1所示, 本发明的算术编码方法包括: 步骤 Sl, 判断双上下文符号 对的类型; 步骤 S2, 概率区间值更新; 歩骤 S3 , 对码值进行归一化处理; 步骤 S4: 对码值进行排空处理; 步骤 S5, 分类缓存输出码流; 以及步骤 S6: 以及输出分类缓存的码流。 其中, 步骤 S1和步骤 S2构成概率区间值确定步 骤, 歩骤 S3以及歩骤 S4构成码值归一化歩骤。  As shown in FIG. 1, the arithmetic coding method of the present invention includes: Step S1, determining a type of a double context symbol pair; Step S2, updating a probability interval value; Step S3, normalizing the code value; Step S4: The code value is subjected to the emptying process; step S5, the classifying buffer outputs the code stream; and step S6: and outputting the code stream of the classifying buffer. Step S1 and step S2 constitute a probability interval value determining step, and step S3 and step S4 form a code value normalization step.
以下, 参照图 2〜图 15说明上述各歩骤的动作。  Hereinafter, the operation of each of the above steps will be described with reference to Figs. 2 to 15 .
(概率区间值确定)  (probability interval value determination)
步骤 S1 , 判断双上下文符号对的类型。  Step S1, determining the type of the double context symbol pair.
步骤 S11 : 读取双编码索引和双大概率符号标识。 同时输入第一上下文符号对 (CX0, DO) 和第二上下文符号对 (CX1 , D1 ),分别以第一上下文标号 CX0和第二上下文标号 CX1作为地址,从预先 设定好的编码索引数组中读取对应的第一编码索引 IndexO和第二编码索引 Index 1 , 以及第一上下文标号 CX0和第二上下文标号 CX1分别对应的第一 大概率符号标识 MPS_CX0和第二大概率符号标识 MPS— CX1。 该编码索引 数组的容量为 19x7位。 CX0和 CX1的取值范围是 0-18, 用 5位二进制位串 表示, IndexO和 Indexl取值范围是 0-46,用 6位二进制位串表示, MPS_CX0 和 MPS_CX1取值范围是 0-1, 用 1位二进制位串表示。 Step S11: reading the double-encoded index and the double-large probability symbol identifier. Simultaneously inputting a first context symbol pair (CX0, DO) and a second context symbol pair (CX1, D1), respectively, using the first context label CX0 and the second context label CX1 as addresses, from a preset array of encoded indices And reading a corresponding first coding index Index0 and a second coding index Index1, and a first large probability symbol identifier MPS_CX0 and a second large probability symbol identifier MPS_CX1 respectively corresponding to the first context label CX0 and the second context label CX1. The encoded index array has a capacity of 19x7 bits. CX0 and CX1 have a value range of 0-18, represented by a 5-bit binary bit string. IndexO and Indexl range from 0 to 46, represented by a 6-bit binary string. MPS_CX0 and MPS_CX1 have a value range of 0-1. It is represented by a 1-bit binary bit string.
步骤 S12: 确定双上下文符号对的概率类型。  Step S12: Determine the probability type of the pair of double context symbols.
通过步骤 S11得到的两个大概率符号标识与输入的两个上下文判决 D0、 D1之间的关系,确定双上下文符号对的概率类型。该概率类型包括双大概率 符号 MPSMPS、 大概率 /小概率符号 MPSLPS、 小概率 /大概率符号 LPSMPS 和双小概率符号 LPSLPS这四种情况, 采用 2位二进制位串表示。  The probability of the two context symbol pairs is determined by the relationship between the two large probability symbols obtained in step S11 and the input two context decisions D0, D1. The probability types include the double probability symbol MPSMPS, the large probability/small probability symbol MPSLPS, the small probability/high probability symbol LPSMPS and the double small probability symbol LPSLPS, which are represented by a 2-bit binary bit string.
如果第一大概率符号标识 MPS_CX0与第一判决 DO相等, 并且第二大概 率符号标识 MPS— CX1与第二判决 D1相等,则双上下文符号对的概率类型确 定为双大概率符号 MPSMPS;  If the first large probability symbol identifier MPS_CX0 is equal to the first decision DO, and the second approximate rate symbol identifier MPS_CX1 is equal to the second decision D1, the probability type of the double context symbol pair is determined as a double large probability symbol MPSMPS;
如果第一大概率符号标识 MPS_CX0与第一判决 D0相等, 而第二大概率 符号标识 MPS_CX1与第二判决 D1不相等,则双上下文符号对的概率类型确 定为大概率 /小概率符号 MPSLPS;  If the first large probability symbol identifier MPS_CX0 is equal to the first decision D0, and the second large probability symbol identifier MPS_CX1 is not equal to the second decision D1, the probability type of the double context symbol pair is determined to be a large probability/small probability symbol MPSLPS;
如果第一大概率符号标识 MPS_CX0与第一判决 D0不相等, 而第二大概 率符号标识 MPS— CX1与第二判决 D1相等,则双上下文符号对的概率类型确 定为小概率 /大概率符号 LPSMPS;  If the first large probability symbol identifier MPS_CX0 is not equal to the first decision D0, and the second large probability symbol identifier MPS_CX1 is equal to the second decision D1, the probability type of the double context symbol pair is determined to be a small probability/high probability symbol LPSMPS ;
如果第一大概率符号标识 MPS— CX0与第一判决 D0不相等, 并且第二 大概率符号标识 MPS_CX1与第二判决 D1不相等, 则双上下文符号对的概 率类型确定为双小概率符号 LPSLPS。  If the first large probability symbol identification MPS_CX0 is not equal to the first decision D0, and the second large probability symbol identification MPS_CX1 is not equal to the second decision D1, the probability type of the double context symbol pair is determined to be the double small probability symbol LPSLPS.
歩骤 S13: 根据输入的双上下文标号, 确定上下文标号的异同。  Step S13: Determine the similarity and difference of the context labels according to the input double context label.
如果第一上下文标号 CX0与第二上下文标号 CX1相等, 则判定为双上下 文标号相同, 否则, 判定为双上下文标号相异。 双上下文标号的异同采用相 异标记 DIFF来标识, DIFF的取值范围是 0-1, 用 1位二进制位串表示。如果 双上下文标号相同, 则设置相异标记 DIFF为 0, 否则设为 1。 歩骤 S14: 根据上下文标号的异同和双上下文符号对的概率类型, 按如 下方法判断双上下文符号对的类型。 If the first context label CX0 is equal to the second context label CX1, it is determined that the double context labels are the same, otherwise, it is determined that the double context labels are different. The similarities and differences of the double context labels are identified by the distinct label DIFF. The range of DIFF is 0-1, which is represented by a 1-bit binary string. If the double context labels are the same, set the distinct flag DIFF to 0, otherwise set to 1. Step S14: According to the similarity and the same type of the context label and the probability type of the double context symbol pair, the type of the double context symbol pair is determined as follows.
( 1 )如果两个上下文标号相同,且双上下文符号对的概率类型为双大概 率符号, 则双上下文符号对类型为双大概率符号相同;  (1) If the two context labels are the same and the probability type of the double context symbol pair is a double probability symbol, the double context symbol pair type is the same as the double large probability symbol;
(2)如果两个上下文标号相同,且双上下文符号对的概率类型为大概率 /小概率符号, 则双上下文符号对类型为大概率 /小概率符号相同;  (2) If the two context labels are the same, and the probability type of the double context symbol pair is a large probability/small probability symbol, the double context symbol pair type is the same as the large probability/small probability symbol;
( 3 )如果两个上下文标号相同,且双上下文符号对的概率类型为小概率 /大概率符号, 则双上下文符号对类型为小概率 /大概率符号相同;  (3) If the two context labels are the same and the probability type of the double context symbol pair is a small probability/large probability symbol, the double context symbol pair type is the same as the small probability/large probability symbol;
(4)如果两个上下文标号相同,且双上下文符号对的概率类型为双小概 率符号, 则双上下文符号对类型为双小概率符号相同;  (4) If the two context labels are the same, and the probability type of the double context symbol pair is a double small probability symbol, the double context symbol pair type is the same as the double small probability symbol;
(5 )如果两个上下文标号相异,且双上下文符号对的概率类型为双大概 率符号, 则双上下文符号对类型为双大概率符号相异;  (5) If the two context labels are different, and the probability type of the double context symbol pair is a double-probability symbol, the double-context symbol pair type is double-probability symbol different;
(6)如果两个上下文标号相异,且双上下文符号对的概率类型为大概率 /小概率符号, 则双上下文符号对类型为大概率 /小概率符号相异;  (6) If the two context labels are different, and the probability type of the double context symbol pair is a large probability/small probability symbol, the double context symbol pair type is a large probability/small probability symbol different;
(7 )如果两个上下文标号相异,且双上下文符号对的概率类型为小概率 /大概率符号, 则双上下文符号对类型为小概率 /大概率符号相异;  (7) If the two context labels are different, and the probability type of the double context symbol pair is a small probability/large probability symbol, the double context symbol pair type is a small probability/large probability symbol different;
(8 )如果两个上下文标号相异,且双上下文符号对的概率类型为双小概 率符号, 则双上下文符号对类型为双小概率符号相异。  (8) If the two context labels are different and the probability type of the double context symbol pair is a double small probability symbol, the double context symbol pair type is a double small probability symbol.
步骤 S2: 更新概率区间值 (步骤 S15~步骤 S17)。  Step S2: The probability interval value is updated (step S15 to step S17).
根据步骤 S11得到的双编码索引, 从设定的概率估值表中, 分别读取对应 的两个小概率符号概率值 (步骤 S15 ), 根据得到的小概率符号概率值, 对步 骤 S14得到的 8种类型的双上下文符号对, 分别进行概率区间值更新, 并计 算编码参数, 该编码参数包括两个概率区间值移位计数值和归一化过程标识 (步骤 S16)。 最后, 输出更新后的概率区间值(步骤 S17)。 由此, 结束概率 区间值的确定。  Obtaining two corresponding small probability symbol probability values from the set probability estimation table according to the double coding index obtained in step S11 (step S15), and obtaining the step probability information according to the obtained small probability symbol probability value. The eight types of double context symbol pairs are respectively subjected to probability interval value updating, and the encoding parameters are calculated, the encoding parameters including two probability interval value shift count values and a normalization process identifier (step S16). Finally, the updated probability interval value is output (step S17). Thereby, the determination of the probability interval value is ended.
下面, 对该概率区间值更新处理进行详细的说明。  Next, the probability interval value update processing will be described in detail.
(A) 设计特定的概率估值表 PET, 根据步骤 S1 得到的第一编码索引 IndexO和第二编码索引 Indexl , 从该概率估值表中分别得到对应的第一小概 率符号概率值 QeO及第二小概率符号概率值 Qel。  (A) designing a specific probability estimate table PET, according to the first coding index IndexO and the second coding index Index1 obtained in step S1, respectively obtaining the corresponding first small probability symbol probability value QeO and the first from the probability estimation table Two small probability symbol probability value Qel.
本发明设计的概率估值表 PET由四个子表构成, 分别为: (a) 小概率符号概率值表, 用于存储小概率符号概率值 Qe; The probability evaluation table PET designed by the present invention is composed of four sub-tables, which are: (a) a small probability symbol probability value table for storing a small probability symbol probability value Qe;
(b)下一个上下文符号为大概率符号的概率值表,用于存储下一个上下 文符号为大概率符号的概率值 NT_NMPS— QE1;  (b) a probability value table in which the next context symbol is a large probability symbol, and is used to store a probability value of the next upper and lower symbol as a large probability symbol NT_NMPS_QE1;
(c)下一个上下文符号为小概率符号的概率值表,用于存储下一个上下 文符号为小概率符号的概率值 NT_NLPS— QE1;  (c) a probability value table in which the next context symbol is a small probability symbol, and is used to store a probability value of the next upper and lower text symbol as a small probability symbol NT_NLPS_QE1;
(d)前导零计数值表,用于存储小概率符号概率值的前导零计数值, 即 16减去小概率符号概率值最高有效位位置的所有可能的差值,其取值范围从 1到 15。  (d) a preamble zero count value table for storing the leading zero count value of the small probability symbol probability value, that is, 16 minus all possible differences of the most significant bit position of the small probability symbol probability value, ranging from 1 to 15.
根据 JPEG2000标准规定,对每一个概率值表中的概率均采用一个 16位 的二进制数表示,但是由于标准中给出的概率值的最低两位均为 "01", 并且 最高位均为 "0", 因此在存储时可以采用 13位, 而不是 16位表示单一的概 率值。此外, 虽然 JPEG2000标准规定每一个概率值表存储 47个索引对应的 概率值, 但是存在概率值相同的情况, 例如 Qe [0]、 Qe[6]、 Qe[14]、 Qe[46] 的值均为十六进制值 0x5601, 因此在存储时仅需要存储不同的概率值, 而通 过简单的运算定位到每一个存储单元。  According to the JPEG2000 standard, the probability in each probability table is represented by a 16-bit binary number, but since the lowest two bits of the probability value given in the standard are "01", and the highest bit is "0". ", therefore, 13 bits can be used for storage, instead of 16 bits to represent a single probability value. In addition, although the JPEG2000 standard specifies that each probability value table stores probability values corresponding to 47 indexes, there are cases where the probability values are the same, such as values of Qe [0], Qe [6], Qe [14], Qe [46]. Both are hexadecimal values 0x5601, so only different probability values need to be stored during storage, and each memory cell is located by a simple operation.
对小概率符号概率值表和下一个上下文符号为大概率符号的概率值表, 由于这两个表中仅有 32个不同的概率值, 因此这两个表的深度均为 32, 宽 度均为 13位, 容量均为 32x13位。 对下一个上下文符号为小概率符号的概 率值表, 由于该表中仅有 30个不同的概率值, 故该表的深度为 30, 宽度为 13位, 容量为 30x13位。对于前导零计数表, 由于每一个前导零计数值需要 用 4位表示, 故该表的深度为 32, 宽度为 4位, 容量为 32x4位。  For the probability table of the small probability symbol probability value table and the next context symbol for the large probability symbol, since there are only 32 different probability values in the two tables, the depth of both tables is 32, and the width is 13 bits, capacity is 32x13 bits. For the probability table whose next context symbol is a small probability symbol, since there are only 30 different probability values in the table, the table has a depth of 30, a width of 13 bits, and a capacity of 30x13 bits. For the leading zero count table, since each leading zero count value needs to be represented by 4 bits, the table has a depth of 32, a width of 4 bits, and a capacity of 32x4 bits.
综合起来,概率估值表的总容量为 32x13+32x13+30x13+32x4=1350位。 该概率估值表的具体内容分别如表 1、 表 2、 表 3所示。  Taken together, the total capacity of the probability estimate table is 32x13 + 32x13 + 30x13 + 32x4 = 1350 bits. The specific contents of the probability valuation table are shown in Table 1, Table 2, and Table 3, respectively.
小概率符号概率值子表和前导零计数子表  Small probability symbol probability value subtable and leading zero count subtable
Figure imgf000009_0001
Figure imgf000010_0001
Figure imgf000009_0001
Figure imgf000010_0001
6 6
Figure imgf000011_0001
l78S080/0l0ZN3/X3d οτ
Figure imgf000011_0001
l78S080/0l0ZN3/X3d Οτ
Figure imgf000012_0001
Figure imgf000012_0001
褂 索褂、「/^ ¾:^丄丁 —丄 ε¾
Figure imgf000012_0002
褂索褂, "/^ 3⁄4:^丄丁-丄ε3⁄4
Figure imgf000012_0002
l78S080/0l0ZN3/X3d 21 0xA8 l78S080/0l0ZN3/X3d 21 0xA8
22 0x88  22 0x88
23 0x50  23 0x50
24 0x44  24 0x44
25 0x21  25 0x21
26 0x12  26 0x12
27 0x9  27 0x9
28 0x5  28 0x5
29 0x2  29 0x2
(B ) 根据双上下文符号对的类型, 将概率区间值更新分为四种不同的 情况, 包括双大概率符号概率区间值更新、大概率 /小概率符号概率区间值更 新、小概率 /大概率符号概率区间值更新和双小概率符号概率区间值更新。对 每一种情况, 分别更新当前概率区间值, 其详细过程表示在图 3~图 6:  (B) According to the type of double context symbol pair, the probability interval value update is divided into four different cases, including double large probability symbol probability interval value update, large probability/small probability symbol probability interval value update, small probability/high probability Symbol probability interval value update and double small probability symbol probability interval value update. For each case, the current probability interval values are updated separately, and the detailed process is shown in Figure 3 to Figure 6:
(a)双大概率符号概率区间值更新的过程如下:  (a) The process of updating the probability interval value of the double probability symbol is as follows:
如图 3所示, 首先, 建立第一、第二和第三临时变量, 将第一小概率符号 概率值 QeO和第二小概率符号概率值 Qel, 分别保存到第一临时变量 temp2 和第二临时变量 tempO中, 同时计算当前概率区间值 A与第一小概率符号概 率值 QeO的差值, 即 A-Qe0, 并将其保存到第三临时变量 tempi中;  As shown in FIG. 3, first, the first, second, and third temporary variables are established, and the first small probability symbol probability value QeO and the second small probability symbol probability value Qel are respectively saved to the first temporary variable temp2 and the second In the temporary variable tempO, the difference between the current probability interval value A and the first small probability symbol probability value QeO, that is, A-Qe0, is simultaneously calculated and saved in the third temporary variable tempi;
其次, 分别更新第一、 第二和第三临时变量值, 其中: 对第一临时变量 temp2, 如果该第一临时变量值小于十六进制值 0x8000, 则将该第一临时变 量值左移一位, 此后重复该过程, 直到该第一临时变量值大于或等于十六进 制值 0x8000; 对第二临时变量 tempO, 如果相异标记值为 0, 则从概率估值 表中读出下一个上下文符号为大概率符号的概率值 NT— NMPS— QE1 , 并将该 第二临时变量值更新为 NT— NMPS_QE1 ; 对第三临时变量 tempi, 其更新过 程与第一临时变量 temp2相同; Secondly, the first, second and third temporary variable values are respectively updated, wherein: for the first temporary variable temp2, if the first temporary variable value is smaller than the hexadecimal value 0x8000, the first temporary variable value is shifted to the left One bit, the process is repeated thereafter until the first temporary variable value is greater than or equal to the hexadecimal value 0x8000; for the second temporary variable tempO, if the distinct tag value is 0, the readout is performed from the probability estimate table A context symbol is a probability value NT_NMPS_QE1 of a large probability symbol, and the second temporary variable value is updated to NT_NMPS_QE1 ; for the third temporary variable tempi, the update process is the same as the first temporary variable temp2;
再次,按照概率区间值 A的大小计算概率区间临时变量值 A_temp: 如 果概率区间值 A大于或等于 2xQeO, 比较第三临时变量 tempi与第二临时变 量 tempO的关系, 若 tempi小于 2xtemp0, 贝 J A_temp等于 tempO, 否则, A— temp等于 templ-tempO; 如果概率区间值 A小于 2><QeO, 比较第一临时变 量 temp2与第二临时变量 tempO的关系, 若 temp2小于 2xtemp0, 则 A— temp 等于 tempO, 否则, A— temp等于 temp2-temp0; Again, the probability interval temporary variable value A_temp is calculated according to the size of the probability interval value A: If the probability interval value A is greater than or equal to 2xQeO, the relationship between the third temporary variable tempi and the second temporary variable tempO is compared, if tempi is less than 2xtemp0, Bay J A_temp Equivalent to tempO, otherwise, A_temp is equal to templ-tempO; If the probability interval value A is less than 2><QeO, the relationship between the first temporary variable temp2 and the second temporary variable tempO is compared, and if temp2 is less than 2xtemp0, then A_temp Equal to tempO, otherwise, A—temp is equal to temp2-temp0;
然后, 修正概率区间临时变量值 A— temp , 如果概率区间临时变量值 A— temp小于十六进制值 0x8000, 则将该概率区间临时变量值左移一位, 重复 该判断过程, 直到该概率区间临时变量值大于或等于十六进制值 0x8000; 最后, 更新概率区间值 A, 将概率区间值 A更新为修正后的概率区间临 时变量值 A— temp。  Then, the probability interval temporary variable value A_temp is corrected. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, the probability interval temporary variable value is shifted to the left by one bit, and the judgment process is repeated until the probability The interval temporary variable value is greater than or equal to the hexadecimal value 0x8000; Finally, the probability interval value A is updated, and the probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
(b ) 按照如下过程对大概率 /小概率符号概率区间值进行更新:  (b) Update the probability/interval probability interval values for large probability/small probability symbols as follows:
如图 4所示, 首先, 建立第一、 第二和第三临时变量, 将第一小概率符 号概率值 QeO和第二小概率符号概率值 Qel,分别保存到第一临时变量 temp2 和第二临时变量 tempO中, 同时计算当前概率区间值 A与第一小概率符号概 率值 QeO的差值, 即 A-Qe0, 并将其保存到第三临时变量 tempi中;  As shown in FIG. 4, first, the first, second, and third temporary variables are established, and the first small probability symbol probability value QeO and the second small probability symbol probability value Qel are respectively saved to the first temporary variable temp2 and the second In the temporary variable tempO, the difference between the current probability interval value A and the first small probability symbol probability value QeO, that is, A-Qe0, is simultaneously calculated and saved in the third temporary variable tempi;
其次, 分别更新第一、 第二和第三临时变量值, 其中: 对第一临时变量 temp2,如果该第一临时变量值小于十六进制值 0x8000, 则将该第一临时变量 值左移一位, 此后重复该过程, 直到该第一临时变量值大于或等于十六进制 值 0x8000; 对第二临时变量 tempO, 如果相异标记值为 0, 则从概率估值表中 读出下一个上下文符号为大概率符号的概率值 NT— NMPS— QE1 , 并将该第二 临时变量值更新为 NT— NMPS_QE1 ;对第三临时变量 tempi,其更新过程与第 一临时变量 temp2相同;  Secondly, the first, second and third temporary variable values are respectively updated, wherein: for the first temporary variable temp2, if the first temporary variable value is smaller than the hexadecimal value 0x8000, the first temporary variable value is shifted to the left One bit, the process is repeated thereafter until the first temporary variable value is greater than or equal to the hexadecimal value 0x8000; for the second temporary variable tempO, if the distinct tag value is 0, the readout is performed from the probability estimate table A context symbol is a probability value NT_NMPS_QE1 of a large probability symbol, and the second temporary variable value is updated to NT_NMPS_QE1; for the third temporary variable tempi, the update process is the same as the first temporary variable temp2;
再次, 根据概率区间值 A的大小计算概率区间临时变量值 A_temp: 如果 概率区间值 A大于或等于 2xQeO, 比较第三临时变量 tempi与第二临时变量 tempO的关系, 若 tempi大于或等于 2xtemp0, 则 A— temp等于 tempO, 否 则, A— temp等于 templ-tempO; 如果概率区间值 A小于 2xQeO, 比较第一临 时变量 temp2与第二临时变量 tempO的关系, 若 temp2大于或等于 2xtemp0, 则 A_temp等于 tempO, 否则, A_temp等于 temp2-temp0; Again, the probability interval temporary variable value A_temp is calculated according to the size of the probability interval value A : if the probability interval value A is greater than or equal to 2xQeO, the relationship between the third temporary variable tempi and the second temporary variable tempO is compared, and if tempi is greater than or equal to 2xtemp0, then A—temp is equal to tempO, otherwise, A—temp is equal to templ-tempO; if the probability interval value A is less than 2xQeO, the relationship between the first temporary variable temp2 and the second temporary variable tempO is compared. If temp2 is greater than or equal to 2xtemp0, then A_temp is equal to tempO Otherwise, A_temp is equal to temp2-temp0;
然后,修正概率区间临时变量值 A— temp,如果概率区间临时变量值 A— temp 小于十六进制值 0x8000, 则将该概率区间临时变量值左移一位, 重复该判断 过程, 直到该概率区间临时变量值大于或等于十六进制值 0x8000;  Then, the probability interval temporary variable value A_temp is corrected. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, the probability interval temporary variable value is shifted to the left by one bit, and the judgment process is repeated until the probability The interval temporary variable value is greater than or equal to the hexadecimal value 0x8000;
最后, 更新概率区间值 A, 将概率区间值 A更新为修正后的概率区间临 时变量值 A_temp。  Finally, the probability interval value A is updated, and the probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
(c) 小概率 /大概率符号概率区间值更新的过程如下: 如图 5所示, 首先, 建立第一、 第二和第三临时变量, 将第一小概率符 号概率值 QeO和第二小概率符号概率值 Qel,分别保存到第一临时变量 temp2 和第二临时变量 tempO中, 同时计算当前概率区间值 A与第一小概率符号概 率值 QeO的差值, 即 A-Qe0, 并将其保存到第三临时变量 tempi中; (c) The process of updating the probability interval value of the small probability/high probability symbol is as follows: As shown in FIG. 5, first, the first, second, and third temporary variables are established, and the first small probability symbol probability value QeO and the second small probability symbol probability value Qel are respectively saved to the first temporary variable temp2 and the second In the temporary variable tempO, the difference between the current probability interval value A and the first small probability symbol probability value QeO, that is, A-Qe0, is simultaneously calculated and saved in the third temporary variable tempi;
其次, 分别更新第一、 第二和第三临时变量值, 其中: 对第一临时变量 temp2,如果该第一临时变量值小于十六进制值 0x8000, 则将该第一临时变量 值左移一位, 此后重复该过程, 直到该第一临时变量值大于或等于十六进制 值 0x8000; 对第二临时变量 tempO, 如果相异标记值为 0, 则从概率估值表中 读出下一个上下文符号为小概率符号的概率值 NT— NLPS_QE1,并将该第二临 时变量值更新为 NT— NLPS_QE1 ; 对第三临时变量 tempi , 其更新过程与第一 临时变量 temp2相同;  Secondly, the first, second and third temporary variable values are respectively updated, wherein: for the first temporary variable temp2, if the first temporary variable value is smaller than the hexadecimal value 0x8000, the first temporary variable value is shifted to the left One bit, the process is repeated thereafter until the first temporary variable value is greater than or equal to the hexadecimal value 0x8000; for the second temporary variable tempO, if the distinct tag value is 0, the readout is performed from the probability estimate table A context symbol is a probability value NT_NLPS_QE1 of a small probability symbol, and the second temporary variable value is updated to NT_NLPS_QE1; for the third temporary variable tempi, the update process is the same as the first temporary variable temp2;
再次, 根据概率区间值 A的大小计算概率区间临时变量值 A— temp, 如 果概率区间值 A小于 2xQeO,比较第三临时变量 tempi与第二临时变量 tempO 的关系, 若 tempi小于 2xtemp0, 贝 I」 A_temp等于 tempO, 否则, A_temp等 于 templ-tempO; 如果概率区间值 A大于或等于 2><QeO, 比较第一临时变量 temp2与第二临时变量 tempO的关系,若 temp2小于 2 <temp0, 贝 lj A— temp等 于 tempO, 否则, A_temp等于 temp2-temp0;  Again, the probability interval temporary variable value A_temp is calculated according to the magnitude of the probability interval value A. If the probability interval value A is less than 2xQeO, the relationship between the third temporary variable tempi and the second temporary variable tempO is compared, if tempi is less than 2xtemp0, the shell I" A_temp is equal to tempO, otherwise, A_temp is equal to templ-tempO; if the probability interval value A is greater than or equal to 2><QeO, the relationship between the first temporary variable temp2 and the second temporary variable tempO is compared, if temp2 is less than 2 <temp0, Bay lj A – temp is equal to tempO, otherwise A_temp is equal to temp2-temp0;
然后, 修正概率区间临时变量值 A— temp , 如果概率区间临时变量值 A— temp小于十六进制值 0x8000, 则将该概率区间临时变量值左移一位, 重 复该判断过程, 直到该概率区间临时变量值大于或等于十六进制值 0x8000; 最后, 更新概率区间值 A, 将概率区间值 A更新为修正后的概率区间临 时变量值 A_temp。  Then, the probability interval temporary variable value A_temp is corrected. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, the probability interval temporary variable value is shifted to the left by one bit, and the judgment process is repeated until the probability The interval temporary variable value is greater than or equal to the hexadecimal value 0x8000; finally, the probability interval value A is updated, and the probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
( d) 双小概率符号概率区间值更新过程如下:  (d) The double small probability symbol probability interval value update process is as follows:
如图 6所示, 首先, 建立第一、 第二和第三临时变量, 将第一小概率符 号概率值 QeO和第二小概率符号概率值 Qel,分别保存到第一临时变量 temp2 和第二临时变量 tempO中, 同时计算当前概率区间值 A与第一小概率符号概 率值 QeO的差值, 即 A-Qe0, 并将其保存到第三临时变量 tempi中;  As shown in FIG. 6, first, the first, second, and third temporary variables are established, and the first small probability symbol probability value QeO and the second small probability symbol probability value Qel are respectively saved to the first temporary variable temp2 and the second In the temporary variable tempO, the difference between the current probability interval value A and the first small probability symbol probability value QeO, that is, A-Qe0, is simultaneously calculated and saved in the third temporary variable tempi;
其次, 分别更新第一、 第二和第三临时变量值, 其中: 对第一临时变量 temp2, 如果该第一临时变量值小于十六进制值 0x8000, 则将该第一临时变 量值左移一位, 此后重复该过程, 直到该第一临时变量值大于或等于十六进 制值 0x8000; 对第二临时变量 tempO, 如果相异标记值为 0, 则从概率估值 表中读出下一个上下文符号为小概率符号的概率值 NT— NLPS— QE1, 并将该 第二临时变量值更新为 NT_NLPS— QE1 ; 对第三临时变量 tempi, 其更新过 程与第一临时变量 temp2相同; Secondly, the first, second and third temporary variable values are respectively updated, wherein: for the first temporary variable temp2, if the first temporary variable value is smaller than the hexadecimal value 0x8000, the first temporary variable value is shifted to the left One bit, after which the process is repeated until the value of the first temporary variable is greater than or equal to sixteen For the second temporary variable tempO, if the distinct tag value is 0, the next context symbol is read from the probability estimate table as the probability value NT_NLPS_QE1 of the small probability symbol, and the second is The temporary variable value is updated to NT_NLPS_QE1; for the third temporary variable tempi, the update process is the same as the first temporary variable temp2;
再次, 根据概率区间值 A的大小计算概率区间临时变量值 A— temp, 如 果概率区间值 A小于 2xQeO,比较第三临时变量 tempi与第二临时变量 tempO 的关系,若 tempi大于或等于 2 X tempO,则 A_temp等于 tempO,否贝 lj, A— temp 等于 templ-tempO; 如果概率区间值 A大于或等于 2 <QeO, 比较第一临时变 量 temp2与第二临时变量 tempO的关系, 若 temp2大于或等于 2><temp0, 则 A— temp等于 tempO, 否贝 lj, A— temp等于 temp2-temp0;  Again, the probability interval temporary variable value A_temp is calculated according to the size of the probability interval value A. If the probability interval value A is less than 2xQeO, the relationship between the third temporary variable tempi and the second temporary variable tempO is compared, if tempi is greater than or equal to 2 X tempO , then A_temp is equal to tempO, no shell lj, A_temp is equal to templ-tempO; if the probability interval value A is greater than or equal to 2 <QeO, the relationship between the first temporary variable temp2 and the second temporary variable tempO is compared, if temp2 is greater than or equal to 2><temp0, then A-temp is equal to tempO, no shell lj, A-temp is equal to temp2-temp0;
然后, 修正概率区间临时变量值 A— temp , 如果概率区间临时变量值 A— temp小于十六进制值 0x8000, 则将该概率区间临时变量值左移一位, 重 复该判断过程, 直到该概率区间临时变量值大于或等于十六进制值 0x8000; 最后, 更新概率区间值 A, 将概率区间值 A更新为修正后的概率区间临 时变量值 A_temp。  Then, the probability interval temporary variable value A_temp is corrected. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, the probability interval temporary variable value is shifted to the left by one bit, and the judgment process is repeated until the probability The interval temporary variable value is greater than or equal to the hexadecimal value 0x8000; finally, the probability interval value A is updated, and the probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
(C) 计算两个概率区间值移位计数值, 其中第一概率区间值移位计数 值为概率区间值 A更新前的前导零计数值,第二概率区间值移位计数值为概 率区间值 A更新后的前导零计数值。  (C) Calculating two probability interval value shift count values, wherein the first probability interval value shift count value is a leading zero count value before the probability interval value A is updated, and the second probability interval value shift count value is a probability interval value A updated leading zero count value.
最后, 输出更新后的概率区间值。  Finally, the updated probability interval value is output.
如上所述, 本发明的概率估值表充分考虑了概率估值表中各个字段的关 系后, 其容量仅为 1350位, 而现有技术中 M. Dyer采用的概率估值表需要 47 X 32 X 2=3008位,现有技术中刘奇卫采用的概率估值表需要 47 x 96=4512位, 可见本发明显著降低了内部存储位。  As described above, the probability estimation table of the present invention fully considers the relationship between the fields in the probability estimation table, and its capacity is only 1350 bits, whereas the probability estimation table adopted by M. Dyer in the prior art requires 47 X 32. X 2 = 3008 bits. In the prior art, the probability estimate table adopted by Liu Qiwei requires 47 x 96 = 4512 bits, which shows that the present invention significantly reduces the internal storage bits.
(归一化)  (Normalized)
以下, 参照图 7, 对图 1的步骤 S3、 S4的归一化步骤进行详细的说明。 歩骤 S3 , 对码值进行归一化处理。  Hereinafter, the normalization steps of steps S3 and S4 of Fig. 1 will be described in detail with reference to Fig. 7. Step S3, normalizing the code values.
在该处理中, 根据图 2的步骤 S1.4得到的双上下文符号对类型, 分别对 码值进行相应更新;根据概率区间值、归一化过程标识和小概率符号概率值, 确定当前的归一化类型, 该归一化类型包括零次归一化、 单次归一化、 一类 双次归一化和二类双次归一化; 对零次归一化类型的码值, 不进行归一化处 理, 没有对应码流输出; 对单次归一化、 一类双次归一化和二类双次归一化 类型的码值, 分别进行归一化处理, 并产生对应的单次归一化码流、 一类双 次归一化码流和二类双次归一化码流。 具体如下: In this process, according to the double context symbol pair type obtained in step S1.4 of FIG. 2, the code values are respectively updated correspondingly; according to the probability interval value, the normalization process identifier and the small probability symbol probability value, the current return is determined. a normalization type, including zero normalization, single normalization, one type of double normalization, and two types of double normalization; for zero-order normalized type code values, Normalization Rational, there is no corresponding code stream output; for single normalization, one type of double normalization and two types of double normalization type code values, respectively, normalization processing, and generate corresponding single normalization The code stream, a type of double normalized code stream and a second type of double normalized code stream. details as follows:
步骤 S31 : 读入编码必要参数  Step S31: Read the necessary parameters of the encoding
编码必要参数包括: 概率区间值 A、 归一化过程标识 RenormTag、 第一 概率区间值移位计数值 NumSLA0、 第二概率区间值移位计数值 NumSLAl、 第一小概率符号概率值 QeO以及第二小概率符号概率值 Qel。 其中, 归一化 过程标识 RenormTag表示双上下文符号对的概率类型, 即 0表示双小概率符 号、 1表示双大概率符号、 2表示大概率 /小概率符号、 3表示小概率 /大概率 符号。  The coding necessary parameters include: a probability interval value A, a normalization process identifier RenormTag, a first probability interval value shift count value NumSLA0, a second probability interval value shift count value NumSLAl, a first small probability symbol probability value QeO, and a second Small probability symbol probability value Qel. Wherein, the normalization process identifier RenormTag represents the probability type of the pair of double context symbols, that is, 0 indicates a double small probability symbol, 1 indicates a double large probability symbol, 2 indicates a large probability/small probability symbol, and 3 indicates a small probability/large probability symbol.
步骤 S32: 对码值进行更新, 并确定码值左移计数值 CT  Step S32: Update the code value, and determine the code value left shift count value CT
根据输入的归一化过程标识 RenormTag, 如果第一上下文符号对是大概 率符号, 即 RenormTag为 1或 2, 则计算第二小概率符号概率值 Qel与当前 码值 C的和值, 并将码值 C更新为该和值; 否则, 保持码值 C不变;  RenormTag is identified according to the input normalization process. If the first context symbol pair is a large probability symbol, that is, the RenormTag is 1 or 2, the sum of the second small probability symbol probability value Qel and the current code value C is calculated, and the code is The value C is updated to the sum value; otherwise, the code value C is kept unchanged;
并且,按以下方式确定码值左移计数值 CT,即如果是第一次对上下文符 号对进行码值归一化处理, 则按照 JPEG2000标准给出的初始化方法对 CT 进行赋值, 否则, 保持 CT值不变。  And, determining the code value left shift count value CT in the following manner, that is, if the code value normalization process is performed on the context symbol pair for the first time, the CT is assigned according to the initialization method given by the JPEG2000 standard, otherwise, the CT is maintained. The value does not change.
步骤 S33 : 判断当前归一化类型  Step S33: determining the current normalization type
步骤 S331如果归一化过程标识 RenormTag为 1,则进行双大概率符号码 值归一化类型判断。 其详细过程表示在图 8中。  Step S331: If the normalization process identifier RenormTag is 1, the double-probability symbol code value normalization type judgment is performed. The detailed process is shown in Figure 8.
步骤 S3311:如果概率区间值 A小于第一小概率符号概率值 QeO的两倍, 则执行步骤 S3312; 否则, 执行步骤 S3314;  Step S3311: If the probability interval value A is less than twice the first small probability symbol probability value QeO, step S3312 is performed; otherwise, step S3314 is performed;
步骤 S3312: 对第一小概率符号概率值 QeO进行调整, 即左移 QeO, 直 至 QeO大于或等于十六进制值 0x8000,如果调整后的第一小概率符号概率值 SHIFT— V(Qe0)小于第二小概率符号概率值 Qel的两倍,则归一化类型为一类 双次归一化, 并设置一类双次归一化类型指示, 否则, 执行歩骤 S3313; 步骤 S3313 :如果调整后的第一小概率符号概率值 SHIFT— V(Qe0)与第二 小概率符号概率值 Qel的差值小于十六进制值 0x8000,则归一化类型为二类 双次归一化, 并设置二类双次归一化类型指示, 否则, 归一化类型为单次归 一化, 并设置单次归一化类型指示; 步骤 S3314: 如果概率区间值 A与第一小概率符号概率值 QeO的差值小 于十六进制值 0x8000, 执行步骤 S3315 ; 否则, 执行步骤 S3317; Step S3312: Adjusting the first small probability symbol probability value QeO, that is, shifting QeO to the left until QeO is greater than or equal to the hexadecimal value 0x8000, if the adjusted first small probability symbol probability value SHIFT_V(Qe0) is smaller than The second small probability symbol probability value Qel is twice, then the normalization type is a type of double normalization, and a type of double normalization type indication is set, otherwise, step S3313 is performed; step S3313: if the adjustment The difference between the first small probability symbol probability value SHIFT_V(Qe0) and the second small probability symbol probability value Qel is less than the hexadecimal value 0x8000, then the normalization type is the second class double normalization, and Set two types of double normalization type indication; otherwise, the normalization type is single normalization, and set a single normalization type indication; Step S3314: If the difference between the probability interval value A and the first small probability symbol probability value QeO is less than the hexadecimal value 0x8000, step S3315 is performed; otherwise, step S3317 is performed;
步骤 S3315 : 对概率区间值 A与第一小概率符号概率值 QeO的差值进行 调整, 如果调整后的差值 SHIFT_V(A-QeO)小于第一小概率符号概率值 QeO 的两倍,则归一化类型为一类双次归一化,并设置一类双次归一化类型指示; 否则, 执行步骤 S3316;  Step S3315: Adjusting the difference between the probability interval value A and the first small probability symbol probability value QeO, if the adjusted difference SHIFT_V (A-QeO) is less than twice the first small probability symbol probability value QeO, then returning The normalization type is a type of double normalization, and a type of double normalization type indication is set; otherwise, step S3316 is performed;
步骤 S3316:如果调整后的差值 SHIFT_V(A-QeO)小于第二小概率符号概 率值 Qel与十六进制值 0x8000的和, 则归一化类型为二类双次归一化, 并 设置二类双次归一化类型指示; 否则, 归一化类型为单次归一化, 并设置单 次归一化类型指示;  Step S3316: If the adjusted difference SHIFT_V (A-QeO) is smaller than the sum of the second small probability symbol probability value Qel and the hexadecimal value 0x8000, the normalization type is the second class double normalization, and is set. The second type of double normalization type indication; otherwise, the normalization type is single normalization, and a single normalization type indication is set;
步骤 S3317: 如果概率区间值 A与第一小概率符号概率值 QeO的差值小 于第二小概率符号概率值 Qel的两倍, 则归一化类型为单次归一化, 并设置 单次归一化类型指示; 否则, 执行步骤 S3318;  Step S3317: If the difference between the probability interval value A and the first small probability symbol probability value QeO is less than twice the second small probability symbol probability value Qel, the normalization type is a single normalization, and a single return is set. a type indication; otherwise, step S3318;
步骤 S3318: 如果概率区间值 A与第一小概率符号概率值 QeO的差值小 于第二小概率符号概率值 Qel与十六进制值 0x8000的和, 则归一化类型为 单次归一化, 并设置单次归一化类型指示; 否则, 归一化类型为零次归一化, 并设置零次归一化类型指示。  Step S3318: If the difference between the probability interval value A and the first small probability symbol probability value QeO is smaller than the sum of the second small probability symbol probability value Qel and the hexadecimal value 0x8000, the normalization type is a single normalization. , and set a single normalization type indication; otherwise, the normalization type is zero normalization, and set zero normalization type indication.
步骤 S332:如果归一化过程标识 RenormTag为 2,则进行大概率 /小概率 符号码值归一化类型判断。 其详细过程表示在图 9中。  Step S332: If the normalization process identifier RenormTag is 2, the large probability/small probability symbol code value normalization type judgment is performed. The detailed process is shown in Figure 9.
步骤 S3321:如果概率区间值 A小于第一小概率符号概率值 QeO的两倍, 那么, 执行步骤 S3322; 否则, 执行歩骤 S3323;  Step S3321: If the probability interval value A is less than twice the first small probability symbol probability value QeO, then step S3322 is performed; otherwise, step S3323 is performed;
步骤 S3322: 对第一小概率符号概率值 QeO进行调整, 即左移 QeO, 直 至 QeO大于或等于十六进制值 0x8000。如果调整后的第一小概率符号概率值 SHIFT— V(Qe0)小于第二小概率符号概率值 Qel的两倍,则归一化类型为二类 双次归一化, 并设置二类双次归一化类型指示; 否则, 归一化类型为一类双 次归一化, 并设置一类双次归一化类型指示;  Step S3322: Adjust the first small probability symbol probability value QeO, that is, shift QeO to the left until QeO is greater than or equal to the hexadecimal value 0x8000. If the adjusted first small probability symbol probability value SHIFT_V(Qe0) is less than twice the second small probability symbol probability value Qel, the normalization type is a second-class double-order normalization, and the second-class double-order is set. Normalized type indication; otherwise, the normalized type is a type of double normalization, and a type of double normalization type indication is set;
步骤 S3323 : 如果概率区间值 A与第一小概率符号概率值 QeO的差值小 于十六进制值 0x8000, 执行步骤 S3324; 否则, 归一化类型为单次归一化, 并设置单次归一化类型指示;  Step S3323: If the difference between the probability interval value A and the first small probability symbol probability value QeO is less than the hexadecimal value 0x8000, step S3324 is performed; otherwise, the normalization type is single normalization, and a single return is set. a type indication;
步骤 S3324: 对概率区间值 A与第一小概率符号概率值 QeO的差值进行 调整, 如果调整后的差值 SHIFT— V(A-QeO)小于第一小概率符号概率值 QeO 的两倍,则归一化类型为一类双次归一化,并设置一类双次归一化类型指示; 否则, 归一化类型为二类双次归一化, 并设置二类双次归一化类型指示。 Step S3324: Performing a difference between the probability interval value A and the first small probability symbol probability value QeO Adjustment, if the adjusted difference SHIFT_V(A-QeO) is less than twice the first small probability symbol probability value QeO, the normalization type is a class of double-order normalization, and a class of double-return is set. The type indication; otherwise, the normalization type is the second-class double normalization, and the second-class double-normalization type indication is set.
步骤 S333:如果归一化过程标识 RenormTag为 3,则进行小概率 /大概率 符号码值归一化类型判断。 其详细过程表示在图 10中。  Step S333: If the normalization process identifier RenormTag is 3, the small probability/high probability symbol code value normalization type judgment is performed. The detailed process is shown in Fig. 10.
步骤 S3331:如果概率区间值 A小于第一小概率符号概率值 QeO的两倍, 执行歩骤 S3332; 否则, 执行步骤 S3334;  Step S3331: If the probability interval value A is less than twice the first small probability symbol probability value QeO, step S3332 is performed; otherwise, step S3334 is performed;
步骤 S3332: 如果概率区间值 A与第一小概率符号概率值 QeO的差值经 调整后小于第二小概率符号概率值 Qel的两倍, 则归一化类型为一类双次归 一化, 并设置一类双次归一化类型指示; 否则, 执行歩骤步骤 S3333;  Step S3332: If the difference between the probability interval value A and the first small probability symbol probability value QeO is adjusted to be less than twice the second small probability symbol probability value Qel, the normalization type is a class of double normalization, And setting a type of double normalization type indication; otherwise, performing step S3333;
步骤 S3333 : 对概率区间值 A与第一小概率符号概率值 QeO的差值进行 调整, 如果调整后的差值 SHIFT_V(A-QeO)小于第二小概率符号概率值 Qel 与十六进制值 0x8000的和,则归一化类型为二类双次归一化,并设置二类双 次归一化类型指示; 否则, 归一化类型为单次归一化, 并设置单次归一化类 型指示;  Step S3333: Adjust the difference between the probability interval value A and the first small probability symbol probability value QeO, if the adjusted difference SHIFT_V (A-QeO) is smaller than the second small probability symbol probability value Qel and hexadecimal value For the sum of 0x8000, the normalization type is the second-class double-normalization, and the second-class double-normalization type indication is set; otherwise, the normalization type is single normalization, and a single normalization is set. Type indication
步骤 S3334: 对第一小概率符号概率值 QeO进行调整, 如果调整后的第 一小概率符号概率值 SHIFT— V(Qe0)小于第二小概率符号概率值 Qel的两倍, 则归一化类型为二类双次归一化, 并设置二类双次归一化类型指示; 否则, 执行步骤 S3335;  Step S3334: Adjusting the first small probability symbol probability value QeO, if the adjusted first small probability symbol probability value SHIFT_V(Qe0) is less than twice the second small probability symbol probability value Qel, the normalization type For the second-class double-order normalization, and set the second-class double-substitution type indication; otherwise, perform step S3335;
步骤 S3335 :如果调整后的第一小概率符号概率值 SHIFT— V(Qe0)与第二 小概率符号概率值 Qel的差值小于十六进制值 0x8000,则归一化类型为一类 双次归一化, 并设置二类双次归一化类型指示; 否则, 归一化类型为一类双 次归一化, 并设置单次归一化类型指示。  Step S3335: If the difference between the adjusted first small probability symbol probability value SHIFT_V(Qe0) and the second small probability symbol probability value Qel is less than the hexadecimal value 0x8000, the normalization type is a class of double times Normalize, and set two types of double normalization type indication; otherwise, the normalization type is a type of double normalization, and set a single normalization type indication.
上述步骤中单次归一化类型指示表示对该双上下文符号对的码值仅进行 一次归一化处理, 一类双次归一化类型指示和二类双次归一化类型指示表示 对该双上下文符号对的码值将进行两次归一化处理, 而零次归一化类型指示 则表示对该双上下文符号对的码值不进行归一化处理。 这四种归一化类型指 示用于选择对应的归一化处理。  The single normalization type indication in the above step indicates that the code value of the dual context symbol pair is only normalized once, and a type of double normalization type indication and a second type of double normalization type indication indicate that The code value of the double context symbol pair will be normalized twice, and the zero normalization type indication indicates that the code value of the double context symbol pair is not normalized. These four normalized type indications are used to select the corresponding normalization process.
步骤 34: 根据归一化类型, 进行归一化处理。  Step 34: Normalize according to the normalized type.
根据步骤 33得到的归一化类型,分别对单次归一化类型、一类双次归一 化类型和二类双次归一化类型下的码值进行相应的归一化处理, 并产生对应 的归一化码流。 According to the normalization type obtained in step 33, the single normalization type and the first-order double normalization are respectively The code values under the type and the second-order double normalization type are subjected to corresponding normalization processing, and a corresponding normalized code stream is generated.
如果归一化类型为单次归一化, 则对码值进行单次归一化处理, 参照图 If the normalization type is single normalization, the code value is subjected to a single normalization process, and the reference figure
5, 具体实现如下: 5, the specific implementation is as follows:
步骤 341 : 如果第一概率区间值移位计数值 NumSLAO或第二概率区间 值移位计数值 NumSLAl小于码值左移计数 CT, 将码值 C左移 NumSLAO 或者 NumSLAl次, 没有对应单次归一化码流输出, 结束当前归一化过程; 否则, 执行步骤 342;  Step 341: If the first probability interval value shift count value NumSLAO or the second probability interval value shift count value NumSLAl is smaller than the code value left shift count CT, the code value C is shifted to the left by NumSLAO or NumSLAl times, and there is no corresponding single-time normalization. Streaming the stream output, ending the current normalization process; otherwise, performing step 342;
步骤 342: 如果上一个双上下文符号对产生的归一化码流的最后一个字 节为十六进制值 OxFF, 设置码值临时左移计数值 NewCT为 7, 然后执行步 骤 345; 否则, 执行步骤 343 ;  Step 342: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set the code value temporary left shift count value NewCT to 7, and then perform step 345; otherwise, execute Step 343;
步骤 343: 如果上一个双上下文符号对产生的归一化码流的最后一个字 节为十六进制值 OxFE,执行歩骤 344;否则设置码值临时左移计数值 NewCT 为 8, 然后执行步骤步骤 345;  Step 343: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, perform step 344; otherwise, set the code value temporary left shift count value NewCT to 8, and then execute Step 345;
步骤 344: 如果当前码值 C大于或等于十六进制值 0x8000000, 设置码 值临时左移计数值 NewCT为 7,否则设置 NewCT为 8;然后执行歩骤 S345 ; 步骤 345 : 将码值 C左移 NumSLA0-CT次, 然后执行歩骤 346;  Step 344: If the current code value C is greater than or equal to the hexadecimal value 0x8000000, set the code value temporary left shift count value NewCT to 7, otherwise set NewCT to 8; then perform step S345; step 345: code value C left Move NumSLA0-CT times, and then perform step 346;
步骤 346: 如果第一概率区间值移位计数值 NumSLAO或第二概率区间 值移位计数值 NumSLAl与码值左移计数值 CT的差值大于或等于 0,并且小 于码值临时左移计数值 NewCT,则进行单次字节输出;否则进行两次字节输 出。  Step 346: If the difference between the first probability interval value shift count value NumSLAO or the second probability interval value shift count value NumSLAl and the code value left shift count value CT is greater than or equal to 0, and is less than the code value temporary left shift count value NewCT, single byte output; otherwise two bytes output.
如果归一化类型为一类双次归一化类型, 则进行一类双次归一化处理, 参照图 12, 具体实现如下:  If the normalization type is a type of double normalization type, then a class of double normalization processing is performed. Referring to FIG. 12, the specific implementation is as follows:
步骤 S351 : 如果 NumSLA0-CT小于零, 执行步骤 S352; 否贝 I」, 执行步 骤 S353 ;  Step S351: If NumSLA0-CT is less than zero, step S352 is performed; no shell I", step S353 is performed;
步骤 S352 : 如果 NumSLAl -(CT-NumSLA0) 小于零, 将码值 C左移 NumSLAO+NumSLAl次,然后结束当前归一化过程;否贝 lj,执行歩骤 S3521 ;  Step S352: If NumSLAl -(CT-NumSLA0) is less than zero, shift the code value C to the left by NumSLAO+NumSLAl times, and then end the current normalization process; otherwise, the shell lj, execute step S3521;
步骤 S3521 : 将码值 C左移 NumSLAO次, 并用 NewCT-NumSLAO 更新 NewCT, 然后执行步骤 S3522;  Step S3521: shift the code value C to the left by NumSLAO times, and update NewCT with NewCT-NumSLAO, and then perform step S3522;
步骤 S3522: 如果 NumSLAl-NewCT大于或等于零, 将码值 C左 移 NewCT次, 然后执行步骤 S3523; 否则, 结束当前归一化过程; 步骤 S3523 : 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFF, 设置 NewCT为 7, 然后执行步骤 S3526; 否 则, 执行步骤 S3524; Step S3522: If NumSLAl-NewCT is greater than or equal to zero, the code value C is left. Move NewCT times, and then perform step S3523; otherwise, end the current normalization process; Step S3523: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT Is 7, then step S3526; otherwise, step S3524;
步骤 S3524: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFE, 执行步骤 S3525; 否则, 设置 NewCT为 8, 执行歩骤 S3526;  Step S3524: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, step S3525 is performed; otherwise, setting NewCT to 8, performing step S3526;
歩骤 S3525 : 如果码值 C大于或等于十六进制值 0x8000000, 设置 NewCT为 7, 否则, 设置 NewCT为 8; 然后执行步骤 S3526;  Step S3525: If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3526;
步骤 S3526: 如果 NumSLAl与 CT的差值小于 NewCT, 那么进行 单次字节输出, 然后结束当前归一化过程, 否则, 进行两次字节输出, 然后 结束当前归一化过程;  Step S3526: If the difference between NumSLAl and CT is smaller than NewCT, then a single byte output is performed, and then the current normalization process is ended; otherwise, two byte outputs are performed, and then the current normalization process is ended;
步骤 S353 : 将码值 C左移 CT次, 执行歩骤 S3531 ;  Step S353: shifting the code value C to the left by CT times, and executing step S3531;
步骤 S3531 : 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFF, 设置 NewCT为 7, 执行步骤 S3534; 否则, 执行歩骤 S3532: ;  Step S3531: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT to 7, and execute step S3534; otherwise, execute step S3532: ;
步骤 S3532: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFE, 执行歩骤 S3533 ; 否则, 设置 NewCT为 8, 执行步骤 S3534;  Step S3532: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, perform step S3533; otherwise, set NewCT to 8, and perform step S3534;
步骤 S3533 : 如果码值 C大于或等于十六进制值 0x8000000, 设置 NewCT为 7, 否则, 设置 NewCT为 8; 执行步骤 S3534;  Step S3533: If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; execute step S3534;
步骤 S3534: 如果移位计数 NumSLAO与 CT的差值小于 NewCT, 执行歩骤 S3535 , 否则执行歩骤 S35310;  Step S3534: If the difference between the shift count NumSLAO and the CT is less than NewCT, step S3535 is performed, otherwise step S35310 is performed;
步骤 S3535 :如果 NumSLAl减去 CT的差值小于零,则进行单次字 节输出, 然后结束当前归一化过程; 否则, 执行步骤 S3536;  Step S3535: If the difference between the NumSLAl minus the CT is less than zero, the single byte output is performed, and then the current normalization process is ended; otherwise, step S3536 is performed;
步骤 S3536: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFF, 设置 NewCT为 7, 然后执行步骤 S3539; 否 则, 执行步骤 S3537;  Step S3536: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT to 7, and then execute step S3539; otherwise, execute step S3537;
步骤 S3537: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFE, 执行步骤 S3538; 否则, 设置 NewCT为 8, 然后执行步骤 S3539; Step S3537: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, step S3538 is performed; otherwise, the NewCT is set to 8, Then step S3539 is performed;
步骤 S3538: 如果码值 C大于或等于十六进制值 0x8000000, 设置 NewCT为 7, 否则, 设置 NewCT为 8; 然后执行步骤 S3539;  Step S3538: If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3539;
步骤 S3539: 如果移位计数 NumSLAl与 CT的差值小于 NewCT, 则进行两次字节输出, 然后结束当前归一化过程; 否则进行三次字节输出, 然后结束当前归一化过程;  Step S3539: If the difference between the shift count NumSLAl and the CT is smaller than NewCT, the byte output is performed twice, and then the current normalization process is ended; otherwise, the three-byte output is performed, and then the current normalization process is ended;
步骤 S35310如果 NumSLAl减去 CT的差值小于零, 则进行两次字 节输出, 然后结束当前归一化过程; 否则, 执行歩骤 S35311 ;  Step S35310: If the difference between the NumSLAl minus the CT is less than zero, the byte output is performed twice, and then the current normalization process is ended; otherwise, the step S35311 is performed;
步骤 S35311 :如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFF, 设置 NewCT为 7, 然后执行歩骤 S35314; 否 则, 执行步骤 S35312;  Step S35311: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT to 7, and then execute step S35314; otherwise, execute step S35312;
步骤 S35312:如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 0xFE, 执行歩骤 S35313; 否则, 设置 NewCT为 8, 然后执行步骤 S35314;  Step S35312: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value of 0xFE, execute step S35313; otherwise, set NewCT to 8, and then execute step S35314;
步骤 S35313: 如果码值 C大于或等于十六进制值 0x8000000, 设置 NewCT为 7, 否则, 设置 NewCT为 8; 然后执行步骤 S35314;  Step S35313: If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S35314;
步骤 S35314:如果 NumSLAl与 CT的差值小于 NewCT, 则进行三 次字节输出, 然后结束当前归一化过程; 否则进行四次字节输出, 然后结束 当前归一化过程。  Step S35314: If the difference between NumSLAl and CT is smaller than NewCT, the output is three bytes, and then the current normalization process is ended; otherwise, the fourth byte output is performed, and then the current normalization process is ended.
如果归一化类型为二类双次归一化类型, 则进行二类双次归一化处理, 参照图 13, 具体实现如下:  If the normalization type is a second-class double-normalization type, then the second-class double-order normalization processing is performed. Referring to FIG. 13, the specific implementation is as follows:
步骤 S361 : 如果 NumSLAO-CT小于零, 执行步骤 S362; 否则, 执行步 骤 S363 ;  Step S361: If NumSLAO-CT is less than zero, step S362 is performed; otherwise, step S363 is performed;
步骤 S362: 如果 NumSLAl- (CT-NumSLAO)小于零, 先将码值 C左移 NumSLAO次, 并将左移后的码值与 Qel相加, 再将该和值左移 NumSLAl 次, 然后结束当前归一化过程; 否则, 执行步骤 S3621 ;  Step S362: If NumSLAl-(CT-NumSLAO) is less than zero, first shift the code value C to the left by NumSLAO times, and add the left shifted code value to Qel, then shift the sum value to the left by NumSLAl times, and then end the current Normalization process; otherwise, step S3621 is performed;
步骤 S3621 : 先将码值 C左移 NumSLAO次, 然后用左移后的码值 与 Qel的和值更新码值 C, 同时用 NewCT-NumSLAO更新 NewCT, 执行歩 骤 S3622;  Step S3621: First shift the code value C to the left by NumSLAO times, then update the code value C with the left-shifted code value and the Qel sum value, and update the NewCT with NewCT-NumSLAO, and execute step S3622;
步骤 S3622: 如果 NumSLAl-NewCT大于或等于零, 则将码值 C左 移 NewCT次, 然后执行步骤 S3623; 否则, 结束当前归一化过程; 步骤 S3623: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 0xFF, 设置 NewCT为 7, 然后执行步骤 S3626; 否 则, 执行步骤 S3624; Step S3622: If NumSLAl-NewCT is greater than or equal to zero, the code value C is left Shift NewCT times, and then step S3623; otherwise, end the current normalization process; Step S3623: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value of 0xFF, set NewCT Is 7, then step S3626; otherwise, step S3624;
步骤 S3624: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFE, 执行步骤 S3625; 否则, 设置 NewCT为 8, 然后执行步骤 S3626;  Step S3624: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, step S3625 is performed; otherwise, NewCT is set to 8, and then step S3626 is performed;
歩骤 S3625 : 如果码值 C大于或等于十六进制值 0x8000000, 则设 置 NewCT为 7, 否则, 设置 NewCT为 8; 然后执行步骤 S3626;  Step S3625: If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3626;
步骤 S3626: 如果 NumSLAl-CT小于 NewCT, 进行单次字节输出, 然后结束当前归一化过程, 否则进行两次字节输出, 然后结束当前归一化过 程;  Step S3626: If NumSLAl-CT is smaller than NewCT, perform single byte output, and then end the current normalization process, otherwise perform two byte output, and then end the current normalization process;
步骤 S363: 将码值 C左移 CT次, 然后执行歩骤 S3631 ;  Step S363: shift the code value C to the left by CT times, and then perform step S3631;
步骤 S3631 : 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 0xFF, 设置 NewCT为 7, 然后执行步骤 S3634; 否 则, 执行步骤 S3632;  Step S3631: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value of 0xFF, set NewCT to 7, and then execute step S3634; otherwise, execute step S3632;
步骤 S3632: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFE, 执行歩骤 S3633; 否则, 设置 NewCT为 8, 然后执行步骤 S3634;  Step S3632: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, execute step S3633; otherwise, set NewCT to 8, and then execute step S3634;
步骤 S3633 : 如果码值 C大于或等于十六进制值 0x8000000, 则设 置 NewCT为 7, 否则, 设置 NewCT为 8; 然后执行步骤 S3634;  Step S3633: If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3634;
步骤 S3634: 如果 NumSLAO与 CT的差值小于 NewCT, 首先用码 值 C与 Qel的和值更新码值 C, 然后执行歩骤 S3635; 否则, 先用码值 C与 Qel的和值更新码值 , 然后执行步骤 S36310;  Step S3634: If the difference between the NumSLAO and the CT is smaller than the NewCT, first update the code value C with the sum of the code values C and Qel, and then perform step S3635; otherwise, first update the code value with the sum of the code value C and Qel. Then step S36310 is performed;
步骤 S3635 : 如果 NumSLAl-CT小于零, 则进行单次字节输出, 然 后结束当前归一化过程; 否则, 执行步骤 S3636;  Step S3635: If NumSLAl-CT is less than zero, a single byte output is performed, and then the current normalization process is ended; otherwise, step S3636 is performed;
步骤 S3636: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 0xFF, 则设置 NewCT为 7, 然后执行歩骤 S3639; 否则, 执行步骤 S3637;  Step S3636: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value of 0xFF, set NewCT to 7, and then execute step S3639; otherwise, execute step S3637;
步骤 S3637: 如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFE, 执行步骤 S3638; 否则, 设置 NewCT为 8, 然后执行步骤 S3639; Step S3637: If the last double context symbol pair is the last of the normalized code stream generated One byte is a hexadecimal value OxFE, step S3638 is performed; otherwise, NewCT is set to 8, and then step S3639 is performed;
步骤 S3638: 如果码值 C大于或等于十六进制值 0x8000000, 则设 置 NewCT为 7, 否则, 设置 NewCT为 8; 然后执行步骤 S3639;  Step S3638: If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S3639;
步骤 S3639: 如果 NumSLAl与 CT的差值小于 NewCT, 则进行两 次字节输出, 然后结束当前归一化过程; 否则, 进行三次字节输出, 然后结 束当前归一化过程;  Step S3639: If the difference between NumSLAl and CT is smaller than NewCT, perform two bytes of output, and then end the current normalization process; otherwise, perform three-byte output, and then end the current normalization process;
歩骤 S36310: 如果 NumSLAl-CT小于零, 则进行两次字节输出, 然 后结束当前归一化过程; 否则, 执行步骤 S36311 ;  Step S36310: If NumSLAl-CT is less than zero, perform two byte output, and then end the current normalization process; otherwise, execute step S36311;
步骤 S36311 :如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFF, 则设置 NewCT为 7, 然后执行歩骤 S36314; 否则, 执行步骤 S36312;  Step S36311: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFF, set NewCT to 7, and then execute step S36314; otherwise, execute step S36312;
歩骤 S36312:如果上一个双上下文符号对产生的归一化码流的最后 一个字节为十六进制值 OxFE, 执行步骤 S36313; 否则, 设置 NewCT为 8, 然后执行步骤 S36314;  Step S36312: If the last byte of the normalized code stream generated by the previous double context symbol pair is a hexadecimal value OxFE, step S36313 is performed; otherwise, NewCT is set to 8, and then step S36314 is performed;
步骤 S36313: 如果码值 C大于或等于十六进制值 0x8000000, 则设 置 NewCT为 7, 否则, 设置 NewCT为 8; 然后执行步骤 S36314;  Step S36313: If the code value C is greater than or equal to the hexadecimal value 0x8000000, set NewCT to 7, otherwise, set NewCT to 8; then execute step S36314;
步骤 S36314:如果 NumSLAl与 CT的差值小于 NewCT, 则进行三 次字节输出, 然后结束当前归一化过程; 否则进行四次字节输出, 然后结束 当前归一化过程。  Step S36314: If the difference between NumSLAl and CT is smaller than NewCT, the output is three bytes, and then the current normalization process is ended; otherwise, the fourth byte output is performed, and then the current normalization process is ended.
在图 8、 图 9和图 10中 SHIFT_V(X), 表示对操作数 X进行左移, 直至 左移后的 X值大于或等于十六进制值 0x8000。  In Figure 8, Figure 9, and Figure 10, SHIFT_V(X) indicates that the operand X is shifted to the left until the X value after the left shift is greater than or equal to the hexadecimal value 0x8000.
在图 11、 图 12和图 13中, "前一个码流字节"表示的是上一个双上下 文符号对产生的归一化码流的最后一个字节。  In Figures 11, 12 and 13, the "previous code stream byte" represents the last byte of the normalized code stream produced by the last double context symbol pair.
步骤 S4, 对码值进行排空处理。  In step S4, the code value is drained.
当没有新的上下文符号对输入时, 对码值进行排空处理, 并得到相应的 排空码流。  When there is no new context symbol pair input, the code value is drained and the corresponding empty code stream is obtained.
(分类缓存输出码流)  (classified cache output stream)
步骤 S5:分类缓存输出码流。  Step S5: classifying the buffer output code stream.
根据码流的输出字节数, 对得到的单次归一化码流、 一类双次归一化码 流、 二类双次归一化码流和排空码流分别进行分类缓存, 具体过程如图 14 所示: According to the number of output bytes of the code stream, the obtained single normalized code stream, one type of double normalized code The flow, the second-class double-normalized code stream, and the empty code stream are respectively classified and cached. The specific process is shown in Figure 14:
步骤 S51 : 如果该码流仅输出一个字节, 则将该字节写入第一字节缓存 中准备输出;  Step S51: If the code stream outputs only one byte, write the byte into the first byte buffer to prepare output.
歩骤 S52: 如果该码流输出两个字节 则将第一个字节写入第一字节缓 存中, 将第二个字节写入第二字节缓存中  Step S52: If the code stream outputs two bytes, the first byte is written into the first byte cache, and the second byte is written into the second byte buffer.
歩骤 S53 : 如果该码流输出三个字节 则将第一个字节写入第一字节缓 存中, 将第二个字节写入第二字节缓存中 将第三个字节写入第三字节缓存 中;  Step S53: If the code stream outputs three bytes, the first byte is written into the first byte buffer, the second byte is written into the second byte buffer, and the third byte is written. Into the third byte cache;
歩骤 S54: 如果该码流输出四个字节 则将第一个字节写入第一字节缓 存中, 将第二个字节写入第二字节缓存中 将第三个字节写入第三字节缓存 中, 将第四个字节写入第四字节缓存中。  Step S54: If the code stream outputs four bytes, the first byte is written into the first byte buffer, the second byte is written into the second byte buffer, and the third byte is written. Enter the third byte buffer and write the fourth byte to the fourth byte buffer.
(输出码流)  (output stream)
步骤 S6: 输出分类缓存的码流。  Step S6: Output the code stream of the classification cache.
参照图 15, 本步骤的具体实现如下:  Refer to Figure 15. The specific implementation of this step is as follows:
按照顺序查询的方式, 依次读取第一至第四字节缓存中的码流进行输出, 完成对双上下文符号对的算术熵编码, 具体过程包括:  According to the sequential query manner, the code streams in the first to fourth byte buffers are sequentially read and output, and the arithmetic entropy coding of the dual context symbol pairs is completed. The specific process includes:
歩骤 S61 : 如果第一字节缓存不为空状态, 则读取该第一字节缓存中一 个字节的数据并输出, 然后执行步骤 S62; 否则, 直接执行步骤 S62;  Step S61: If the first byte buffer is not empty, reading the data of one byte in the first byte buffer and outputting, and then performing step S62; otherwise, directly performing step S62;
步骤 S62: 如果第二字节缓存不为空状态, 则读取该第二字节缓存中一 个字节的数据并输出, 然后执行歩骤 S63; 否则, 直接执行歩骤 S63;  Step S62: If the second byte buffer is not empty, reading the data of one byte in the second byte buffer and outputting, and then executing step S63; otherwise, directly executing step S63;
歩骤 S63 : 如果第三字节缓存不为空状态, 则读取该第三字节缓存中一 个字节的数据并输出, 然后执行歩骤 S64; 否则, 直接执行歩骤 S64;  Step S63: If the third byte buffer is not empty, reading the data of one byte in the third byte buffer and outputting, and then executing step S64; otherwise, directly executing step S64;
步骤 S64: 如果第四字节缓存不为空状态, 则读取该第四字节缓存中一 个字节的数据并输出, 然后执行步骤 S61 ; 否则, 直接执行步骤 S65;  Step S64: If the fourth byte buffer is not empty, the data of one byte in the fourth byte buffer is read and output, and then step S61 is performed; otherwise, step S65 is directly performed;
歩骤 S65 : 如果当前已经处理完所有输入的上下文符号对, 则结束整个 编码过程, 否则, 直接返回歩骤 S61。  Step S65: If all the input context symbol pairs have been processed, the entire encoding process is ended, otherwise, the process returns directly to step S61.
以上, 对本发明的算术熵编码方法的具体实施方式进行了详细的说明。 本发明的效果可以通过以下实验数据进一步说明。  The specific embodiments of the arithmetic entropy coding method of the present invention have been described in detail above. The effects of the present invention can be further illustrated by the following experimental data.
表 4给出了本发明分别采用 Xilinx的 FPGA芯片 XC2V3000以及 Altera 的 FPGA芯片 STRATIX实现的编码方法的主要技术指标, 包括 FPGA资源 利用情况即 Slice和 LC使用数目、内部占用的存储位数目以及与处理速度相 关的时钟频率和吞吐率。 Table 4 shows the FPGA chip XC2V3000 and Altera using Xilinx respectively. The main technical specifications of the encoding method implemented by the FPGA chip STRATX include the FPGA resource utilization, ie the number of Slice and LC usage, the number of internally occupied memory bits, and the clock frequency and throughput rate associated with the processing speed.
表 4 本发明实现的编码系统的主要技术指标  Table 4 Main technical indicators of the coding system implemented by the present invention
Figure imgf000026_0001
Figure imgf000026_0001
从表 4可见, 本发明实现了在单个时钟处理双上下文符号对的算术熵编 码, 编码速度和效率显著提高。  As can be seen from Table 4, the present invention achieves arithmetic entropy coding of dual context symbol pairs in a single clock, with a significant increase in coding speed and efficiency.
表 5 给出了本发明与现有技术在编码速度和实现复杂度方面的定性比 较。 可以看出, 就处理速度而言, 本发明与现有的第五种编码方法的处理速 度最高, 均达到了 2上下文 /时钟, 但是就复杂度而言, 第五种编码方法的现 复杂度明显高于比本发明,该方法内部存储容量为 8192位,而本发明的内部 存储容量仅为 1509位。  Table 5 gives a qualitative comparison of the present invention with the prior art in terms of coding speed and implementation complexity. It can be seen that, in terms of processing speed, the present invention and the existing fifth encoding method have the highest processing speed, both of which reach 2 context/clock, but in terms of complexity, the current complexity of the fifth encoding method Significantly higher than the present invention, the internal storage capacity of the method is 8192 bits, while the internal storage capacity of the present invention is only 1509 bits.
表 5本发明与现有技术在编码速度和实现复杂度方面的比较  Table 5 Comparison of the encoding speed and implementation complexity between the present invention and the prior art
Figure imgf000026_0002
Figure imgf000026_0002
从表 5可见,本发明显著地改善了编码速度,可进行高速实时编码处理, 同时实现复杂度较低。  As can be seen from Table 5, the present invention significantly improves the encoding speed, enables high-speed real-time encoding processing, and achieves low complexity.
以上描述仅是本发明的一个具体实例,显然对于本领域的专业人员来说, 在了解了本发明内容和原理后,都可能在不背离本发明原理、结构的情况下, 进行形式和细节上的各种修正和改变, 但是这些基于本发明思想的修正和改 变仍在本发明的权利要求保护范围之内。  The above description is only one specific embodiment of the present invention, and it is obvious to those skilled in the art that the present invention may be carried out in the form and details without departing from the principles and the structure of the present invention. Various modifications and changes are possible, but are intended to be included within the scope of the appended claims.

Claims

权 利 要 求 书 Claim
1、 一种基于 JPEG2000标准的高速实时处理算术熵编码方法, 其特征在 于, 包括:  A high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard, which is characterized in that:
概率区间值确定步骤, 根据并行输入的两个上下文符号对, 判断编码符 号类型, 并根据该编码符号类型, 对概率区间值与编码参数进行更新;  The probability interval value determining step determines the coding symbol type according to the two context symbol pairs input in parallel, and updates the probability interval value and the coding parameter according to the coding symbol type;
码值归一化步骤, 根据上述编码符号类型对码值进行更新, 根据更新后 的概率区间值以及编码参数,判断当前归一化类型并进行归一化处理,并且, 输出归一化码流和排空码流;  a code value normalization step, updating the code value according to the above coded symbol type, determining the current normalization type according to the updated probability interval value and the coding parameter, and performing normalization processing, and outputting the normalized code stream And emptying the stream;
码流缓存步骤, 按照码流输出的先后顺序, 根据上述归一化码流和排空 码流的输出字节数, 对上述归一化码流和排空码流分别进行分类缓存, 并且 并行输出; 以及  a code stream buffering step, according to the sequence of outputting the code stream, classifying and buffering the normalized code stream and the emptying code stream according to the outputted byte number of the normalized code stream and the emptying code stream, respectively, and concurrently Output;
输出步骤, 将在上述码流缓存步骤中并行输出的上述归一化码流和排空 码流按照规定的优先级顺序依次串行输出。  In the outputting step, the normalized code stream and the empty code stream outputted in parallel in the code stream buffering step are sequentially serially output in a predetermined priority order.
2、如权利要求 1所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 2. The JPEG2000 standard-based high speed real-time processing arithmetic entropy coding method according to claim 1, wherein:
在上述概率区间值确定步骤中包括:  In the above probability interval value determining step, the method includes:
从并行输入的由上下文标号和上下文判决构成的两个上下文符号对, 读 取双编码索引和分别对应于双上下文标号的双大概率符号标识的步骤;  Steps of reading a double-coded index and a double-large probability symbol corresponding to the double context label, respectively, from two context symbol pairs consisting of a context label and a context decision entered in parallel;
根据上述双大概率符号标识和与其对应的双上下文判决, 确定双上下文 符号对的概率类型的步骤,该概率类型为双大概率符号、大概率 /小概率符号、 小概率、 大概率符号以及双小概率符号;  Determining, according to the double-high probability symbol identifier and the dual context decision corresponding thereto, a probability type of a double context symbol pair, the probability type being a double probability symbol, a large probability/small probability symbol, a small probability, a large probability symbol, and a double Small probability symbol;
根据输入的双上下文标号, 确定上下文标号的异同的歩骤;  Determining the similarities and differences of the context labels according to the input double context label;
根据上下文标号的异同和双上下文符号对的概率类型, 联合确定双上下 文符号对的类型的步骤; 以及  And step of jointly determining the type of the double context symbol pair according to the similarity and difference of the context label and the probability type of the double context symbol pair;
按照双上下文符号对的类型, 更新概率区间值的步骤。  The step of updating the probability interval value according to the type of the double context symbol pair.
3、 如权利要求 2所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 上述更新概率区间值的歩骤包括如下步骤: 3. The JPEG2000 standard-based high-speed real-time processing arithmetic entropy coding method according to claim 2, wherein: The foregoing step of updating the probability interval value includes the following steps:
根据所得到的上述双编码索引, 从预先设定的概率估值表中分别读取对 应的第一小概率符号概率值 QeO及第二小概率符号概率值 Qel ;  Obtaining, according to the obtained double-encoded index, a corresponding first small probability symbol probability value QeO and a second small probability symbol probability value Qel from the preset probability estimation table;
将上述第一小概率符号概率值 QeO及第二小概率符号概率值 Qel分别保 存到第一临时变量 temp2和第二临时变量 tempO中, 同时计算当前概率区间 值 A与第一小概率符号概率值 QeO的差值 Α-QeO, 并将其保存到第三临时变 量 tempi中;  The first small probability symbol probability value QeO and the second small probability symbol probability value Qel are respectively saved into the first temporary variable temp2 and the second temporary variable tempO, and the current probability interval value A and the first small probability symbol probability value are simultaneously calculated. The difference of QeO Α-QeO, and save it to the third temporary variable tempi;
分别更新第一和第三临时变量值;  Updating the first and third temporary variable values respectively;
同时根据双上下文符号对的类型, 更新第二临时变量值;  Updating the second temporary variable value according to the type of the double context symbol pair;
根据当前概率区间值 A与第一小概率符号概率值 QeO的关系, 对不同概 率类型的双上下文符号对, 分别计算概率区间临时变量值 A— temp;  According to the relationship between the current probability interval value A and the first small probability symbol probability value QeO, the probability interval temporary variable value A_temp is respectively calculated for the double context symbol pairs of different probability types;
对概率区间临时变量值 A— temp 进行修正, 如果概率区间临时变量值 A— temp小于十六进制值 0x8000, 则将其值左移一位, 此后重复该判断过程, 直到 A_temp大于或等于十六进制值 0x8000;  Correct the probability interval temporary variable value A_temp. If the probability interval temporary variable value A_temp is smaller than the hexadecimal value 0x8000, shift its value to the left by one bit, and then repeat the judgment process until A_temp is greater than or equal to ten. Hexadecimal value 0x8000;
将概率区间值 A更新为修正后的概率区间临时变量值 A_temp。  The probability interval value A is updated to the corrected probability interval temporary variable value A_temp.
4、 如权利要求 3所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 4. The JPEG2000 standard-based high speed real-time processing arithmetic entropy coding method according to claim 3, wherein:
更新第一和第三临时变量值, 是指通过该第一和第三临时变量值与十六 进制值 0x8000的关系进行更新, 如果该临时变量值小于十六进制值 0x8000, 则将该临时变量值左移一位, 此后重复该判断过程, 直到该临时变量值大于 或等于十六进制值 0x8000。  Updating the first and third temporary variable values means updating by the relationship between the first and third temporary variable values and the hexadecimal value 0x8000, if the temporary variable value is less than the hexadecimal value 0x8000, The value of the temporary variable is shifted to the left by one bit, and the decision process is repeated thereafter until the temporary variable value is greater than or equal to the hexadecimal value 0x8000.
5、 如权利要求 3所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 5. The JPEG2000 standard-based high speed real-time processing arithmetic entropy coding method according to claim 3, wherein:
更新第二临时变量值, 是按照如下步骤来进行的, 即:  Updating the second temporary variable value is done as follows:
如果双上下文符号对的类型是双大概率符号相同或者大概率 /小概率符号 相同, 则将第二临时变量值更新为概率估值表中下一个上下文符号为大概率 符号的概率值;  If the type of the double context symbol pair is the same as the double large probability symbol or the large probability/small probability symbol is the same, the second temporary variable value is updated to the probability value that the next context symbol in the probability valuation table is a large probability symbol;
如果双上下文符号对的类型是双小概率符号相同或者小概率 /大概率符号 相同, 则将第二临时变量值更新为概率估值表中下一个上下文符号为小概率 符号的概率值。 If the type of the double context symbol pair is the same as the double small probability symbol or the small probability / large probability symbol Similarly, the second temporary variable value is updated to a probability value in which the next context symbol in the probability estimate table is a small probability symbol.
6、 根据权利要求 3所述的基于 JPEG2000标准的高速实时处理算术熵编 码方法, 其特征在于, 6. The JPEG2000 standard-based high speed real-time processing arithmetic entropy coding method according to claim 3, wherein:
上述概率估值表包括如下 4个不同容量的子表:  The above probability valuation table includes the following four sub-tables of different capacities:
(a)小概率符号概率值表,该表的深度为 32,宽度为 13位,容量为 32x 13 位, 即采用 13位表示概率值;  (a) A small probability symbol probability value table having a depth of 32, a width of 13 bits, and a capacity of 32 x 13 bits, that is, 13 bits are used to represent the probability value;
( b )下一个上下文符号为大概率符号的概率值表, 该表的深度为 32, 宽 度为 13位, 容量为 32x 13位;  (b) The next context symbol is a probability value table of a large probability symbol having a depth of 32, a width of 13 bits, and a capacity of 32 x 13 bits;
(c)下一个上下文符号为小概率符号的概率值表, 该表的深度为 30, 宽 度为 13位, 容量为 30x 13位;  (c) The next context symbol is a probability value table of small probability symbols having a depth of 30, a width of 13 bits, and a capacity of 30 x 13 bits;
( d ) 前导零计数表, 该表的深度为 32, 宽度为 4位, 容量为 32x4位, 表中存储的每一个前导零计数值的取值范围从 1到 15。  (d) A leading zero count table with a depth of 32, a width of 4 bits, and a capacity of 32x4 bits. Each leading zero count value stored in the table ranges from 1 to 15.
7、 如权利要求 2所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 7. The JPEG2000 standard-based high speed real-time processing arithmetic entropy coding method according to claim 2, wherein:
在上述归一化歩骤中, 包括:  In the above normalization step, it includes:
读入在上述概率区间值确定步骤中输出的概率区间值和编码参数的步 骤;  The steps of reading the probability interval value and the encoding parameter outputted in the above-described probability interval value determining step;
根据上述概率类型和编码参数中的归一化过程标识, 对码值进行更新的 歩骤;  And updating the code value according to the normalization process identifier in the probability type and the coding parameter;
根据上述概率类型、 上述概率区间值、 上述归一化过程标识以及小概率 符号概率值, 判断当前归一化类型的步骤;  Determining a current normalization type according to the probability type, the probability interval value, the normalization process identifier, and the small probability symbol probability value;
根据上述归一化类型, 分别确定归一化码流的字节输出类型; 以及 根据上述字节输出类型和更新后的码值, 输出对应的码流字节的步骤。  Determining, according to the normalization type described above, a byte output type of the normalized code stream; and outputting the corresponding code stream byte according to the byte output type and the updated code value.
8、 如权利要求 7所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 8. The JPEG2000 standard-based high speed real-time processing arithmetic entropy coding method according to claim 7, wherein:
在双上下文符号对的概率类型为双大概率符号的情况下, 如果概率区间值小于第一小概率符号概率值的两倍, 则调整第一小概率 符号概率值; 若调整后的第一小概率符号概率值小于第二小概率符号概率值 的两倍, 则当前归一化类型为一类双次归一化, 否则, 计算调整后的第一小 概率符号概率值与第二小概率符号概率值之间的差值, 若该差值小于十六进 制值 0x8000, 则当前归一化类型为二类双次归一化, 否则为单次归一化; 如果概率区间值大于或等于第一小概率符号概率值的两倍, 计算概率区 间值与第一小概率符号概率值的差值, 并比较该差值与十六进制值 0x8000的 关系: 若该差值小于十六进制值 0x8000, 则调整概率区间值与第一小概率符 号概率值的差值; 若调整后的差值小于第二小概率符号概率值的两倍, 则当 前归一化类型为一类双次归一化, 否则, 比较该调整后的差值与第二小概率 符号概率值, 若该调整后的差值与第二小概率符号概率值之间的差值小于十 六进制值 0x8000, 则当前归一化类型为二类双次归一化,否则为单次归一化; 若该差值大于或等于十六进制值 0x8000, 则比较概率区间值和第一小概率符 号概率值的差值与第二小概率符号概率值的关系: 若概率区间值与第一小概 率符号概率值的差值小于第二小概率符号概率值的两倍, 则当前归一化类型 为单次归一化, 否则计算概率区间值与第一小概率符号概率值的差值, 若该 差值小于第二小概率符号概率值与十六进制值 0x8000的和值, 则当前归一化 类型为单次归一化, 否则为零次归一化。 In the case where the probability type of the pair of double context symbols is a double probability symbol, If the probability interval value is less than twice the first small probability symbol probability value, adjusting the first small probability symbol probability value; if the adjusted first small probability symbol probability value is less than twice the second small probability symbol probability value, The current normalization type is a type of double normalization, otherwise, the difference between the adjusted first small probability symbol probability value and the second small probability symbol probability value is calculated, if the difference is less than hexadecimal If the value is 0x8000, the current normalization type is a second-class double normalization, otherwise it is a single normalization; if the probability interval value is greater than or equal to twice the probability value of the first small probability symbol, the probability interval value is calculated. The difference between the probability values of a small probability symbol, and comparing the difference with the hexadecimal value 0x8000: If the difference is less than the hexadecimal value 0x8000, the probability interval value and the first small probability symbol probability value are adjusted The difference is: if the adjusted difference is less than twice the probability value of the second small probability symbol, the current normalization type is a type of double normalization, otherwise, the adjusted difference is compared with the second small Probability symbol probability value If the difference between the adjusted difference and the second small probability symbol probability value is less than the hexadecimal value 0x8000, the current normalization type is a second-class double normalization, otherwise a single normalization If the difference is greater than or equal to the hexadecimal value 0x8000, the relationship between the difference between the probability interval value and the first small probability symbol probability value and the second small probability symbol probability value: if the probability interval value is the first small If the difference between the probability symbol probability values is less than twice the second small probability symbol probability value, then the current normalization type is a single normalization, otherwise the difference between the probability interval value and the first small probability symbol probability value is calculated. The difference is less than the sum of the second small probability symbol probability value and the hexadecimal value 0x8000, then the current normalization type is a single normalization, otherwise zero normalization.
9、 如权利要求 7所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 9. The JPEG2000 standard-based high speed real-time processing arithmetic entropy coding method according to claim 7, wherein:
在双上下文符号对的概率类型为大概率 /小概率符号的情况下,  In the case where the probability type of the pair of double context symbols is a large probability/small probability symbol,
如果概率区间值小于第一小概率符号概率值的两倍, 则调整第一小概率 符号概率值, 若调整后的第一小概率符号概率值小于第二小概率符号概率值 的两倍, 则当前归一化类型为二类双次归一化, 否则为一类双次归一化; 如果概率区间值大于或等于第一小概率符号概率值的两倍, 且概率区间 值与第一小概率符号概率值的差值大于或等于十六进制值 0x8000, 则当前归 一化类型为单次归一化, 否则, 调整概率区间值与第一小概率符号概率值的 差值, 若调整后的差值大于或等于第二小概率符号概率值的两倍, 则当前归 一化类型为一类双次归一化, 否则为二类双次归一化。 If the probability interval value is less than twice the first small probability symbol probability value, adjusting the first small probability symbol probability value, if the adjusted first small probability symbol probability value is less than twice the second small probability symbol probability value, The current normalization type is the second-class double-order normalization, otherwise it is a class of double-order normalization; if the probability interval value is greater than or equal to twice the probability value of the first small probability symbol, and the probability interval value is the first small If the difference between the probabilistic symbol probability values is greater than or equal to the hexadecimal value 0x8000, the current normalization type is a single normalization. Otherwise, the difference between the probability interval value and the first small probability symbol probability value is adjusted. The subsequent difference is greater than or equal to twice the probability value of the second small probability symbol, then the current normalization type is a type of double normalization, otherwise it is a second type of double normalization.
10、如权利要求 7所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 10. The JPEG2000 standard-based high speed real time processing arithmetic entropy coding method according to claim 7, wherein:
在双上下文符号对的概率类型为小概率 /大概率符号的情况下,  In the case where the probability type of the pair of double context symbols is a small probability/high probability symbol,
如果概率区间值大于或等于第一小概率符号概率值的两倍, 则调整第一 小概率符号概率值, 若调整后的第一小概率符号概率值小于第二小概率符号 概率值的两倍, 则当前归一化类型为二类双次归一化, 否则, 计算该调整后 的第一小概率符号概率值与第二小概率符号概率值的差值, 如果该差值小于 十六进制值 0x8000, 则当前归一化类型为二类双次归一化, 否则为单次归一 化;  If the probability interval value is greater than or equal to twice the first small probability symbol probability value, adjusting the first small probability symbol probability value, if the adjusted first small probability symbol probability value is less than twice the second small probability symbol probability value , the current normalization type is a second-class double-order normalization, otherwise, the difference between the adjusted first small probability symbol probability value and the second small probability symbol probability value is calculated, if the difference is less than sixteen If the value is 0x8000, the current normalization type is the second-class double normalization, otherwise it is a single normalization;
如果概率区间值小于第一小概率符号概率值的两倍, 则调整概率区间值 与第一小概率符号概率值的差值, 若该调整后的差值小于第二小概率符号概 率值的两倍, 则当前归一化类型为一类双次归一化, 否则, 比较该调整后的 差值与第二小概率符号概率值, 如果该调整后的差值与第二小概率符号概率 值之间的差值小于十六进制值 0x8000,则当前归一化类型为二类双次归一化, 否则为单次归一化。  If the probability interval value is less than twice the first small probability symbol probability value, adjusting the difference between the probability interval value and the first small probability symbol probability value, if the adjusted difference is less than the second small probability symbol probability value If the current normalized type is a type of double normalization, otherwise, the adjusted difference and the second small probability symbol probability value are compared, if the adjusted difference and the second small probability symbol probability value The difference between the values is less than the hexadecimal value 0x8000, then the current normalization type is the second-class double-normalization, otherwise it is a single normalization.
11、如权利要求 7所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 11. The JPEG2000 standard-based high speed real-time processing arithmetic entropy coding method according to claim 7, wherein:
在双上下文符号对的概率类型为双小概率符号的情况下, 将归一化类型 判断为一类双次归一化。  In the case where the probability type of the pair of double context symbols is a double small probability symbol, the normalized type is judged as a type of double normalization.
12、如权利要求 7所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, 12. The JPEG2000 standard-based high speed real time processing arithmetic entropy coding method according to claim 7, wherein:
对码值进行更新, 是指在第一上下文符号对是大概率符号的条件下, 计 算第二小概率符号概率值与当前码值的和值, 并将码值更新为该和值。  Updating the code value means that the sum of the second small probability symbol probability value and the current code value is calculated under the condition that the first context symbol pair is a large probability symbol, and the code value is updated to the sum value.
13、 如权利要求 8~10中任一项所述的基于 JPEG2000标准的高速实时处 理算术熵编码方法, 其特征在于, The high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard according to any one of claims 8 to 10, characterized in that
调整第一小概率符号概率值, 是指将第一小概率符号概率值左移若干次, 直到该值大于或等于十六进制值 0x8000。 Adjusting the first small probability symbol probability value means shifting the first small probability symbol probability value to the left several times, Until the value is greater than or equal to the hexadecimal value 0x8000.
14、 如权利要求 8~10中任一项所述的基于 JPEG2000标准的高速实时处 理算术熵编码方法, 其特征在于, The high-speed real-time processing arithmetic entropy coding method based on the JPEG2000 standard according to any one of claims 8 to 10, characterized in that
调整概率区间值与第一小概率符号概率值的差值, 是将概率区间值与第 一小概率符号概率值的差值左移若干次, 直到该值大于或等于十六进制值 0x8000。  The difference between the adjusted probability interval value and the first small probability symbol probability value is that the difference between the probability interval value and the first small probability symbol probability value is shifted left a number of times until the value is greater than or equal to the hexadecimal value 0x8000.
15、如权利要求 7所述的基于 JPEG2000标准的高速实时处理算术熵编码 方法, 其特征在于, A high-speed real-time arithmetic arithmetic entropy coding method based on the JPEG2000 standard according to claim 7, wherein:
当没有新的上下文符号对输入时, 对码值进行排空处理, 并得到相应的 排空码流。  When there is no new context symbol pair input, the code value is drained and the corresponding empty code stream is obtained.
16、 如权利要求 8~11中任一项所述的基于 JPEG2000标准的高速实时处 理算术熵编码方法, 其特征在于, The high-speed real-time arithmetic arithmetic entropy coding method based on the JPEG2000 standard according to any one of claims 8 to 11, wherein
在对单次归一化码流、 一类双次归一化码流、 二类双次归一化码流和排 空码流分别进行分类缓存时, 按照如下规则进行:  When classifying and buffering a single normalized code stream, a type of double normalized code stream, a second type of double normalized code stream, and an empty code stream, the following rules are performed:
(1)对于单字节输出码流, 将其缓存到第一字节缓存中;  (1) For a single-byte output stream, cache it in the first byte buffer;
(2)对于双字节输出码流, 将其依次缓存到第一、 第二字节缓存中; (2) for the two-byte output code stream, it is sequentially buffered into the first and second byte buffers;
(3)对于三字节输出码流, 将其依次缓存到第一至第三字节缓存中;(3) for the three-byte output code stream, it is sequentially buffered into the first to third byte buffers;
(4)对于四字节输出码流, 将其依次缓存到第一至第四字节缓存中。 (4) For the four-byte output code stream, it is sequentially buffered into the first to fourth byte buffers.
PCT/CN2010/080584 2010-03-19 2010-12-31 Method for processing arithmetic entropy coding in real time at high-speed based on joint photographic experts group (jpeg) 2000 standard WO2011113290A1 (en)

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
CN201010128736.9 2010-03-19
CN201010128710.4 2010-03-19
CN 201010128830 CN101848388B (en) 2010-03-19 2010-03-19 Method for normalizing arithmetic encoding value based on JPEG (Joint Photographic Experts Group) 2000 standard
CN201010128830.4 2010-03-19
CN 201010128710 CN101841707B (en) 2010-03-19 2010-03-19 High-speed real-time processing arithmetic coding method based on JPEG 2000 standard
CN 201010128736 CN101848387A (en) 2010-03-19 2010-03-19 Method for determining arithmetic encoding probability interval value based on JPEG (Joint Photographic Experts Group) 2000 standard

Publications (1)

Publication Number Publication Date
WO2011113290A1 true WO2011113290A1 (en) 2011-09-22

Family

ID=44648435

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/080584 WO2011113290A1 (en) 2010-03-19 2010-12-31 Method for processing arithmetic entropy coding in real time at high-speed based on joint photographic experts group (jpeg) 2000 standard

Country Status (1)

Country Link
WO (1) WO2011113290A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101820549A (en) * 2010-03-19 2010-09-01 西安电子科技大学 High-speed real-time processing arithmetic entropy coding system based on JPEG2000
CN101841707A (en) * 2010-03-19 2010-09-22 西安电子科技大学 High-speed real-time processing arithmetic coding method based on JPEG 2000 standard
CN101848387A (en) * 2010-03-19 2010-09-29 西安电子科技大学 Method for determining arithmetic encoding probability interval value based on JPEG (Joint Photographic Experts Group) 2000 standard
CN101848388A (en) * 2010-03-19 2010-09-29 西安电子科技大学 Method for normalizing arithmetic encoding value based on JPEG (Joint Photographic Experts Group) 2000 standard

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101820549A (en) * 2010-03-19 2010-09-01 西安电子科技大学 High-speed real-time processing arithmetic entropy coding system based on JPEG2000
CN101841707A (en) * 2010-03-19 2010-09-22 西安电子科技大学 High-speed real-time processing arithmetic coding method based on JPEG 2000 standard
CN101848387A (en) * 2010-03-19 2010-09-29 西安电子科技大学 Method for determining arithmetic encoding probability interval value based on JPEG (Joint Photographic Experts Group) 2000 standard
CN101848388A (en) * 2010-03-19 2010-09-29 西安电子科技大学 Method for normalizing arithmetic encoding value based on JPEG (Joint Photographic Experts Group) 2000 standard

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU QIWEI: "Study and Design of Arithmetic Encoder for JPEG2000 Master Thesis", 31 December 2006 (2006-12-31), ZHEJIANG UNIVERSITY, Retrieved from the Internet <URL:http://dlib.cnki.net/kns50/detail.aspx?dbname=CMFD2006&filename=2006080946.nh> [retrieved on 20110303] *

Similar Documents

Publication Publication Date Title
US20220060724A1 (en) Method and system for optimized delta encoding
WO2011113291A1 (en) High-speed real-time processing arithmetic entropy coding system based on joint photographic experts group (jpeg) 2000 standard
CN101841707B (en) High-speed real-time processing arithmetic coding method based on JPEG 2000 standard
JPH11163733A (en) Encoding method and device
US8005306B2 (en) Decoding apparatus, inverse quantization method, and computer readable medium
Liu et al. VLSI architecture of arithmetic coder used in SPIHT
KR20110033175A (en) Method for treating digital data
CN101848387A (en) Method for determining arithmetic encoding probability interval value based on JPEG (Joint Photographic Experts Group) 2000 standard
CN103248896A (en) MQ (memory quotient) arithmetic coder
WO2020114283A1 (en) Data processing method and device
JP3230933B2 (en) Data decompression device, data decompression method, decoding device, decoding method, encoding device, and entropy decoder
Habboush et al. DE-ZFP: An FPGA implementation of a modified ZFP compression/decompression algorithm
WO2011113290A1 (en) Method for processing arithmetic entropy coding in real time at high-speed based on joint photographic experts group (jpeg) 2000 standard
Ramesh Kumar et al. Two-symbol FPGA architecture for fast arithmetic encoding in JPEG 2000
US8970405B2 (en) Method and apparatus for entropy decoding
Rhu et al. Optimization of arithmetic coding for JPEG2000
US20210157485A1 (en) Pattern-based cache block compression
Agostini et al. A FPGA based design of a multiplierless and fully pipelined JPEG compressor
CN103002275B (en) For two coefficient scanning methods of CAVLC coding
Milward et al. Design and implementation of a lossless parallel high-speed data compression system
US8363968B2 (en) Image coding method for facilitating run length coding and image encoding device thereof
Dong et al. Implementation of A Real-Time Lossless JPEG-LS Compression Algorithm Based on FPGA
CN1477879A (en) High-speed low power consumption MQ encoder applicable dto JPEG2000 standard
JP5612722B2 (en) Image compression device
Liu et al. A high throughput JPEG2000 entropy decoding unit architecture

Legal Events

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

Ref document number: 10847759

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 10847759

Country of ref document: EP

Kind code of ref document: A1