CN108401158B - Context adaptive binary arithmetic coding renormalization realization method and device - Google Patents

Context adaptive binary arithmetic coding renormalization realization method and device Download PDF

Info

Publication number
CN108401158B
CN108401158B CN201710067638.0A CN201710067638A CN108401158B CN 108401158 B CN108401158 B CN 108401158B CN 201710067638 A CN201710067638 A CN 201710067638A CN 108401158 B CN108401158 B CN 108401158B
Authority
CN
China
Prior art keywords
value
code stream
output
determining
operation channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710067638.0A
Other languages
Chinese (zh)
Other versions
CN108401158A (en
Inventor
张备
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sanechips Technology Co Ltd
Original Assignee
Sanechips Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanechips Technology Co Ltd filed Critical Sanechips Technology Co Ltd
Priority to CN201710067638.0A priority Critical patent/CN108401158B/en
Publication of CN108401158A publication Critical patent/CN108401158A/en
Application granted granted Critical
Publication of CN108401158B publication Critical patent/CN108401158B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers

Abstract

The invention discloses a method for realizing context self-adaptive binary arithmetic coding (CABAC) renormalization, which comprises the steps of acquiring coding information of an input code stream, and determining an operation channel value corresponding to a coding interval in the coding information according to a preset corresponding rule; and according to the operation channel value, performing renormalization calculation on the coding information by adopting a preset strategy corresponding to the operation channel value. The invention also discloses a device for realizing the context self-adaptive binary arithmetic coding renormalization.

Description

Context adaptive binary arithmetic coding renormalization realization method and device
Technical Field
The invention relates to a multimedia Coding and decoding technology, in particular to a method and a device for realizing Context-Adaptive Binary Arithmetic Coding (CABAC) renormalization.
Background
The application range of multimedia is increasingly wider, and the requirements of consumers on the quality and the resolution of videos are higher, so that the bandwidth required by video transmission is higher. Therefore, the video encoding and decoding scheme is widely applied to various electronic products such as televisions, boxes, mobile phones, monitors and the like as an important technology.
The entropy coding technology is one of the important technical means of image and video compression, and can effectively remove redundant information in a binary code stream and reduce the data volume. CABAC is the main entropy coding technique adopted in coding and decoding schemes including h.265, h.264, etc.; the renormalization process is an important step in CABAC coding, and in a general implementation, the renormalization process uses an indefinite number of cycles, which is difficult to implement in hardware.
Therefore, how to overcome the uncertainty in the renormalization process and make the renormalization suitable for hardware implementation is an urgent problem to be solved.
Disclosure of Invention
In view of this, embodiments of the present invention are intended to provide a method and an apparatus for implementing CABAC renormalization, so as to overcome uncertainty in a renormalization process and make the renormalization suitable for hardware implementation.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the embodiment of the invention provides a CABAC renormalization implementation method, which comprises the following steps:
acquiring coding information of an input code stream, and determining an operation channel value corresponding to a coding interval in the coding information according to a preset corresponding rule;
and according to the operation channel value, performing renormalization calculation on the coding information by adopting a preset strategy corresponding to the operation channel value.
In the foregoing solution, the performing renormalization calculation on the coding information by using a preset policy corresponding to the operation channel value includes:
according to the operation channel value, carrying out coding information left shift processing;
and determining a code stream output index value according to the interval lower limit in the coding information, determining a counter value according to the code stream output index value, and determining a renormalized output code stream.
In the foregoing solution, the performing the coding information left shift processing includes:
shifting the binary number of the coding interval to the left by the digit of the operation channel value, and determining the binary number as an output coding interval;
and taking a binary number of the interval lower limit of 9 minus the difference digit of the operation channel value from the interval lower limit, leftwards shifting the binary number by the same digit as the value of the operation channel value, and determining the binary number as the output interval lower limit.
In the above scheme, the determining a code stream output index value according to the interval lower limit in the coding information, determining a counter value according to the code stream output index value, and determining a renormalized output code stream includes:
shifting the binary number of the interval lower limit to the right by 9 minus difference digits of the operation channel value, and determining the shifted value as a code stream output index value;
when the code stream output index value is smaller than the comparison threshold value, judging whether the first bit zone bit of the input code stream is 0, if so, outputting one bit of 0, and then outputting 1 of the numerical digit of the counter value, otherwise, marking the first bit with the position of 0, and outputting 1 of the numerical digit of the counter value; determining the sequentially output values as a first output code stream;
when the code stream output index value is larger than the comparison threshold value, judging whether the first bit flag bit of the input code stream is 0, if so, outputting a bit 1, and outputting 0 of the numerical digit of the counter value, otherwise, marking the first bit at the position 0 and outputting 0 of the numerical digit of the counter value; determining the sequentially output values as a first output code stream;
the binary number of the numerical value of the operation channel value in the code stream output index value is taken from the low order and determined as the current code stream output index value, the table lookup binary code stream and the table lookup binary width value corresponding to the current code stream output index value are determined from the preset index lookup table corresponding to the operation channel value, the table lookup binary code stream with the width of the determined table lookup binary width value is output from the low order, the output binary code stream is determined as the second output code stream, and the operation channel value is subtracted by 1 and then the difference between the table lookup binary width values is subtracted to determine as the output counter value;
determining the first output code stream and the second output code stream which are sequentially output as renormalized output code streams;
the method further comprises the following steps: when the code stream output index value is equal to the comparison threshold value, adding the counter value to the operation channel value to serve as an output counter value;
the difference between the arithmetic channel value power of 2 and 1 is the contrast threshold.
In the above scheme, the method further comprises:
and when the operation channel value is 1, determining the first output code stream as a renormalized output code stream.
In the foregoing solution, the presetting of the corresponding rule includes:
presetting more than one coding interval threshold from small to large, and presetting an operation channel value corresponding to each coding interval threshold;
and determining that the minimum one of the threshold values of the coding intervals is larger than the threshold value of the coding interval, and determining the operation channel value corresponding to the threshold value of the coding interval as the operation channel value corresponding to the coding interval.
In the foregoing scheme, the coding interval threshold includes: 4. 8, 16, 32, 64, 128, 256;
the operation channel values corresponding to the coding interval thresholds are respectively as follows: 7. 6, 5, 4, 3, 2 and 1.
The embodiment of the invention also provides a CABAC renormalization implementation device, which comprises: a channel determining module and a channel calculating module, wherein,
the channel determining module is used for acquiring coding information of an input code stream and determining an operation channel value corresponding to a coding interval in the coding information according to a preset corresponding rule;
and the channel operation module is used for performing renormalization calculation on the coding information by adopting a preset strategy corresponding to the operation channel value according to the operation channel value.
In the foregoing solution, the channel operation module is specifically configured to:
according to the operation channel value, carrying out coding information left shift processing;
and determining a code stream output index value according to the interval lower limit in the coding information, determining a counter value according to the code stream output index value, and determining a renormalized output code stream.
In the foregoing solution, the channel operation module is specifically configured to:
shifting the binary number of the coding interval to the left by the digit of the operation channel value, and determining the binary number as an output coding interval;
and taking a binary number of the interval lower limit of 9 minus the difference digit of the operation channel value from the interval lower limit, leftwards shifting the binary number by the same digit as the value of the operation channel value, and determining the binary number as the output interval lower limit.
In the foregoing solution, the channel operation module is specifically configured to:
shifting the binary number of the interval lower limit to the right by 9 minus difference digits of the operation channel value, and determining the shifted value as a code stream output index value;
when the code stream output index value is smaller than the comparison threshold value, judging whether the first bit zone bit of the input code stream is 0, if so, outputting one bit of 0, and then outputting 1 of the numerical digit of the counter value, otherwise, marking the first bit with the position of 0, and outputting 1 of the numerical digit of the counter value; determining the sequentially output values as a first output code stream;
when the code stream output index value is larger than the comparison threshold value, judging whether the first bit flag bit of the input code stream is 0, if so, outputting a bit 1, and outputting 0 of the numerical digit of the counter value, otherwise, marking the first bit at the position 0 and outputting 0 of the numerical digit of the counter value; determining the sequentially output values as a first output code stream;
the binary number of the numerical value of the operation channel value in the code stream output index value is taken from the low order and determined as the current code stream output index value, the table lookup binary code stream and the table lookup binary width value corresponding to the current code stream output index value are determined from the preset index lookup table corresponding to the operation channel value, the table lookup binary code stream with the width of the determined table lookup binary width value is output from the low order, the output binary code stream is determined as the second output code stream, and the operation channel value is subtracted by 1 and then the difference between the table lookup binary width values is subtracted to determine as the output counter value;
determining the first output code stream and the second output code stream which are sequentially output as renormalized output code streams;
the channel operation module is further configured to:
when the code stream output index value is equal to the comparison threshold value, adding the counter value to the operation channel value to serve as an output counter value;
the difference between the arithmetic channel value power of 2 and 1 is the contrast threshold.
In the foregoing solution, the channel operation module is specifically configured to:
and when the operation channel value is 1, determining the first output code stream as a renormalized output code stream.
In the foregoing solution, the channel determining module is specifically configured to:
presetting more than one coding interval threshold from small to large, and presetting an operation channel value corresponding to each coding interval threshold;
and determining that the minimum one of the threshold values of the coding intervals is larger than the threshold value of the coding interval, and determining the operation channel value corresponding to the threshold value of the coding interval as the operation channel value corresponding to the coding interval.
In the foregoing scheme, the coding interval threshold includes: 4. 8, 16, 32, 64, 128, 256;
the operation channel values corresponding to the coding interval thresholds are respectively as follows: 7. 6, 5, 4, 3, 2 and 1.
The method and the device for realizing CABAC renormalization provided by the embodiment of the invention are used for acquiring the coding information of an input code stream and determining the operation channel value corresponding to the coding interval in the coding information according to the preset corresponding rule; and according to the operation channel value, performing renormalization calculation on the coding information by adopting a preset strategy corresponding to the operation channel value. Therefore, the input code stream is subjected to renormalization calculation according to the channel, uncertain circular processing is not needed, uncertainty in the renormalization process is overcome, and the renormalization is suitable for hardware implementation.
Drawings
FIG. 1 is a schematic flow chart of a CABAC renormalization implementation method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a prior art renormalization implementation method according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of bit output in the CABAC renormalization implementation method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating the allocation of operation channels according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a specific implementation flow of the channel 3 of the CABAC renormalization implementation method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating an output flow of a second output code stream according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a CABAC renormalization implementation apparatus according to an embodiment of the present invention.
Detailed Description
In the embodiment of the invention, the coding information of an input code stream is obtained, and the operation channel value corresponding to the coding interval in the coding information is determined according to the preset corresponding rule; and according to the operation channel value, performing renormalization calculation on the coding information by adopting a preset strategy corresponding to the operation channel value.
The present invention will be described in further detail with reference to examples.
As shown in fig. 1, the method for implementing CABAC renormalization provided by an embodiment of the present invention includes:
step 110: acquiring coding information of an input code stream, and determining an operation channel value corresponding to a coding interval in the coding information according to a preset corresponding rule;
in the prior art, a CABAC renormalization implementation process is shown in fig. 2, where Range is a coding interval, Low is an interval lower limit, Count is a counter, and "< <" represents a left shift symbol; the implementation of PutBit () is shown in fig. 3, B in fig. 3 represents that the input is 0 or 1, and firstBitFlag is the first bit flag of the input code stream; the combination of 0 and 1 output in the process is the coded code stream. In the CABAC renormalization flow shown in fig. 2, an indefinite number of loops are involved, the number of loops is related to a Range value, and the indefinite number of loops is easy to implement by software, but when implemented by hardware, the timing is not controllable, and the implementation is difficult. In order to overcome the problem, the invention provides an improved scheme, which overcomes the uncertainty in the renormalization process and enables the renormalization to be suitable for hardware realization;
here, the renormalization process may be performed by hardware logic in the CABAC encoding chip; acquiring coding information of an input code stream, and determining an operation channel (Loop) value corresponding to a coding interval (Range) in the coding information according to a preset corresponding rule; the preset correspondence rule may be: presetting more than one coding interval threshold from small to large, and presetting an operation channel value corresponding to each coding interval threshold; determining that the minimum one of the threshold values of the coding intervals is larger than the threshold value of the coding interval, and determining the operation channel value corresponding to the threshold value of the coding interval as the operation channel value corresponding to the coding interval;
specifically, the coding interval threshold may include: 4. 8, 16, 32, 64, 128, 256; the operation channel values corresponding to the coding interval thresholds are respectively as follows: 7. 6, 5, 4, 3, 2, 1; it may be determined to enter the corresponding operation channel according to the Range value, if Range <4, then Loop is 7, if Range <8, then Loop is 6, if Range <16, then Loop is 5, if Range <32, then Loop is 4, if Range <64, then Loop is 3, if Range <128, then Loop is 2, Range <256, then Loop is 1, and thus, there may be 8 channels to process, as shown in fig. 4, if Range exceeds 256, then the Loop value may be determined to be 0, and if the Range value is 0, then nothing is done, and the renormalization process is completed; and when the Loop value is not 0, the coding information of the input code stream enters an operation channel corresponding to the Loop value for processing.
Step 120, according to the operation channel value, performing renormalization calculation on the coding information by adopting a preset strategy corresponding to the operation channel value;
here, the coding information of the input code stream enters the corresponding operation channel for calculation, each operation channel determines the parameters of the operation channel according to the Loop value, and the input code stream is processed; here, as shown in fig. 5, a Loop — 3 will be described as an example. In fig. 5, index is a code stream output index value calculated from a section lower limit (Low), ">" denotes a right shift symbol, and "&" denotes an and symbol;
specifically, the specific step of processing the input code stream coding information by the operation channel may be divided into two branches in parallel: processing the branch 1 and the branch 2;
in branch 1, as shown in step 1210 in fig. 5, the encoded information may be left-shifted according to the operation channel value; shifting the binary number of the coding interval to the left by the digit of the operation channel value, and determining the binary number as an output coding interval; taking binary number of the interval lower limit of 9 minus the difference digit of the operation channel value from the interval lower limit, shifting left the binary number by the digit same as the value of the operation channel value, and determining the binary number as the output interval lower limit; wherein, the corresponding relation between each operation channel value and the value of the interval lower limit digit is shown in table 1;
Figure BDA0001221372190000071
TABLE 1
Taking the Loop of fig. 5 as an example, shift Range to the left by the Loop value of 3, then according to table 1, take the lower 6 bits of the Low binary number, and shift the lower 6 bits of the Low binary number to the left by the Loop value of 3; according to table 1, when the loop value is 1, 8 bits of the Low binary number are taken, and when the loop value is 7, 2 bits of the Low binary number are taken, and the number of the taken bits is gradually decreased by 1 as the loop value increases;
in the branch 2, as shown in step 1220 in fig. 5, a code stream output index value may be determined according to the interval lower limit in the encoding information, a counter value may be determined according to the code stream output index value, and a renormalized output code stream may be determined;
specifically, as shown in step 1221 in fig. 5, the binary number of the lower limit of the interval may be right-shifted by 9 minus the number of difference bits of the operation channel value, and the shifted value is determined as the code stream output index value; the corresponding relation between the binary number right shift number of the lower limit of the interval and the operation channel value is also shown in table 1;
after determining the code stream output index value, as shown in step 1222 of fig. 5, the code stream output index value may be compared with a first comparison threshold, where the comparison threshold is a difference between 2 and 1 subtracted from the operation channel value to the power, as shown in formula 1:
2loop-1 (1)
when the code stream output index value is smaller than the comparison threshold, as shown in step 1223 of fig. 5, Putbit (0) is executed, and it may be determined whether the first bit flag bit of the input code stream is 0, if so, a bit of 0 is output first, and then 1 of the counter value digit is output, otherwise, the first bit flag bit is set to 0, and 1 of the current counter value digit is output; determining the sequentially output values as a first output code stream;
when the code stream output index value is greater than the comparison threshold value, as shown in step 1224 of fig. 5, Putbit (1) is executed, it may be determined whether the first bit flag bit of the input code stream is 0, if so, a bit 1 is output first, 0 of the bit number of the output and counter value is output, otherwise, the first bit is marked at position 0, and 0 of the bit number of the current counter value is output; determining the sequentially output values as a first output code stream;
taking a Loop of fig. 5 as an example, according to table 1, the Low right shift value is 6, the value after the Low right shift is determined as a code stream output index value (index), the index is compared with a comparison threshold, and when the Loop is 3, the comparison threshold is 7; if index is less than 7, the flow of fig. 3 is performed, and B in putbin (B) is set to 0; if index is greater than 7, the process in fig. 3 is performed, and B in putbin (B) is set to 1, and the bit stream output by PutBit (0) or PutBit (1) is the first output code stream;
after the first output code stream is determined, as shown in step 1225 of fig. 5, the branch PutBin may enter a sub-branch PutBin for further processing, where a processing flow of the branch PutBin is as shown in fig. 6, binary numbers of bit numbers in code stream output index values and the operation channel value are determined as current code stream output index values, a lookup table binary code stream (lut _ bin) and a lookup table binary width value (lut _ width) corresponding to the current code stream output index values are determined from an index lookup table corresponding to a preset operation channel value, lut _ bin whose width is determined lut _ width is output from a lower position, the output binary code stream whose width is lut _ width is determined as a second output code stream, and a difference between the operation channel value and lut _ width is subtracted by 1 to determine as an output counter value; determining the first output code stream and the second output code stream which are sequentially output as renormalized output code streams; lut _ bin and lut _ width are two look-up tables with 7 elements, lut _ bin stores the binary number to be output, and lut _ width stores how many bits to output. Lut _ width [ index ] bits from the lower bits in lut _ bin [ index ] are reserved and output.
Here, the operation channel value corresponding index lookup tables are shown in tables 2 to 7, and correspond to operation channel values 2 to 7, respectively;
index 0 1 2
lut_bin 0 0 1
lut_width 1 0 1
TABLE 2
index 0 1 2 3 4 5 6
lut_bin 00 00 01 00 10 01 11
lut_width 2 1 2 0 2 1 2
TABLE 3
Figure BDA0001221372190000081
Figure BDA0001221372190000091
TABLE 4
index 0 1 2 3 4 5 6 7
lut_bin 0000 0000 0001 0000 0010 0001 0011 0000
lut_width 4 3 4 2 4 3 4 1
index 8 9 10 11 12 13 14 15
lut_bin 0100 0010 0101 0001 0110 0011 0111 0000
lut_width 4 3 4 2 4 3 4 0
index 16 17 18 19 20 21 22 23
lut_bin 1000 0100 1001 0010 1010 0101 1011 0001
lut_width 4 3 4 2 4 3 4 1
index 24 25 26 27 28 29 30
lut_bin 1100 0110 1101 0011 1110 0111 1111
lut_width 4 3 4 2 4 3 4
TABLE 5
Figure BDA0001221372190000092
Figure BDA0001221372190000101
TABLE 6
Figure BDA0001221372190000102
Figure BDA0001221372190000111
TABLE 7
Taking a Loop of 3 as an example in fig. 5, and taking 3 bits of the index from the lower bits as a new index when the Loop is 3; lut _ width and lut _ bin can be determined from an index lookup table corresponding to Loop according to the new index, if the Loop is 3, the table 3 is inquired, lut _ bin with the determined lut _ width is output from the lower order, and the binary code stream with the output width of lut _ width is determined as a second output code stream; if the index is 0, the value of lut _ width is 2, which means that 2 bits are output, and the output code stream is "00"; when index is 1, lut _ width is 1, which means that 1bit is output, and the output code stream is "0"; when index is 3, lut _ width has a value of 0, indicating that no bitstream is output. When a second code stream is output, subtracting the lut _ width difference from 2 to determine the output counter value;
and finally, sequentially outputting the first output code stream and the second output code stream, wherein the sequentially output first output code stream and the sequentially output second output code stream can be determined as a renormalized output code stream.
Further, as shown in step 1226 in fig. 5, when the code stream output index value is equal to the comparison threshold, adding the current counter value to the operation channel value as the output counter value;
in fig. 5, for example, when Loop is 3, the counter value is added to the arithmetic channel value 3 to be the counter value to be output.
Therefore, the whole CABAC renormalization processing flow is completed, the output renormalized output code stream can be used as a part of the whole code stream, and the output counter, the output coding interval and the output interval lower limit can be used for subsequent coding processing.
As shown in fig. 7, the apparatus for implementing CABAC renormalization according to an embodiment of the present invention includes: a channel determination module 71 and a channel calculation module 72, wherein,
the channel determining module 71 is configured to obtain coding information of an input code stream, and determine an operation channel value corresponding to a coding interval in the coding information according to a preset correspondence rule;
in the prior art, a CABAC renormalization implementation process is shown in fig. 2, where Range is a coding interval, Low is an interval lower limit, Count is a counter, and "< <" represents a left shift symbol; the implementation of PutBit () is shown in fig. 3, B in fig. 3 represents that the input is 0 or 1, and firstBitFlag is the first bit flag of the input code stream; the combination of 0 and 1 output in the process is the coded code stream. In the CABAC renormalization flow shown in fig. 2, an indefinite number of loops are involved, the number of loops is related to a Range value, and the indefinite number of loops is easy to implement by software, but when implemented by hardware, the timing is not controllable, and the implementation is difficult. In order to overcome the problem, the invention provides an improved scheme, which overcomes the uncertainty in the renormalization process and enables the renormalization to be suitable for hardware realization;
here, the renormalization process may be performed by hardware logic in the CABAC encoding chip; acquiring coding information of an input code stream, and determining a Loop value corresponding to Range in the coding information according to a preset corresponding rule; the preset correspondence rule may be: presetting more than one coding interval threshold from small to large, and presetting an operation channel value corresponding to each coding interval threshold; determining that the minimum one of the threshold values of the coding intervals is larger than the threshold value of the coding interval, and determining the operation channel value corresponding to the threshold value of the coding interval as the operation channel value corresponding to the coding interval;
specifically, the coding interval threshold may include: 4. 8, 16, 32, 64, 128, 256; the operation channel values corresponding to the coding interval thresholds are respectively as follows: 7. 6, 5, 4, 3, 2, 1; it may be determined to enter the corresponding operation channel according to the Range value, if Range <4, then Loop is 7, if Range <8, then Loop is 6, if Range <16, then Loop is 5, if Range <32, then Loop is 4, if Range <64, then Loop is 3, if Range <128, then Loop is 2, Range <256, then Loop is 1, and thus, there may be 8 channels to process, as shown in fig. 4, if Range exceeds 256, then the Loop value may be determined to be 0, and if the Range value is 0, then nothing is done, and the renormalization process is completed; when the Loop value is not 0, the coding information of the input code stream enters an operation channel corresponding to the Loop value for processing;
the channel operation module 72 is configured to perform renormalization calculation on the encoded information by using a preset policy corresponding to the operation channel value according to the operation channel value;
here, the coding information of the input code stream enters the corresponding operation channel for calculation, each operation channel determines the parameters of the operation channel according to the Loop value, and the input code stream is processed; here, as shown in fig. 5, a Loop — 3 will be described as an example. In fig. 5, index is a code stream output index value calculated from Low, "> >" indicates a right shift symbol, and "&" indicates an and symbol;
specifically, the specific step of processing the input code stream coding information by the operation channel may be divided into two branches in parallel: processing the branch 1 and the branch 2;
in branch 1, as shown in step 1210 in fig. 5, the encoded information may be left-shifted according to the operation channel value; shifting the binary number of the coding interval to the left by the digit of the operation channel value, and determining the binary number as an output coding interval; taking binary number of the interval lower limit of 9 minus the difference digit of the operation channel value from the interval lower limit, shifting left the binary number by the digit same as the value of the operation channel value, and determining the binary number as the output interval lower limit; wherein, the corresponding relation between each operation channel value and the value of the interval lower limit digit is shown in table 1;
taking the Loop of fig. 5 as an example, shift Range to the left by the Loop value of 3, then according to table 1, take the lower 6 bits of the Low binary number, and shift the lower 6 bits of the Low binary number to the left by the Loop value of 3; according to table 1, when the loop value is 1, 8 bits of the Low binary number are taken, and when the loop value is 7, 2 bits of the Low binary number are taken, and the number of the taken bits is gradually decreased by 1 as the loop value increases;
in the branch 2, as shown in step 1220 in fig. 5, a code stream output index value may be determined according to the interval lower limit in the encoding information, a counter value may be determined according to the code stream output index value, and a renormalized output code stream may be determined;
specifically, as shown in step 1221 in fig. 5, the binary number of the lower limit of the interval may be right-shifted by 9 minus the number of difference bits of the operation channel value, and the shifted value is determined as the code stream output index value; the corresponding relation between the binary number right shift number of the lower limit of the interval and the operation channel value is also shown in table 1;
after determining the code stream output index value, as shown in step 1222 of fig. 5, the code stream output index value may be compared with a first comparison threshold, where the comparison threshold is a difference between 2 and 1 subtracted from the operation channel value to the power, as shown in formula 1;
when the code stream output index value is smaller than the comparison threshold, as shown in step 1223 of fig. 5, Putbit (0) is executed, and it may be determined whether the first bit flag bit of the input code stream is 0, if so, a bit of 0 is output first, and then 1 of the counter value digit is output, otherwise, the first bit flag bit is set to 0, and 1 of the current counter value digit is output; determining the sequentially output values as a first output code stream;
when the code stream output index value is greater than the comparison threshold value, as shown in step 1224 of fig. 5, Putbit (1) is executed, it may be determined whether the first bit flag bit of the input code stream is 0, if so, a bit 1 is output first, 0 of the bit number of the output and counter value is output, otherwise, the first bit is marked at position 0, and 0 of the bit number of the current counter value is output; determining the sequentially output values as a first output code stream;
taking a Loop of 3 in fig. 5 as an example, according to table 1, the Low right shift value is 6, the value after the Low right shift is determined as an index, the index is compared with a comparison threshold, and when the Loop is 3, the comparison threshold is 7; if index is less than 7, the flow of fig. 3 is performed, and B in putbin (B) is set to 0; if index is greater than 7, the process in fig. 3 is performed, and B in putbin (B) is set to 1, and the bit stream output by PutBit (0) or PutBit (1) is the first output code stream;
after the first output code stream is determined, as shown in step 1225 of fig. 5, the sub-branch PutBin may be entered for further processing, and a processing flow of the branch PutBin is as shown in fig. 6, binary numbers of bit numbers corresponding to the operation channel value in code stream output index values from a lower order are determined as a current code stream output index value, lut _ bin and lut _ width corresponding to the current code stream output index value are determined from a preset index lookup table corresponding to the operation channel value, lut _ bin having a width of lut _ width determined from a lower order is output, the binary code stream having an output width of lut _ width is determined as a second output code stream, and a difference between the operation channel value and lut _ width is subtracted by 1 to determine as an output counter value; determining the first output code stream and the second output code stream which are sequentially output as renormalized output code streams; wherein lut _ bin and lut _ width are two look-up tables with 7 elements, respectively, lut _ bin stores the binary number to be output, and lut _ width stores how many bits to output. Holding and outputting lut _ width [ index ] bits from lower bits in lut _ bin [ index ];
here, the operation channel value corresponding index lookup tables are shown in tables 2 to 7, and correspond to operation channel values 2 to 7, respectively;
taking a Loop of 3 as an example in fig. 5, and taking 3 bits of the index from the lower bits as a new index when the Loop is 3; lut _ width and lut _ bin can be determined from an index lookup table corresponding to Loop according to the new index, if the Loop is 3, the table 3 is inquired, lut _ bin with the determined lut _ width is output from the lower order, and the binary code stream with the output width of lut _ width is determined as a second output code stream; if the index is 0, the value of lut _ width is 2, which means that 2 bits are output, and the output code stream is "00"; when index is 1, lut _ width is 1, which means that 1bit is output, and the output code stream is "0"; when index is 3, lut _ width has a value of 0, indicating that no bitstream is output. When a second code stream is output, subtracting the lut _ width difference from 2 to determine the output counter value;
and finally, determining the first output code stream and the second output code stream which are sequentially output as a renormalized output code stream.
Further, as shown in step 1226 in fig. 5, when the code stream output index value is equal to the comparison threshold, adding the current counter value to the operation channel value as the output counter value;
in fig. 5, for example, when Loop is 3, the counter value is added to the arithmetic channel value 3 to be the counter value to be output.
Therefore, the whole CABAC renormalization processing flow is completed, the output renormalized output code stream can be used as a part of the whole code stream, and the output counter, the output coding interval and the output interval lower limit can be used for subsequent coding processing.
In practical applications, the channel determining module 71 and the channel calculating module 72 may be implemented by hardware logic inside a chip, or the like.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the scope of the present invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for Context Adaptive Binary Arithmetic Coding (CABAC) renormalization implementation, the method comprising:
acquiring coding information of an input code stream, and determining an operation channel value corresponding to a coding interval in the coding information according to a preset corresponding rule;
according to the operation channel value, performing renormalization calculation on the coding information by adopting a preset strategy corresponding to the operation channel value;
wherein, the preset corresponding rule comprises:
presetting more than one coding interval threshold from small to large, and presetting an operation channel value corresponding to each coding interval threshold;
determining that the minimum one of the threshold values of the coding intervals is larger than the threshold value of the coding interval, and determining the operation channel value corresponding to the threshold value of the coding interval as the operation channel value corresponding to the coding interval;
the renormalization calculation of the coding information by adopting a preset strategy corresponding to the operation channel value comprises the following steps of:
according to the operation channel value, carrying out left shift processing on the coding information and determining the lower limit of an output interval;
and determining a code stream output index value according to the interval lower limit in the coding information, determining a counter value according to the code stream output index value, and determining a renormalized output code stream.
2. The method of claim 1, wherein the performing the encoded information left shift process comprises:
shifting the binary number of the coding interval to the left by the digit of the operation channel value, and determining the binary number as an output coding interval;
and taking a binary number of the interval lower limit of 9 minus the difference digit of the operation channel value from the interval lower limit, leftwards shifting the binary number by the same digit as the value of the operation channel value, and determining the binary number as the output interval lower limit.
3. The method of claim 1, wherein determining a code stream output index value according to an interval lower limit in the encoded information, determining a counter value according to the code stream output index value, and determining a renormalized output code stream comprises:
shifting the binary number of the interval lower limit to the right by 9 minus difference digits of the operation channel value, and determining the shifted value as a code stream output index value;
when the code stream output index value is smaller than the comparison threshold value, judging whether the first bit zone bit of the input code stream is 0, if so, outputting one bit of 0, and then outputting 1 of the numerical digit of the counter value, otherwise, marking the first bit with the position of 0, and outputting 1 of the numerical digit of the counter value; determining the sequentially output values as a first output code stream;
when the code stream output index value is larger than the comparison threshold value, judging whether the first bit flag bit of the input code stream is 0, if so, outputting a bit 1, and outputting 0 of the numerical digit of the counter value, otherwise, marking the first bit at the position 0 and outputting 0 of the numerical digit of the counter value; determining the sequentially output values as a first output code stream;
the binary number of the numerical value of the operation channel value in the code stream output index value is taken from the low order and determined as the current code stream output index value, the lookup binary code stream and the lookup binary width value corresponding to the current code stream output index value are determined from the preset index lookup table corresponding to the operation channel value, the lookup binary code stream with the width of the determined lookup binary width value is output from the low order, the output binary code stream is determined as the second output code stream, and the operation channel value is subtracted by 1 and then the difference of the lookup binary width values is subtracted to determine as the output counter value;
determining the first output code stream and the second output code stream which are sequentially output as renormalized output code streams;
the method further comprises the following steps: when the code stream output index value is equal to the comparison threshold value, adding the counter value to the operation channel value to serve as an output counter value;
the difference between the arithmetic channel value power of 2 and 1 is the contrast threshold.
4. The method of claim 3, further comprising:
and when the operation channel value is 1, determining the first output code stream as a renormalized output code stream.
5. The method of claim 1,
the coding interval threshold includes: 4. 8, 16, 32, 64, 128, 256;
the operation channel values corresponding to the coding interval thresholds are respectively as follows: 7. 6, 5, 4, 3, 2 and 1.
6. An apparatus for CABAC renormalization implementation, the apparatus comprising: a channel determining module and a channel calculating module, wherein,
the channel determining module is used for acquiring coding information of an input code stream and determining an operation channel value corresponding to a coding interval in the coding information according to a preset corresponding rule;
the channel operation module is used for performing renormalization calculation on the coding information by adopting a preset strategy corresponding to the operation channel value according to the operation channel value;
the channel determination module is specifically configured to:
presetting more than one coding interval threshold from small to large, and presetting an operation channel value corresponding to each coding interval threshold;
determining that the minimum one of the threshold values of the coding intervals is larger than the threshold value of the coding interval, and determining the operation channel value corresponding to the threshold value of the coding interval as the operation channel value corresponding to the coding interval;
the channel operation module is specifically configured to perform the following processing in parallel:
according to the operation channel value, carrying out left shift processing on the coding information and determining the lower limit of an output interval;
and determining a code stream output index value according to the interval lower limit in the coding information, determining a counter value according to the code stream output index value, and determining a renormalized output code stream.
7. The apparatus of claim 6, wherein the channel operation module is specifically configured to:
shifting the binary number of the coding interval to the left by the digit of the operation channel value, and determining the binary number as an output coding interval;
and taking a binary number of the interval lower limit of 9 minus the difference digit of the operation channel value from the interval lower limit, leftwards shifting the binary number by the same digit as the value of the operation channel value, and determining the binary number as the output interval lower limit.
8. The apparatus of claim 6, wherein the channel operation module is specifically configured to:
shifting the binary number of the interval lower limit to the right by 9 minus difference digits of the operation channel value, and determining the shifted value as a code stream output index value;
when the code stream output index value is smaller than the comparison threshold value, judging whether the first bit zone bit of the input code stream is 0, if so, outputting one bit of 0, and then outputting 1 of the numerical digit of the counter value, otherwise, marking the first bit with the position of 0, and outputting 1 of the numerical digit of the counter value; determining the sequentially output values as a first output code stream;
when the code stream output index value is larger than the comparison threshold value, judging whether the first bit flag bit of the input code stream is 0, if so, outputting a bit 1, and outputting 0 of the numerical digit of the counter value, otherwise, marking the first bit at the position 0 and outputting 0 of the numerical digit of the counter value; determining the sequentially output values as a first output code stream;
the binary number of the numerical value of the operation channel value in the code stream output index value is taken from the low order and determined as the current code stream output index value, the lookup binary code stream and the lookup binary width value corresponding to the current code stream output index value are determined from the preset index lookup table corresponding to the operation channel value, the lookup binary code stream with the width of the determined lookup binary width value is output from the low order, the output binary code stream is determined as the second output code stream, and the operation channel value is subtracted by 1 and then the difference of the lookup binary width values is subtracted to determine as the output counter value;
determining the first output code stream and the second output code stream which are sequentially output as renormalized output code streams;
the channel operation module is further configured to:
when the code stream output index value is equal to the comparison threshold value, adding the counter value to the operation channel value to serve as an output counter value;
the difference between the arithmetic channel value power of 2 and 1 is the contrast threshold.
9. The apparatus of claim 8, wherein the channel operation module is specifically configured to:
and when the operation channel value is 1, determining the first output code stream as a renormalized output code stream.
10. The apparatus of claim 6,
the coding interval threshold includes: 4. 8, 16, 32, 64, 128, 256;
the operation channel values corresponding to the coding interval thresholds are respectively as follows: 7. 6, 5, 4, 3, 2 and 1.
CN201710067638.0A 2017-02-07 2017-02-07 Context adaptive binary arithmetic coding renormalization realization method and device Active CN108401158B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710067638.0A CN108401158B (en) 2017-02-07 2017-02-07 Context adaptive binary arithmetic coding renormalization realization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710067638.0A CN108401158B (en) 2017-02-07 2017-02-07 Context adaptive binary arithmetic coding renormalization realization method and device

Publications (2)

Publication Number Publication Date
CN108401158A CN108401158A (en) 2018-08-14
CN108401158B true CN108401158B (en) 2021-01-22

Family

ID=63093716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710067638.0A Active CN108401158B (en) 2017-02-07 2017-02-07 Context adaptive binary arithmetic coding renormalization realization method and device

Country Status (1)

Country Link
CN (1) CN108401158B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111818335B (en) * 2020-07-03 2022-04-26 Tcl华星光电技术有限公司 Entropy coding method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1630202A (en) * 2003-12-17 2005-06-22 索尼株式会社 Coding apparatus, program and data processing method
CN1703089A (en) * 2005-06-09 2005-11-30 清华大学 A two-value arithmetic coding method of digital signal
CN101771879A (en) * 2010-01-28 2010-07-07 清华大学 Parallel normalized coding realization circuit based on CABAC and coding method
CN102638680A (en) * 2011-02-14 2012-08-15 珠海全志科技股份有限公司 Hardware-based CABAC (Context-Based Adaptive Binary Arithmetic Coding) coding method and system
WO2016003130A1 (en) * 2014-06-29 2016-01-07 엘지전자(주) Method and apparatus for performing arithmetic coding by limited carry operation
CN105791828A (en) * 2015-12-31 2016-07-20 杭州士兰微电子股份有限公司 Binary arithmetic encoder and encoding method thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3934568B2 (en) * 2003-03-04 2007-06-20 松下電器産業株式会社 Video coding method and apparatus
US9681133B2 (en) * 2012-03-29 2017-06-13 Intel Corporation Two bins per clock CABAC decoding

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1630202A (en) * 2003-12-17 2005-06-22 索尼株式会社 Coding apparatus, program and data processing method
CN1703089A (en) * 2005-06-09 2005-11-30 清华大学 A two-value arithmetic coding method of digital signal
CN101771879A (en) * 2010-01-28 2010-07-07 清华大学 Parallel normalized coding realization circuit based on CABAC and coding method
CN102638680A (en) * 2011-02-14 2012-08-15 珠海全志科技股份有限公司 Hardware-based CABAC (Context-Based Adaptive Binary Arithmetic Coding) coding method and system
WO2016003130A1 (en) * 2014-06-29 2016-01-07 엘지전자(주) Method and apparatus for performing arithmetic coding by limited carry operation
CN105791828A (en) * 2015-12-31 2016-07-20 杭州士兰微电子股份有限公司 Binary arithmetic encoder and encoding method thereof

Also Published As

Publication number Publication date
CN108401158A (en) 2018-08-14

Similar Documents

Publication Publication Date Title
US7982641B1 (en) Context-based adaptive binary arithmetic coding engine
EP3108583B1 (en) Devices and methods of source-encoding and decoding of data
CN107578452B (en) JPEG image encryption method with compatible format and invariable size
CN102438145A (en) Image lossless compression method on basis of Huffman code
CN101017574A (en) Huffman decoding method suitable for JPEG code stream
CN110545417B (en) Image encoding and decoding method and related device of desktop scene
US7825835B2 (en) Method and system for encoded video compression
MX2019008186A (en) Method and apparatus for range derivation in context adaptive binary arithmetic coding.
CN108401158B (en) Context adaptive binary arithmetic coding renormalization realization method and device
CN109327283B (en) Network self-adaptive packet loss resisting method and device and terminal equipment
CN112995199B (en) Data encoding and decoding method, device, transmission system, terminal equipment and storage medium
EP1067694A2 (en) Data compression
US20140015698A1 (en) System and method for fixed rate entropy coded scalar quantization
US20180205952A1 (en) Method and apparatus for performing arithmetic coding by limited carry operation
CN101657973B (en) Recorded medium having program for coding and decoding using bit-precision, and apparatus thereof
US9525890B2 (en) Method and apparatus for decoding for AVS system using fetching flag
Zhou et al. Comments on" A Novel Compression and Encryption Scheme Using Variable Model Arithmetic Coding and Coupled Chaotic System
US8854233B2 (en) Method and system for de-binarization
CN106937168B (en) Video coding method, electronic equipment and system using long-term reference frame
CN112449186B (en) Encoding method, decoding method, corresponding devices, electronic equipment and storage medium
Li et al. High-speed rate estimation based on parallel processing for H. 264/AVC CABAC encoder
Neji et al. Evaluation and implementation of simultaneous binary arithmetic coding and encryption for HD H264/AVC codec
CN110545437A (en) coefficient encoding method, coefficient decoding method, electronic device, and medium
CN105634662B (en) Frame kind identification method and device
US20160323603A1 (en) Method and apparatus for performing an arithmetic coding for data symbols

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant