WO2020215193A1 - Coder, coding system, and coding method - Google Patents

Coder, coding system, and coding method Download PDF

Info

Publication number
WO2020215193A1
WO2020215193A1 PCT/CN2019/083781 CN2019083781W WO2020215193A1 WO 2020215193 A1 WO2020215193 A1 WO 2020215193A1 CN 2019083781 W CN2019083781 W CN 2019083781W WO 2020215193 A1 WO2020215193 A1 WO 2020215193A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
encoding
bit
coding
encoder
Prior art date
Application number
PCT/CN2019/083781
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
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2019/083781 priority Critical patent/WO2020215193A1/en
Priority to CN201980005065.6A priority patent/CN111316645A/en
Publication of WO2020215193A1 publication Critical patent/WO2020215193A1/en

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/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/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Definitions

  • This application relates to the field of image decoding, and more specifically, to an encoder, an encoding system, and an encoding method.
  • JPEG Joint Photographic Experts Group
  • JPEG 2000 Joint Photographic Experts Group 2000 are commonly used image coding standards.
  • JPEG 2000 uses wavelet transform and performs entropy coding based on optimized interception of embedded block coding (embedded block coding with optimized truncation, EBCOT), which has a higher compression ratio than JPEG, and supports progressive download and display.
  • EBCOT embedded block coding with optimized truncation
  • the traditional JPEG 2000 encoder is not compatible with compression rate and encoding rate.
  • This application provides an encoder, an encoding system, and an encoding method, which can effectively be compatible with the compression rate and the encoding rate.
  • an encoder including:
  • the Tier-1 coding unit performs tier-1 coding on the code block of the image block of the image to be coded to obtain the code stream of the code block;
  • the Tier-1 coding unit includes:
  • a bit-plane encoding unit includes a first channel and a second channel, the first channel and the second channel are used to perform bit-plane encoding on multiple bit-planes of the code block in parallel, Obtain the code stream of the code block;
  • the arithmetic coding unit is used to perform arithmetic coding on the code stream of the code block to obtain the target code stream.
  • an encoding system including:
  • an encoding method including:
  • Bit-plane encoding is performed in parallel on multiple bit-planes of the code block of the image block of the image to be coded through the first channel and the second channel to obtain the code stream of the code block;
  • the encoder, the encoding system, and the encoding method of the embodiments of the present application perform bit-plane encoding on the multiple bit-planes of the code block in parallel through the first channel and the second channel, so as to obtain the A code stream composed of the encoding result output by one channel and the encoding result output by the second channel, whereby the arithmetic encoding unit can use the encoding result output by the first channel and the encoding result output by the second channel
  • Arithmetic coding methods with different compression rates and coding speeds can also take into account the compression rate and coding speed of the code block at the same time.
  • Figure 1 is a coding framework diagram of JPEG 2000.
  • Fig. 2 is a schematic structural diagram of an encoding system provided by an embodiment of the present application.
  • Fig. 3 is a schematic structural diagram of the coding unit shown in Fig. 2.
  • Fig. 4 is a schematic structural diagram of the relationship between the bit plane and the coding channel of the present application.
  • Fig. 5 is a schematic diagram of the scanning sequence of SPP, MRP and CUP in the bit-plane coding process of the present application.
  • FIG. 6 is a schematic diagram of the neighborhood of the pixel of the bit plane of the present application.
  • Fig. 7 is an example of scanning windows of SPP, MRP and CUP of the present application.
  • Fig. 8 is another example of scanning windows of SPP, MRP and CUP of the present application.
  • Fig. 9 is a schematic structural diagram of a decoder provided by an embodiment of the present application.
  • This application can be applied to the field of image coding and decoding, video coding and decoding, hardware video coding and decoding, dedicated circuit video coding and decoding, and real-time video coding and decoding.
  • the encoder provided in this application can be used to perform lossy compression (lossy compression) on images, and can also be used to perform lossless compression (lossless compression) on images.
  • the lossless compression can be a visually lossless compression (visually lossless compression) or a mathematically lossless compression (mathematically lossless compression).
  • the coding framework of JPEG 2000 may include a preprocessing module 12, a transformation module 14, a quantization module 16, and an EBCOT module 18.
  • the preprocessing module 12 may include a component transformation (component transformation) module 122 and a direct current level shift module 124.
  • the component transformation module 122 may perform a certain transformation on the components of the image to reduce the correlation between the components. For example, the component transformation module 122 may convert each component of the image from the current color domain (for example, red, blue and green (RGB)) to another color domain.
  • the current color domain for example, red, blue and green (RGB)
  • the component transformation module 122 may support multiple color transformation modes. Therefore, the component transformation module 122 may sometimes be referred to as a multi-mode color transform (MCT) module.
  • MCT multi-mode color transform
  • the component transform module 122 may support irreversible color transform (ICT) or reversible color transform (RCT). It should be noted that the component transformation module 122 is optional. In the actual encoding process, it is also possible to directly perform subsequent processing without performing component transformation on the image.
  • the DC level shift module 124 can be used to perform a center shift (also referred to as a DC level shift) on the component values, so that the component values are symmetrically distributed with respect to 0, so as to facilitate subsequent transformation operations of the transformation module 14.
  • a center shift also referred to as a DC level shift
  • the transform module 14 uses wavelet transform to transform each tile in the image to obtain sub-band wavelet coefficients of different resolution levels. After n-level wavelet transform, there are n+1 resolutions. Level, each resolution level has 3 subbands (except for the lowest resolution, only 1 subband).
  • the embodiment of the present application does not specifically limit the size of the image block, for example, it may be 512 ⁇ 512 (unit is pixel).
  • the entire image can be regarded as an image block.
  • the quantization module 16 may be used to quantize the wavelet coefficients of the subbands to obtain the quantized wavelet coefficients of the subbands.
  • the EBCOT module 18 is the entropy coding module of JEPG 2000, and belongs to the core module of JEPG 2000.
  • the EBCOT module 18 may include a tier-1 encoding module 182, a tier-2 encoding module 184, and a rate control module 186.
  • the tier-1 encoding module 182 can be used to perform tier-1 encoding on a code block (the subband can be further divided into multiple independent code blocks).
  • Tier-1 coding can include bit-plane coding and arithmetic coding.
  • the tier-2 encoding module 184 is mainly responsible for the organization of the code stream. For example, the code stream of the code block can be truncated according to the target code rate provided by the code rate control module 186.
  • the encoder 7 may include a first interface circuit 71, a transform circuit 72, a quantization circuit 73, a first encoding circuit 74, a rate control circuit 75, a second encoding circuit 76 and a code stream writing circuit 77.
  • the encoder 7 may be a hardware encoder supporting the JPEG 2000 standard.
  • the first interface circuit 71 may be used to obtain an image to be coded, and after obtaining the image to be coded, divide the image to be coded into multiple image blocks. Of course, the first interface circuit 71 can also be used to directly obtain the divided image blocks.
  • the image to be encoded may be an image subjected to component transformation.
  • the format of the image to be encoded may be any image format with 4 or 3 components. Among them, the image format with 4 components includes but is not limited to Bayer pattern RAW format or YUVGb format or YDgCoCg format converted from Bayer pattern RAW format. Image formats with 3 components include but are not limited to RGB format and YUV format.
  • the first interface circuit 71 can be used to receive the image to be encoded collected by the sensor, can also be used to read the image to be encoded or the image block of the image to be encoded from the memory, and can also use image signal processing (ISP)
  • ISP image signal processing
  • the system acquires an image that has undergone component transformation.
  • the ISP includes but is not limited to a digital signal processor (DSP) and a graphics processing unit (GPU).
  • the image to be encoded can be stored in the memory in row order or column order.
  • the first interface circuit 71 can be based on the position of the image to be encoded in the memory. , Calculate the storage location of each image block, and then read the corresponding image block according to the jump addressing mode.
  • the image to be encoded can also be stored in the memory in units of image blocks, and the first interface circuit 71 can read the image blocks according to the storage order of the image blocks.
  • the first interface circuit 71 can use a specific addressing mode to read the image blocks of the image to be coded stored in the memory without segmenting the image to be coded.
  • the first interface circuit 71 may also directly read image blocks from the memory in a direct memory access (DMA) manner, so as to improve the access efficiency and speed.
  • DMA direct memory access
  • the first interface circuit 71 may include a calculation circuit.
  • the calculation circuit can be used to calculate the statistical information of the image to be encoded.
  • the calculation circuit can also be provided separately from the first interface circuit 71 or the encoder 7.
  • the calculation circuit may also be set in an image signal processing (image signal processing, ISP) system.
  • the statistical information of the image to be encoded may be information that can be used to control the rate of the tile in the image to be encoded. Therefore, in some embodiments, the statistical information of the image to be encoded may also be referred to as the image to be encoded. Block rate control information.
  • the statistical information of the image to be encoded may include one or more of the following information of the image blocks in the image to be encoded: complexity, activity, and texture.
  • the calculation circuit may define or calculate the complexity of the image block based on the amplitude of the high frequency components of the pixels in the image block.
  • the complexity of the image block may be the cumulative sum of the high frequency information of the location of each pixel in the image block area.
  • the coded code stream (or the number of bits consumed for coding) corresponding to the image block area with higher complexity will be correspondingly larger.
  • the calculation circuit may obtain high frequency components through filtering operations based on the pixel values of the pixels in the image block area, and then calculate the complexity of the image block.
  • the calculation circuit may also define or calculate the complexity of the image block based on the mean-square error (MSE) of the pixel value of the image block.
  • MSE mean-square error
  • the first interface circuit 71 can also be used to read the pre-generated statistical information of the image to be encoded from an external memory. This application does not impose specific restrictions on this.
  • the first interface circuit 71 may transmit the statistical information of the image to be encoded as rate control information to the rate control circuit 75 for the rate control circuit 75 to perform rate control on the encoding process.
  • the transform circuit 72 can be used to perform the operation performed by the transform module 14 above, that is, perform wavelet transform on the image block. After the image block undergoes wavelet transformation, many subbands can be obtained. After wavelet transformation, the wavelet coefficients of the image block can be obtained, and the wavelet coefficients of the image block can refer to the wavelet coefficients of these sub-bands.
  • the quantization circuit 73 may be used to quantize the wavelet coefficients to obtain quantized wavelet coefficients or quantized wavelet coefficients of subbands.
  • the first encoding circuit 74 may include one or more EBCOT encoding modules 742.
  • the EBCOT encoding module 742 may be used to perform tier-1 encoding on the code blocks of the image block (the subband can be further divided into multiple independent code blocks) to obtain the code The code stream of the block.
  • the code streams of all code blocks of the image block constitute the code stream of the image block.
  • the transform circuit 72 receives the image block, and the transform circuit 72 transforms and the quantization circuit 73 quantizes the subbands with wavelet coefficients.
  • a subband can be divided into independently coded one or Multiple code blocks, that is, code blocks of image blocks, may refer to code blocks of subbands of the image block.
  • the EBCOT encoding module 742 may be used to perform operations performed by the tier-1 encoding module 182 in FIG. 1, such as bit-plane encoding and arithmetic encoding on the code block.
  • the code block may also be preprocessed, for example, the sign bit and the absolute value of the wavelet coefficient are separated.
  • the first encoding circuit 74 encodes the code block into a code stream, it can also perform post-processing on the code block. For example, the code stream can be spliced together for use by the second encoding circuit 76.
  • the code rate control circuit 75 may be used to determine the target code rate (target size) of the image block in the image to be encoded according to the statistical information of the image to be encoded.
  • the rate control circuit 75 may assign weights to each image block according to the complexity of each image block. The higher the complexity of the image block, the greater the weight.
  • the code rate control circuit 75 may calculate the target code rate of each image block according to the weight of each image block and current network conditions (such as network bandwidth), so that the larger the weight of the image block, the higher the target code rate.
  • the statistical information of the image to be encoded output by the calculation circuit may include the weight of each image block, and the code rate control circuit 75 may directly use the weight of the image block to calculate the target code rate.
  • the second encoding circuit 76 can be used to implement the function of the tier-2 encoding module 184 mentioned above.
  • the second encoding circuit 76 may be used to perform tier-2 encoding on the bit stream of the image block according to the target bit rate, so as to cut the bit stream of the image block.
  • the second encoding circuit 76 receives the code stream of each code block sent by the first encoding circuit 74, it can combine the code streams of each code block according to the output code rate requirements (for example, the output target code rate). , Carry out optimization truncation sorting, packing and other processing on the code stream of all code blocks to obtain the JPEG2000 code stream.
  • the second encoding circuit 76 may include a rate-distortion calculation circuit 762 (or slopemaker) and a truncation circuit 764 (or truncator).
  • the rate-distortion calculation circuit 762 can be used to calculate the rate-distortion slope of the code stream output by the first encoding circuit 74.
  • the rate-distortion calculation circuit 762 may calculate the rate-distortion slope (distortion) based on the rate and distortion of each code stream (that is, the code stream (pass) of each code block) output by the first encoding circuit 74. slope).
  • the rate-distortion slope can be used to evaluate the contribution of each segment of the current code block to the entire image block.
  • the rate-distortion slope can be used for subsequent code stream organization, such as code stream layering and truncation.
  • the current code block will be divided into several bit planes, and each bit plane will generate 3 bit streams after encoding (3-pass encoding, except for the highest bit plane, only 1 bit stream will be generated. Outside), where each segment of the code stream corresponds to a slope value.
  • the rate-distortion slope corresponding to the current code block may include the slope value corresponding to each segment of the code stream generated after the current code block is bit-plane encoded.
  • the truncation circuit 764 can be used to process the bit stream of the image block according to the target bit rate and the rate-distortion slope. For example, the truncation circuit 764 can be used to cut the bit stream of the image block according to the target bit rate and the rate-distortion slope. Further, the truncation circuit 764 can also be used to reorganize the code stream, layer the code stream, and so on. In addition, in some embodiments, the truncation circuit 764 may also be used to generate header information of the code stream, and transmit the header information together with the code stream to the subsequent code stream write circuit 77.
  • the code stream write circuit 77 can be used to receive the organized code stream output by the truncation circuit 764 and write the code stream to an external memory. For example, it can be written to an external memory via the bus.
  • the bus may be, for example, an advanced extensive interface (AXI) bus.
  • the code stream writing circuit 77 may also add information such as a tile header to the code stream.
  • the rate control circuit 75 may also be used to generate the state information of the rate control buffer (or buffer size) according to the statistical information of the image block.
  • the first encoding circuit 74 can also be used to control the tier-1 encoding according to the state information of the code rate control buffer.
  • the status information of the buffer can be used by the first encoding circuit 74 to pre-truncate the code stream. For example, the first encoding circuit 74 may delete code streams that exceed a predetermined size according to the status information of the buffer, or delete code streams that do not meet the requirements. Therefore, the status information of the buffer can also be called pre-truncation information.
  • the rate control circuit 75 may also receive feedback of the size of the code stream actually encoded by the first encoding circuit 74, and update the pre-truncation information of the image block corresponding to the wavelet subband.
  • the encoder 7 may also include an interface circuit (not shown in the figure) for software configuration, through which the information in the register inside the encoder 7 can be configured or changed, thereby controlling the encoder 7 Encoding method.
  • the embodiment of the present application calculates the statistical information of the image blocks in the image to be encoded, and cuts the code stream of the image blocks according to the statistical information, thereby performing relatively independent bit rate control on each image block without taking the code block of each image block as
  • the unit is optimized to avoid generating a large amount of intermediate data. Therefore, the embodiment of the present application can reduce the requirement of the encoder on the system bandwidth. The entire encoding process of the image to be encoded can even be carried out completely on the chip.
  • a buffer (on-chip buffer) may be set inside the conversion circuit 72 or at the output terminal, for buffering the intermediate results output by the conversion circuit 72.
  • a buffer (on-chip buffer) may be set inside or at the output end of the truncation circuit 764 for buffering the intermediate results output by the truncation circuit 764.
  • rate matching can be performed on adjacent two-stage circuits in the encoder 7 to improve the encoding efficiency of the encoder 7.
  • circuits with slower processing speeds in adjacent two-stage circuits can be set to a multi-channel parallel structure; then, a certain mechanism can be used to control the data transmission between the two, so that the two-stage circuits are fully streamlined.
  • the rates of the quantization circuit 73 and the first encoding circuit 74 may be matched.
  • the multiple EBCOT encoding modules 742 can be used to perform tier-1 encoding on each code block output by the quantization circuit 73 in parallel, that is,
  • the first encoding circuit 74 may adopt a multi-path parallel structure to perform tier-1 encoding.
  • the code blocks output by the quantization circuit 73 to the first encoding circuit 74 may be code streams corresponding to multiple frequency components (for example, code blocks corresponding to LL, HL, LH, and HH), the quantization circuit 73 and multiple EBCOT encoding modules Group arbitration or free arbitration can be adopted between 742 to determine the EBCOT encoding module 742 corresponding to the intermediate result output by the quantization circuit 73.
  • group arbitration refers to always assigning the code block corresponding to a certain frequency component output by the quantization circuit 73 to a fixed group of coding units (each group of coding units can be composed of several coding units), while free arbitration refers to quantization
  • Each code block output by the circuit 73 may be received by one of the multiple parallel encoding units.
  • the advantage of the packet arbitration method is that the circuit connection is relatively simple in hardware implementation, while the free arbitration method can improve the utilization efficiency of the coding unit in some cases.
  • the rates of the first encoding circuit 74 and the rate-distortion slope calculation circuit 762 may be matched.
  • the rate-distortion calculation circuit 762 may include a plurality of rate-distortion slope calculation units.
  • the multiple rate-distortion slope calculation units can be used to calculate the rate-distortion slope of the code stream output by the first encoding circuit 74 in parallel.
  • the first encoding circuit 74 and the rate-distortion calculation circuit 762 may also adopt a group arbitration or free arbitration method to determine the rate-distortion slope calculation unit corresponding to the intermediate result output by the first encoding circuit 74.
  • one rate-distortion slope calculation unit can correspond to a group of coding units in the first coding circuit 74.
  • a rate-distortion slope calculation unit corresponding to a group of encoding units can make the design of the entire circuit easier.
  • FIG. 3 is a schematic structural diagram of the EBCOT encoding module 742 shown in FIG. 2.
  • the EBCOT encoding module 742 may include a preprocessing unit 64, a tier-1 encoding unit 6, and a post-processing unit 65.
  • the preprocessing unit 64 may be used to preprocess the code block, for example, to separate the sign bit and the absolute value of the wavelet coefficient.
  • the post-processing unit 65 can be used to perform post-processing on the code stream of the code block.
  • the code streams can be spliced together for use by the second encoding circuit 76.
  • the preprocessing module 64 may include a first memory 641 and a second memory 642, and the tier-1 encoding unit 6 can read the code blocks preprocessed by the preprocessing unit 64 through the first memory 641 and the second memory 642.
  • the post-processing module 65 may include an access instruction generation unit 651, a third memory 652, and a fourth memory 653.
  • the post-processing module 65 may be used to receive the code stream output by the tier-1 encoding unit 6, and generate a memory based on the received code stream.
  • the instruction is fetched, and then the code stream output by the tier-1 encoding unit 6 is stored based on the access instruction.
  • the access instruction generating unit 651 is specifically configured to receive the code streams output by the first arithmetic encoder 621 and the code stream organizing unit 63, and store these code streams in the third memory 652 and/or the fourth memory 653. Corresponding address.
  • the tier-1 coding unit 6 may include a bit-plane coding unit 61, an arithmetic coding unit 62, and a code stream organizing unit 63, which are used for specific compression of data.
  • the bit-plane coding unit 61 may perform multi-channel bit-plane coding on each code block to generate context information and a decision result.
  • the decision result is used to generate a code stream
  • the context information is used for the arithmetic coding unit 62 to establish a probability model.
  • arithmetic coding is performed on the code stream output by the bit-plane coding unit 61.
  • the preprocessing module 64 decomposes the wavelet coefficients of the code block into bit planes (also called bit planes), reorganizes the decomposed bit planes and sends them to the bit plane encoding unit 61, and the bit plane encoding unit 61 receives the preprocessing module 64 transmitted organized bit planes are bit plane encoded. Stored on the bit plane is the bit value of the binary corresponding bit of the coefficient.
  • the bit-plane encoding unit 61 scans and encodes the bits on each bit-plane, and then sends the generated context information and code stream to the arithmetic encoding unit 62 or the code stream organizing unit 63, so that the arithmetic encoding unit 62 performs arithmetic encoding and coding.
  • the stream organization unit 63 performs code stream organization.
  • the bit-plane encoding unit 61 scans and encodes the bits on part of the bit-plane (the upper-level plane and the 3 planes below the upper-level plane), and then sends the generated context information and code stream to the distribution unit 613.
  • the first arithmetic encoder 621 performs arithmetic encoding by the first arithmetic encoder 621, and the first arithmetic encoder 621 sends the encoded bit stream to the post-processing module 65.
  • the distribution unit 613 sends the generated context information and code stream to the second arithmetic encoder 622, and the second arithmetic encoder 622 performs arithmetic coding, and the second arithmetic encoder 622 sends the encoded bitstream to the bitstream organizing unit 63, which is reorganized by the bitstream organizing unit 63 and then sent to the post-processing module 65.
  • the post-processing module 65 stores the code streams output by the first arithmetic encoder 621 and the code stream organizing unit 63 to the corresponding addresses of the third memory 652 and/or the fourth memory 653.
  • the bit-plane coding unit 61 can perform multi-channel bit-plane coding for each code block, and the multi-channel bit-plane coding can include significance propagation pass (significance propagation pass, SPP or SP) coding, amplitude refinement pass (magnitude refinement pass, MRP) Or MR) encoding and clean up pass (CUP or SP) encoding.
  • significance propagation pass signal propagation pass
  • MRP magnitude refinement pass
  • MRP itude refinement pass
  • MR clean up pass
  • the saliency propagation channel is the first encoding channel of each bit plane (except for the highest bit plane, in the highest bit plane, there is only one encoding channel, that is, the clear encoding channel), which is used to encode currently not significant coefficients, but
  • the 8 neighborhoods have been marked as significant coefficients.
  • the data X to be encoded will be encoded in this channel.
  • Each coefficient in the bit plane can correspond to a binary state variable s[j] used to represent a "significant state", where j represents the coefficient scan coordinate.
  • the saliency state is initialized to 0, and the s state value will be updated in each bit plane.
  • the amplitude refinement channel is the second encoding channel of each bit plane (except for the highest bit plane, in the highest bit plane, there is only one encoding channel, that is, the clear encoding channel), which is used for encoding when the previous bit plane has been marked Is a significant coefficient.
  • the clear channel is the third encoding channel of each bit plane (except for the highest bit plane, in the highest bit plane, there is only one encoding channel, that is, the clear encoding channel), which is used to encode the remaining coefficients.
  • run-length coding and zero coding can be added. Specifically, the four bits in a row can be judged simultaneously in this channel. For example, when four bits have no adjacent data that has been marked as significant, run-length coding is used for them, otherwise zero coding is used for each bit.
  • the bit-plane encoding unit 61 may use different encoding methods to perform bit-plane encoding on the bit-plane in different encoding channels.
  • the coding methods used in the coding channel include but are not limited to: Significance Coding (ZC), Symbol Coding (SC), Magnitude Refinement Coding (MRC) and run length coding ( Run Length Encoding, RLC).
  • ZC encoding and SC encoding can be performed on the bits on the bit plane; in the amplitude refinement channel, the bits on the bit plane can be MRC encoded; in the clear channel, the bit plane The above bits can be ZC coded, SC coded and RLC coded. After the bits on the bit plane are coded by the above-mentioned multi-channel bit plane, the arithmetic coding unit 62 performs arithmetic coding on its output.
  • bit-plane encoding unit 61 After the bit-plane encoding unit 61 performs bit-plane encoding on the bit-plane, it can obtain three sets of binary sequences for each bit-plane, that is, each channel corresponds to a set of binary sequences.
  • the bit-plane encoding unit 61 may include a first channel 611 and a second channel 612.
  • the arithmetic encoding unit 62 may include a first arithmetic encoder 621 and a second arithmetic encoder 622.
  • the first arithmetic encoder 621 and the second arithmetic encoder 622 may be the same type of arithmetic encoder or different types of arithmetic encoders.
  • the first channel 611 and the second channel 612 may correspond to the first arithmetic encoder 621 and the second arithmetic encoder 622, respectively.
  • the arithmetic coding unit 62 may also include only one arithmetic encoder or other number of arithmetic encoders, which is not specifically limited in this application.
  • the first arithmetic encoder 621 and the second arithmetic encoder 622 may be multiple quantization (MQ) arithmetic encoders.
  • MQ arithmetic encoders include, but are not limited to, context-based adaptive arithmetic coding and traditional arithmetic encoders.
  • Arithmetic coding is to map a source symbol sequence into a code sequence (also called a codeword).
  • the traditional arithmetic encoder maps a source information sequence to a sub-interval in the [0, 1) interval. This mapping is a one-to-one correspondence to ensure unique decoding, and then take a point in this sub-interval The value represented is used as a codeword.
  • the interval [0, 1] can be divided into 4 sub Interval: [0, 0.1) for symbol A, [0.1, 0.5) for symbol B, [0.5, 0.7) for symbol C, and [0.7, 1] for symbol D.
  • the input of the binary message sequence is: CADACDB.
  • the first input symbol is C, and the encoding range it belongs to is [0.5, 0.7]. Since the coding range of the second symbol A in the message is [0, 0.1], its interval takes the first tenth of [0.5, 0.7] as the new interval [0.5, 0.52].
  • the new interval is [0.514, 0.52] when encoding the third symbol D
  • the new interval is [0.514, 0.5146] when encoding the fourth symbol A, and so on.
  • the encoded output of the message can be any number in the last interval.
  • the arithmetic coding process of the traditional arithmetic encoder is based on the known probability of each symbol. Only when the probability of each symbol is known can the probability interval be divided according to it.
  • Adaptive arithmetic coding can complete two processes in one scan, namely the probability model establishment process and the scan coding process. Adaptive arithmetic coding does not know the statistical probability of each symbol before scanning the symbol sequence. At this time, it is assumed that the probability of each symbol is equal, and the interval [0, 1] is evenly allocated. Then continuously adjust the probability of each symbol in the process of scanning the symbol sequence.
  • Adaptive arithmetic coding first needs to know the probability of each symbol sent by the source, and then scan the symbol sequence, divide the corresponding interval in turn, and finally obtain the codeword corresponding to the symbol sequence.
  • the input of the arithmetic encoder may include the to-be-encoded bit D and the context vector (CX) generated by the bit-plane encoding unit 61.
  • CX is a probability statistical model summarized by the bit-plane coding unit 61 based on neighborhood correlation, and there are 19 types in total. That is, for different CX, the symbol probability is not the same.
  • both the first arithmetic encoder 621 and the second arithmetic encoder 621 can be adaptive arithmetic encoders, that is, both the first arithmetic encoder 621 and the second arithmetic encoder 621 can use CX to determine the symbol probability.
  • the first channel 611 and the second channel 612 may each include SPP, MRP, and CUP, and SPP, MRP, and CUP all correspond to at least one encoder.
  • the probability of the first 4-layer bit plane and the subsequent bit plane is interrupted. Therefore, consider extracting the saliency state of the 4-level bit-plane in advance, so that the subsequent bit-plane can start scanning and encoding.
  • the first 4 bit planes are set to be encoded on the first channel 611
  • the subsequent bit planes are set to be encoded on the second channel 612. That is, the bit plane encoding unit 61 includes the first channel 611 and the second channel 612, and the first channel 611 and the second channel 612 divide the multiple bit planes of the code block into two groups of bit planes. And perform bit-plane coding on the two sets of bit-planes in parallel to obtain the code stream of the code block.
  • the present application can set the computing power of the second channel 312 to the three scan channels of SPP, MRP, and CUP in parallel.
  • the three scan channels scan for the same bit plane in parallel, and the first channel 611 It can only be SPP and MRP two scanning channels in parallel or CUP single scanning channel.
  • the ratio of the processing rate of the first channel 611 to the processing rate of the second channel 612 is 1:2 (except that the highest bit plane only performs CUP scanning), thus, the two channels can be balanced.
  • Processing rate and reducing the parallelism of the first channel 611 also help to reduce the hardware resources and peak power consumption of the implementation.
  • the first time is configured to scan the highest bit plane using CUP
  • the second time is configured to scan the second bit plane using SPP+MRP
  • the third time is configured to scan the second bit plane with CUP
  • the fourth time is configured to Use SPP+MRP to scan the third bit plane
  • the fifth time is configured to use CUP to scan the third bit plane, and so on.
  • the "one moment" mentioned above can refer to the time for a scan channel to complete the scanning process of a bit plane. Taking the bit plane scan rate of 4bit/cycle as an example, taking the bit plane size of 32x32bit as an example, one moment is 256 cycle (actually It is also necessary to consider data scheduling and several cycles of pipeline).
  • the second channel 612 is configured to process subsequent bit planes, where the first time is configured to scan the fifth bit plane using SPP+MRP+CUP (wherein due to the update and transfer of the significant information s, SPP and MRP +CUP needs to be staggered by several clock cycles, such as 2 clock cycles), the second time is configured to scan the 6th bit plane with SPP+MRP+CUP, and the third time is configured to scan with SPP+MRP+CUP The seventh bit plane, and so on until the lowest bit plane that needs to be scanned and coded.
  • SPP+MRP+CUP wherein due to the update and transfer of the significant information s, SPP and MRP +CUP needs to be staggered by several clock cycles, such as 2 clock cycles
  • the second time is configured to scan the 6th bit plane with SPP+MRP+CUP
  • the third time is configured to scan with SPP+MRP+CUP The seventh bit plane, and so on until the lowest bit plane that needs to be scanned and coded.
  • the first channel 611 may be configured as SPP, MRP, or CUP. That is, the first channel 611 may also be called an x-pass (pass), where x represents SPP, MRP, or CUP.
  • the first channel 611 may include or be configured with 1 RLC encoder, 4 MRC encoders, 4 ZC encoders, and 4 SC encoders.
  • the first channel 611 may include SPP, MRP, and CUP.
  • SPP and CUP are configured with 4 ZC encoders and 4 SC encoders in common
  • MRP is configured with 4 MRC encoders
  • CUP is also configured with an RLC encoder.
  • SPP and CUP share 4 ZC encoders and 4 SC encoders, which can simplify the hardware structure of the EBCOT encoding module 742, and further, can ensure the utilization of each encoder in the EBCOT encoding module 742.
  • the second channel 612 can also be called lazy pass, which can include SPP, MRP, and CUP, where SPP can include or be configured with 4 ZC encoders and 4 SC encoders, and MRP can include or be configured with 4 MRC encoders.
  • SPP can include or be configured with 4 ZC encoders and 4 SC encoders
  • MRP can include or be configured with 4 MRC encoders.
  • CUP can include or be configured with 1 RLC encoder, 4 ZC encoders, and 4 SC encoders.
  • the EBCOT encoding module 742 encodes the bit plane of the code block through the first channel 611 and the second channel 612
  • the first channel 611 can simultaneously perform SPP, MRP scan encoding, or bit alignment on a bit plane
  • the plane performs CUP scan coding
  • the second channel 612 can simultaneously perform SPP, MRP, and CUP scan coding on a bit plane.
  • the code block bit plane is processed in parallel through the first channel 611 and the second channel 612, which can effectively improve the coding efficiency.
  • the first channel 611 and the second channel 612 may also include or be configured with other numbers of ZC encoders, SC encoders, and MRC encoders, which are not specifically limited in this application. .
  • the bit plane carry plane of the code block can be coded in parallel through the first channel 611 and the second channel 612, which can effectively improve the coding efficiency.
  • separately configuring the encoder in the first channel 611 and the encoder in the second channel 612 can simplify the hardware structure of the EBCOT encoding module 742, and further, can ensure the performance of each encoder in the EBCOT encoding module 742. Utilization rate.
  • bit-plane encoding unit 61 may further include a distributing unit 613.
  • the distributing unit 613 may be used to distribute the output result of the encoding channel to the corresponding arithmetic encoder and other unit modules.
  • the distribution unit 613 may be used to distribute the context information and code stream of the first channel 611 to the first arithmetic encoder 621, and distribute the context information and code stream of the second channel 612 to the second arithmetic encoder 622, and /Or directly distribute the output context information and code stream of the second channel 612 to the code stream organizing unit 63.
  • the code stream organizing unit 63 may be used to organize the code stream output by the arithmetic coding unit 62, and output the organized code stream to the storage instruction generating unit 651, so that the storage instruction generating unit 651 generates a storage instruction based on the storage instruction
  • the code stream output by the code stream organizing unit 63 is stored in the third memory 652 and the fourth memory 653.
  • the highest bit plane and the k planes below the highest bit plane can be bit-plane encoded through the first channel 611, and the remaining bit planes can be bit-plane encoded through the second channel 622.
  • k can be any positive integer less than n, and n is the total number of bit planes corresponding to the code block.
  • the highest bit plane may be the first non-zero bit plane composed of all coefficients in the code block.
  • the probability of the first 4 bit planes used for arithmetic coding will be transferred to the following bit planes, and the probability of the latter bit planes used for arithmetic coding will not be transferred.
  • This application can Use this feature to deploy a set of hardware for the first 4 bit planes and subsequent bit planes to process the bit planes of the code block in parallel to increase the coding rate. That is, the above k is equal to 3. Of course, this application is not limited to this. In other embodiments, the k may also be other positive integers.
  • Fig. 4 is a schematic structural diagram of the relationship between the bit plane and the coding channel of the present application.
  • the n-4th bit plane to the n-1th bit plane are subjected to bit plane coding through the first channel 611, and the n-5th bit plane to the 0th bit plane are performed through the second channel 612.
  • Bit plane coding Since the first channel 611 and the second channel 612 respectively correspond to different encoders in the arithmetic coding unit 62, different arithmetic coding can be performed on different bit planes.
  • the probability of the first arithmetic encoder 621 corresponding to the first channel 611 is transmitted bit plane by channel (pass), and its coding efficiency is good;
  • the probability of the second arithmetic encoder 622 corresponding to the second channel 612 is
  • Each bit plane and each pass are independent of each other, that is, by deploying multiple parallel bit plane encoders + arithmetic encoders to greatly improve the encoding speed, the encoding efficiency is poor (because the probability is not transmitted, the second arithmetic encoder
  • the compression rate of the code stream of 622 is lower than that of the first arithmetic encoder 621).
  • the probability of important (for example, the first 4) bit-planes for arithmetic coding is transmitted bit-plane and channel-by-channel, and the unimportant bit-planes (for example, the latter bit-plane) are not transmitted for arithmetic coding.
  • the probability of arithmetic coding can take into account both coding speed and coding efficiency.
  • the first channel 611 can be used to encode a preset number of bit-planes
  • the second channel 612 can be used to encode planes other than the preset number of bit-planes.
  • the probability of arithmetic coding is sent and passed, and the probability of arithmetic coding between other bit planes is not passed.
  • the arithmetic encoding unit 62 may include a first arithmetic encoder 621 and a second arithmetic encoder 622.
  • the first arithmetic encoder 621 may be configured to transmit the probability of arithmetic coding bit-plane-by-channel (for example, in the order of SPP, MRP, and CUP).
  • the coding efficiency is high, but the coding speed is too high. slow.
  • the second encoder 622 can be configured such that the probability for arithmetic coding is independent of each bit plane and each channel (for example, SPP, MRP, and CUP), so that multiple parallel channels can be deployed.
  • bit-plane encoder+arithmetic encoder improves its encoding speed, but its encoding efficiency is poor (because the probability is not transmitted, the compression rate of the code stream is not as large as that of the first arithmetic encoder 612).
  • the first arithmetic encoder 621 is configured to transfer probabilities for arithmetic coding between the multiple bit planes encoded by the first channel 611, and transfer the probabilities between channels in the first channel 611.
  • the probability used for arithmetic coding; the second arithmetic encoder 622 is configured such that the probabilities used for arithmetic coding among the multiple bit planes encoded by the second channel 612 are independent of each other, and the The probabilities used for arithmetic coding between channels are independent of each other.
  • the first arithmetic encoder 621 is configured to use the first 4 bit-planes of the first channel 611 to perform bit-plane coding for probability transfer of arithmetic coding;
  • the second arithmetic encoder 622 is configured to be used by the The second channel 612 performs bit-plane coding with a probability that the subsequent bit-plane is used for arithmetic coding is not transmitted.
  • a parallel encoder structure that is, the arithmetic encoder 62 is formed, so as to take into account both encoding speed and encoding efficiency.
  • the tier-1 encoding unit 6 may also be provided with one or more buffers (on-chip buffers) for storing the encoding results output by each unit module.
  • the first channel 611 and the second channel 612 are respectively provided with buffers (on-chip buffers) for storing code streams encoded by the first channel 611 and the second channel 612.
  • the distribution unit 613 may also be provided with an xP first input first output (FIFO) memory corresponding to the first channel 611 inside or at the output end, and the xPFIFO memory may be the SPP code in the first channel 611
  • the buffer corresponding to the SPP encoder may also be the buffer corresponding to the CUP encoder in the first channel 611 for buffering the encoding results of the SPP encoder and the CUP encoder, that is, the context and decision information output by the SPP encoder and the CUP encoder.
  • the SPP encoder and the CUP encoder can share a buffer, which not only can effectively simplify the structure of the tier-1 encoding unit 6, but also improve The utilization of the cache is improved.
  • the distribution unit 613 may also be provided with an MR random access memory (RAM) corresponding to the MRP encoder in the first channel 611 inside or at the output terminal, for buffering the encoding result of the MRP encoder.
  • RAM MR random access memory
  • a corresponding MR RAM for the MRP encoder can effectively control the volume of the distribution unit 613 and avoid the distribution unit 613 from being too large.
  • the embodiment of the present application is not limited to this.
  • a corresponding FIFO may also be set for the MRP encoder, so as to read and write the encoding result of the MRP encoder at the same time.
  • the type of cache can be determined according to actual needs.
  • FIFO mentioned above or below can be replaced with RAM, or the RAM mentioned above or below can also be replaced with FIFO, which is not specifically limited in this application.
  • an MP RAM corresponding to the MRP encoder in the second channel 612 may also be provided in the distribution unit 613 or at the output end, for buffering the encoding result of the MRP encoder. Further, the MP RAM can also be used to buffer the encoding result of the SPP encoder in the second channel 612.
  • the distribution unit 613 may also be provided with a CP FIFO corresponding to the CUP encoder in the second channel 612 inside or at the output end, for buffering the encoding result of the CUP encoder.
  • the distribution unit 613 may also include an original encoder 6131, which is connected to the SPP encoder in the second channel 612, and is used to receive the code stream output by the SPP encoder in the second channel 612, and perform the The code stream output by the SPP encoder in 612 is raw coded and output to the code stream organization unit 63.
  • the original encoder 6131 supplements and/or packs the code stream output by the SPP encoder in the second channel 612, and then sends it to the code stream organizing unit 63, so that the code stream organizing unit 63 calculates the number of codes corresponding to one code block. Each code stream is organized into code streams.
  • Bit-plane coding refers to SPP/MRP/CUP coding.
  • the result of bit-plane scanning and coding is context and decision information.
  • the bit-plane encoding unit 61 sends the encoding result to the arithmetic encoding unit 62 or the raw encoder 6131, and the arithmetic encoding unit 62 or the raw encoder 6131 performs encoding.
  • the bit plane encoding unit 61 can divide it into a stripe every 4 rows, and scan the stripe in the order from top to bottom, from left to right. The order of scanning the bits in each strip, starting from the highest bit plane, and then coding to the lowest bit plane.
  • SPP scanning and coding are performed first, then MRP scanning and coding are performed, and finally CUP scanning and coding are performed.
  • MRP scanning and coding are performed first, then MRP scanning and coding are performed, and finally CUP scanning and coding are performed.
  • three channels SPP, MRP and CUP can be deployed in parallel scanning and coding.
  • SPP, MRP, and CUP When SPP, MRP, and CUP are scanned and coded in parallel, they can be coded based on the coding state of the bit-plane's saliency information, and the state of the neighboring coefficients of the coefficient to be scanned.
  • the coding result obtained after scanning and coding the coefficient to be scanned That is, the context and decision information output by the SPP encoder, MRP encoder and CUP encoder.
  • the coefficient to be scanned can be used to determine the status of the neighborhood coefficient of the coefficient through the 8 neighborhoods around it. Among them, these 8 neighborhoods can be divided into 3 categories: horizontal (h), vertical (v) and diagonal (d). For example, as shown in FIG. 6, assuming that the coefficient P is the coefficient to be scanned, the eight neighborhoods of the coefficient P are D0, V0, D1, H0, H1, D2, V1, and D3.
  • Fig. 7 is an example of scanning windows of SPP, MRP and CUP of the present application.
  • the scanning and coding sequence is p0, p1, p2, p3, p4, p5, p6, p7,....
  • the coding of p1 needs to know the importance information of p0 (p0 is the top neighbor of p1), and the coding of p2 needs to know the importance information of p1.
  • bit-plane coding at a rate of 4bit/cycle can be realized with the longest logic
  • the path is p0-p3.
  • SPP, MRP, and CUP all use one column of a stripe as a scanning window, and the scanning and encoding of 4 coefficients (also called bits) can be realized in one scanning window.
  • the neighbors of p4 can already be determined, so p4 can start scanning and coding at the same time as p2; similarly, at the end of p2 scanning, the neighbors of p5 can be determined, and p5 can start scanning and coding at the same time as p3. .
  • bit-plane coding rate (6bit/cycle) can be further increased without changing the logical longest path.
  • Fig. 8 is another example of scanning windows of SPP, MRP and CUP of the present application.
  • the structure of the encoder 7 provided in the embodiment of the present application has been exemplified above in conjunction with FIGS. 3 to 8.
  • the structure of the decoder 8 provided by the embodiment of the present application will be illustrated below with reference to FIG. 9.
  • the decoder 8 may include one or more of the following circuits: code stream reading circuit 81, code stream analysis circuit 82, decoding circuit 83, inverse quantization circuit 84, inverse transform circuit 85, output circuit 86.
  • the code stream reading circuit 81 can be used to read the code stream to be decoded.
  • the code stream reading circuit 81 can, for example, use an advanced extensible interface (AXI) to read the code stream to be decoded from an external memory (such as a memory).
  • AXI advanced extensible interface
  • the code stream parsing circuit 82 may also be referred to as a code stream header parser circuit (header parser).
  • the code stream analysis circuit 82 can parse various types of header information in the code stream, and separate parameters and code stream data related to decoding therefrom for use by the decoding circuit 83 at a later stage.
  • the decoding circuit 83 may include one decoding unit or parallel multiple decoding units (the specific number can be configured according to actual needs, for example, 8 parallel decoding units can be configured). Each decoding unit in the decoding circuit 83 can independently decode a code block.
  • a preprocessing circuit before the decoding circuit 83, a preprocessing circuit may also be provided.
  • the preprocessing circuit can be used to distribute the decoding parameters, code stream data, etc. output by the code stream analysis circuit 82 to parallel multiple decoding units.
  • a post-processing circuit may also be provided.
  • the post-processing circuit can be used to reorganize the decoded data output by the decoding circuit 83 and output the organized data to the subsequent circuit.
  • the inverse quantization circuit 84 can be used to inverse quantize the data decoded by the decoding circuit 83.
  • the inverse transform circuit 85 can be used to inversely transform the data output by the inverse quantization circuit 84.
  • the inverse transform can be discrete wavelet inverse transform.
  • the output circuit 86 can be used to write the data output by the inverse conversion circuit 85 into an external memory.
  • the data output from the inverse conversion circuit 85 can be written into an external memory through AXI.
  • the decoder 8 may also include a software configuration interface.
  • the software configuration interface can configure or change the information in the internal registers of the decoder 8 to control the decoding mode of the decoder 8.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.

Abstract

Provided are a coder, a coding system, and a coding method. The coder comprises a Tier-1 coding unit for performing Tier-1 coding on a code block of an image block of an image to be coded to obtain a code stream of the code block. The Tier-1 coding unit comprises: a bit plane coding unit, the bit plane coding unit comprising a first channel and a second channel, and the first channel and the second channel being used for performing bit plane coding on multiple bit planes of the code block in parallel to obtain the code stream of the code block; and an arithmetic coding unit used for performing arithmetic coding on the code stream of the code block to obtain a target code stream. In the present application, by means of the first channel and the second channel, a code stream consisting of a coding result output by the first channel and a coding result output by the second channel can be obtained, so that the arithmetic coding unit can adopt arithmetic coding modes having different compression rates and coding speeds for the bit plane coding results, and thus, both the compression rate and coding speed of the code block can be taken into consideration.

Description

编码器、编码系统和编码方法Encoder, encoding system and encoding method
版权申明Copyright statement
本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。The content disclosed in this patent document contains copyrighted material. The copyright belongs to the copyright owner. The copyright owner does not object to anyone copying the patent document or the patent disclosure in the official records and archives of the Patent and Trademark Office.
技术领域Technical field
本申请涉及图像解码领域,更为具体地,涉及一种编码器、编码系统和编码方法。This application relates to the field of image decoding, and more specifically, to an encoder, an encoding system, and an encoding method.
背景技术Background technique
联合图像专家小组(joint photographic experts group,JPEG)、JPEG 2000是常用的图像编码标准。Joint Photographic Experts Group (JPEG) and JPEG 2000 are commonly used image coding standards.
JPEG 2000采用小波变换,并基于优化截取内嵌码块编码(embedded block coding with optimized truncation,EBCOT)进行熵编码,具有比JPEG更高的压缩比,并支持渐进式下载和显示。JPEG 2000 uses wavelet transform and performs entropy coding based on optimized interception of embedded block coding (embedded block coding with optimized truncation, EBCOT), which has a higher compression ratio than JPEG, and supports progressive download and display.
传统JPEG 2000的编码器不能兼容压缩率和编码速率。The traditional JPEG 2000 encoder is not compatible with compression rate and encoding rate.
发明内容Summary of the invention
本申请提供一种编码器、编码系统和编码方法,能够有效兼容压缩率和编码速率。This application provides an encoder, an encoding system, and an encoding method, which can effectively be compatible with the compression rate and the encoding rate.
第一方面,提供了一种编码器,包括:In the first aspect, an encoder is provided, including:
Tier-1编码单元,对待编码图像的图像块的码块进行tier-1编码,得到所述码块的码流;The Tier-1 coding unit performs tier-1 coding on the code block of the image block of the image to be coded to obtain the code stream of the code block;
其中,所述Tier-1编码单元包括:Wherein, the Tier-1 coding unit includes:
位平面编码单元,所述位平面编码单元包括第一通道和第二通道,所述第一通道和所述第二通道用于对所述码块的多个位平面并行地进行位平面编码,得到所述码块的码流;A bit-plane encoding unit, the bit-plane encoding unit includes a first channel and a second channel, the first channel and the second channel are used to perform bit-plane encoding on multiple bit-planes of the code block in parallel, Obtain the code stream of the code block;
算术编码单元,用于对所述码块的码流进行算术编码,得到目标码流。The arithmetic coding unit is used to perform arithmetic coding on the code stream of the code block to obtain the target code stream.
第二方面,提供了一种编码系统,包括:In the second aspect, an encoding system is provided, including:
第一方面所述的编码器。The encoder described in the first aspect.
第三方面,提供了一种编码方法,包括:In the third aspect, an encoding method is provided, including:
通过第一通道和第二通道对待编码图像的图像块的码块的多个位平面并行地进行位平面编码,得到所述码块的码流;Bit-plane encoding is performed in parallel on multiple bit-planes of the code block of the image block of the image to be coded through the first channel and the second channel to obtain the code stream of the code block;
对所述码块的码流进行算术编码,得到目标码流。Perform arithmetic coding on the code stream of the code block to obtain the target code stream.
基于以上技术方案,本申请实施例的编码器、编码系统以及编码方法,通过第一通道和第二通道对所述码块的多个位平面并行地进行位平面编码,能够得到由所述第一通道输出的编码结果和所述第二通道输出的编码结果组成的码流,由此所述算术编码单元能够对所述第一通道输出的编码结果和所述第二通道输出的编码结果采用具有不同压缩率和编码速度的算术编码方式,进而能够同时兼顾所述码块的压缩率和编码速度。Based on the above technical solutions, the encoder, the encoding system, and the encoding method of the embodiments of the present application perform bit-plane encoding on the multiple bit-planes of the code block in parallel through the first channel and the second channel, so as to obtain the A code stream composed of the encoding result output by one channel and the encoding result output by the second channel, whereby the arithmetic encoding unit can use the encoding result output by the first channel and the encoding result output by the second channel Arithmetic coding methods with different compression rates and coding speeds can also take into account the compression rate and coding speed of the code block at the same time.
附图说明Description of the drawings
图1是JPEG 2000的编码框架图。Figure 1 is a coding framework diagram of JPEG 2000.
图2是本申请实施例提供的编码系统的结构示意图。Fig. 2 is a schematic structural diagram of an encoding system provided by an embodiment of the present application.
图3是图2所示的编码单元的示意性结构图。Fig. 3 is a schematic structural diagram of the coding unit shown in Fig. 2.
图4是本申请的位平面和编码通道之间的关系的示意性结构图。Fig. 4 is a schematic structural diagram of the relationship between the bit plane and the coding channel of the present application.
图5是本申请的位平面编码过程中SPP、MRP和CUP的扫描顺序的示意图。Fig. 5 is a schematic diagram of the scanning sequence of SPP, MRP and CUP in the bit-plane coding process of the present application.
图6是本申请的位平面的像素的邻域的示意图。FIG. 6 is a schematic diagram of the neighborhood of the pixel of the bit plane of the present application.
图7是本申请的SPP、MRP和CUP的扫描窗口的示例。Fig. 7 is an example of scanning windows of SPP, MRP and CUP of the present application.
图8是本申请的SPP、MRP和CUP的扫描窗口的另一示例。Fig. 8 is another example of scanning windows of SPP, MRP and CUP of the present application.
图9是本申请实施例提供的解码器的结构示意图。Fig. 9 is a schematic structural diagram of a decoder provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请可应用于图像编解码领域、视频编解码领域、硬件视频编解码领域、专用电路视频编解码领域、实时视频编解码领域。This application can be applied to the field of image coding and decoding, video coding and decoding, hardware video coding and decoding, dedicated circuit video coding and decoding, and real-time video coding and decoding.
本申请提供的编码器可用于对图像进行有损压缩(lossy compression),也可用于对图像进行无损压缩(lossless compression)。该无损压缩可以是视觉无损压缩(visually lossless compression),也可以是数学无损压缩(mathematically lossless compression)。The encoder provided in this application can be used to perform lossy compression (lossy compression) on images, and can also be used to perform lossless compression (lossless compression) on images. The lossless compression can be a visually lossless compression (visually lossless compression) or a mathematically lossless compression (mathematically lossless compression).
为了便于理解,先对JPEG 2000的编码框架进行简单介绍。To facilitate understanding, first briefly introduce the coding framework of JPEG 2000.
如图1所示,JPEG 2000的编码框架可以包括预处理模块12、变换模块14、量化模块16、EBCOT模块18。As shown in FIG. 1, the coding framework of JPEG 2000 may include a preprocessing module 12, a transformation module 14, a quantization module 16, and an EBCOT module 18.
预处理模块12可以包括分量变换(component transformation)模块122和直流电平平移(direct current level shift)模块124。The preprocessing module 12 may include a component transformation (component transformation) module 122 and a direct current level shift module 124.
每个图像由不同的分量(component)组成。分量变换模块122可以对图像的分量进行某种变换以降低各分量之间的相关性。例如,分量变换模块122可以将图像的各个分量从当前颜色域(例如红蓝绿(RGB))转换至另一颜色域。Each image is composed of different components. The component transformation module 122 may perform a certain transformation on the components of the image to reduce the correlation between the components. For example, the component transformation module 122 may convert each component of the image from the current color domain (for example, red, blue and green (RGB)) to another color domain.
分量变换模块122可以支持多种颜色变换模式,因此,分量变换模块122有时也可称为多模颜色变换(multi-mode color transform,MCT)模块。例如,分量变换模块122可支持不可逆颜色变换(irreversible color transform,ICT)或可逆颜色变换(reversible color transform,RCT)。需要说明的是,分量变换模块122是可选的,实际编码过程中,也可以不对图像进行分量变换,直接进行后续处理。The component transformation module 122 may support multiple color transformation modes. Therefore, the component transformation module 122 may sometimes be referred to as a multi-mode color transform (MCT) module. For example, the component transform module 122 may support irreversible color transform (ICT) or reversible color transform (RCT). It should be noted that the component transformation module 122 is optional. In the actual encoding process, it is also possible to directly perform subsequent processing without performing component transformation on the image.
直流电平平移模块124可用于对分量值进行中心平移(又称为直流电平平移),使得分量值关于0对称分布,以便于后续变换模块14的变换操作。The DC level shift module 124 can be used to perform a center shift (also referred to as a DC level shift) on the component values, so that the component values are symmetrically distributed with respect to 0, so as to facilitate subsequent transformation operations of the transformation module 14.
变换模块14采用小波变换对图像中的各个图像块(tile)进行变换,得到得到不同分辨率级别的子带(sub-band)的小波系数,n级小波变换后就有n+1个分辨率级别,每个分辨率级别有3个子带(除去最低分辨率只有1个子带)。The transform module 14 uses wavelet transform to transform each tile in the image to obtain sub-band wavelet coefficients of different resolution levels. After n-level wavelet transform, there are n+1 resolutions. Level, each resolution level has 3 subbands (except for the lowest resolution, only 1 subband).
需要注意的是,对于分辨率r不是最低分辨率时,实际包含了HH、HL、LH、LL四个子带,但由于LL是分配给下一分辨率的,因此只处理HH、HL、LH这三个子带。It should be noted that when the resolution r is not the lowest resolution, the four subbands HH, HL, LH, and LL are actually included, but because LL is allocated to the next resolution, only HH, HL, and LH are processed. Three sub-bands.
应理解,本申请实施例对图像块的尺寸不做具体限定,例如可以是512×512(单位为像素)。又例如,可以将整个图像作为一个图像块。It should be understood that the embodiment of the present application does not specifically limit the size of the image block, for example, it may be 512×512 (unit is pixel). For another example, the entire image can be regarded as an image block.
量化模块16可用于对子带的小波系数进行量化,得到量化后的子带的小波系数。The quantization module 16 may be used to quantize the wavelet coefficients of the subbands to obtain the quantized wavelet coefficients of the subbands.
EBCOT模块18是JEPG 2000的熵编码模块,属于JEPG 2000的核心模块。The EBCOT module 18 is the entropy coding module of JEPG 2000, and belongs to the core module of JEPG 2000.
EBCOT模块18可以包括tier-1编码模块182、tier-2编码模块184和码 率控制模块186。tier-1编码模块182可用于对码块(子带可以进一步划分成独立的多个码块(codeblock))进行tier-1编码。tier-1编码可以包括比特平面编码和算术编码。tier-2编码模块184主要负责码流的组织工作,如可以根据码率控制模块186提供的目标码率对码块的码流进行截断等处理。The EBCOT module 18 may include a tier-1 encoding module 182, a tier-2 encoding module 184, and a rate control module 186. The tier-1 encoding module 182 can be used to perform tier-1 encoding on a code block (the subband can be further divided into multiple independent code blocks). Tier-1 coding can include bit-plane coding and arithmetic coding. The tier-2 encoding module 184 is mainly responsible for the organization of the code stream. For example, the code stream of the code block can be truncated according to the target code rate provided by the code rate control module 186.
下面将结合图2对本申请中的编码器进行描述。The encoder in this application will be described below in conjunction with FIG. 2.
如图2所示,编码器7可以包括第一接口电路71、变换电路72、量化电路73、第一编码电路74、码率控制电路75、第二编码电路76以及码流写出电路77。As shown in FIG. 2, the encoder 7 may include a first interface circuit 71, a transform circuit 72, a quantization circuit 73, a first encoding circuit 74, a rate control circuit 75, a second encoding circuit 76 and a code stream writing circuit 77.
编码器7可以是支持JPEG 2000标准的硬件编码器。The encoder 7 may be a hardware encoder supporting the JPEG 2000 standard.
第一接口电路71可以用于获取待编码图像,并在获取待编码图像后,将所述待编码图像划分为多个图像块。当然,第一接口电路71也可以用于直接获取划分好的图像块。所述待编码图像可以是经过分量变换的图像。所述待编码图像的格式可以是任意具有4个或者3个分量的图像格式。其中,具有4个分量的图像格式包括但不限于Bayer pattern RAW格式或者由Bayer pattern RAW格式转化成的YUVGb格式或YDgCoCg格式。具有3个分量的图像格式包括但不限于RGB格式和YUV格式。The first interface circuit 71 may be used to obtain an image to be coded, and after obtaining the image to be coded, divide the image to be coded into multiple image blocks. Of course, the first interface circuit 71 can also be used to directly obtain the divided image blocks. The image to be encoded may be an image subjected to component transformation. The format of the image to be encoded may be any image format with 4 or 3 components. Among them, the image format with 4 components includes but is not limited to Bayer pattern RAW format or YUVGb format or YDgCoCg format converted from Bayer pattern RAW format. Image formats with 3 components include but are not limited to RGB format and YUV format.
第一接口电路71可以用于接收传感器采集到的待编码图像,也可以用于从存储器读取待编码图像或该待编码图像的图像块,还可以从图像信号处理(image signal processing,ISP)系统获取经过分量变换的图像,其中,ISP包括但不限于数字信号处理器(digital signal processor,DSP)和图形处理单元(graphics processing unit,GPU)。The first interface circuit 71 can be used to receive the image to be encoded collected by the sensor, can also be used to read the image to be encoded or the image block of the image to be encoded from the memory, and can also use image signal processing (ISP) The system acquires an image that has undergone component transformation. The ISP includes but is not limited to a digital signal processor (DSP) and a graphics processing unit (GPU).
以第一接口电路71从存储器获取待编码图像的图像块为例,待编码图像可以按行顺序或列顺序存储在存储器中,此时第一接口电路71可以根据待编码图像在存储器中的位置,计算出各个图像块的存储位置,然后按照跳跃寻址方式读取相应图像块。当然,待编码图像也可以以图像块为单元存储在存储器中,此时第一接口电路71可以按照图像块的存储顺序读取图像块。具体地,第一接口电路71可以采用特定的寻址方式读取存储器中存储的待编码图像的图像块,而无需对待编码图像进行分割。第一接口电路71也可以按照直接内存存取(direct memory access,DMA)方式从存储器中直接读取图像块,以提高存取效率和速度。Taking the image block of the image to be encoded by the first interface circuit 71 from the memory as an example, the image to be encoded can be stored in the memory in row order or column order. At this time, the first interface circuit 71 can be based on the position of the image to be encoded in the memory. , Calculate the storage location of each image block, and then read the corresponding image block according to the jump addressing mode. Of course, the image to be encoded can also be stored in the memory in units of image blocks, and the first interface circuit 71 can read the image blocks according to the storage order of the image blocks. Specifically, the first interface circuit 71 can use a specific addressing mode to read the image blocks of the image to be coded stored in the memory without segmenting the image to be coded. The first interface circuit 71 may also directly read image blocks from the memory in a direct memory access (DMA) manner, so as to improve the access efficiency and speed.
在一些实施例中,第一接口电路71可以包括计算电路。In some embodiments, the first interface circuit 71 may include a calculation circuit.
计算电路可用于计算待编码图像的统计信息。当然,所述计算电路也可以和所述第一接口电路71或编码器7分离设置。例如,在其他可替代实施例中,所述计算电路也可以设置于图像信号处理(image signal processing,ISP)系统。The calculation circuit can be used to calculate the statistical information of the image to be encoded. Of course, the calculation circuit can also be provided separately from the first interface circuit 71 or the encoder 7. For example, in other alternative embodiments, the calculation circuit may also be set in an image signal processing (image signal processing, ISP) system.
待编码图像的统计信息可以是能够用于对待编码图像中的图像块(tile)进行码率控制的信息,因此,在某些实施例中,待编码图像的统计信息也可以称为待编码图像块的码率控制信息。待编码图像的统计信息可以包括待编码图像中的图像块的以下信息中的一种或多种:复杂度、活动性、纹理。The statistical information of the image to be encoded may be information that can be used to control the rate of the tile in the image to be encoded. Therefore, in some embodiments, the statistical information of the image to be encoded may also be referred to as the image to be encoded. Block rate control information. The statistical information of the image to be encoded may include one or more of the following information of the image blocks in the image to be encoded: complexity, activity, and texture.
待编码图像的统计信息的计算方式可以有多种。There can be multiple calculation methods for the statistical information of the image to be encoded.
以待编码图像的统计信息为待编码图像中的图像块的复杂度为例,计算电路可以基于图像块内像素点的高频分量的幅值定义或计算图像块的复杂度。比如,图像块的复杂度可以为图像块区域内每个像素所处位置的高频信息的累加和。当图像块的纹理较复杂,那么相应的高频分量的幅值的累加和也会相应较大,可以认为该图像块的复杂度较高。根据图像的编码理论,复杂度较高的图像块区域对应的编码后的码流(或编码所需消耗的比特数)也会相应较大。具体地,计算电路可以基于图像块区域内的像素点的像素值,通过滤波操作,得到高频分量,进而计算图像块的复杂度。在其他可替代实施例中,计算电路也可以基于图像块的像素值的均方误差(mean-square error,MSE)定义或计算图像块的复杂度,图像块的像素值的MSE越大,可以认为该图像块的复杂度越高。应理解,图像块的复杂度也可以采用其他定义方式,或上述定义方式的组合,本申请实施例对此并不限定。第一接口电路71也可以用于从外部的存储器中读取预先生成的待编码图像的统计信息。本申请对此不做具体限制。Taking the statistical information of the image to be encoded as the complexity of the image block in the image to be encoded as an example, the calculation circuit may define or calculate the complexity of the image block based on the amplitude of the high frequency components of the pixels in the image block. For example, the complexity of the image block may be the cumulative sum of the high frequency information of the location of each pixel in the image block area. When the texture of the image block is more complex, the cumulative sum of the amplitudes of the corresponding high-frequency components will be correspondingly larger, and it can be considered that the complexity of the image block is higher. According to the image coding theory, the coded code stream (or the number of bits consumed for coding) corresponding to the image block area with higher complexity will be correspondingly larger. Specifically, the calculation circuit may obtain high frequency components through filtering operations based on the pixel values of the pixels in the image block area, and then calculate the complexity of the image block. In other alternative embodiments, the calculation circuit may also define or calculate the complexity of the image block based on the mean-square error (MSE) of the pixel value of the image block. The larger the MSE of the pixel value of the image block, the larger the It is considered that the complexity of the image block is higher. It should be understood that the complexity of the image block may also be defined in other ways, or a combination of the above definitions, which is not limited in the embodiment of the present application. The first interface circuit 71 can also be used to read the pre-generated statistical information of the image to be encoded from an external memory. This application does not impose specific restrictions on this.
第一接口电路71可以将待编码图像的统计信息作为码率控制信息传输至码率控制电路75,供码率控制电路75对编码过程进行码率控制。The first interface circuit 71 may transmit the statistical information of the image to be encoded as rate control information to the rate control circuit 75 for the rate control circuit 75 to perform rate control on the encoding process.
变换电路72可用于执行上文中的变换模块14执行的操作,即对图像块进行小波变换。图像块经过小波变换之后可以得到许多子带。经过小波变换,可以得到图像块的小波系数,图像块的小波系数可以指这些子带(sub-band)的小波系数。The transform circuit 72 can be used to perform the operation performed by the transform module 14 above, that is, perform wavelet transform on the image block. After the image block undergoes wavelet transformation, many subbands can be obtained. After wavelet transformation, the wavelet coefficients of the image block can be obtained, and the wavelet coefficients of the image block can refer to the wavelet coefficients of these sub-bands.
量化电路73可用于对小波系数进行量化,得到量化后的小波系数或量化后的子带的小波系数。The quantization circuit 73 may be used to quantize the wavelet coefficients to obtain quantized wavelet coefficients or quantized wavelet coefficients of subbands.
第一编码电路74可以包括一个或多个EBCOT编码模块742,EBCOT编码模块742可用于对图像块的码块(子带可以进一步划分成独立的多个码块)进行tier-1编码,得到码块的码流。图像块的所有码块的码流组成该图像块的码流。The first encoding circuit 74 may include one or more EBCOT encoding modules 742. The EBCOT encoding module 742 may be used to perform tier-1 encoding on the code blocks of the image block (the subband can be further divided into multiple independent code blocks) to obtain the code The code stream of the block. The code streams of all code blocks of the image block constitute the code stream of the image block.
参见前文的描述可知,变换电路72接收的是图像块,经过变换电路72变换以及量化电路73量化后得到的是具有小波系数的子带,一个子带又可以被划分成可独立编码的一个或多个码块,即图像块的码块可以指图像块的子带的码块。Referring to the previous description, it can be seen that the transform circuit 72 receives the image block, and the transform circuit 72 transforms and the quantization circuit 73 quantizes the subbands with wavelet coefficients. A subband can be divided into independently coded one or Multiple code blocks, that is, code blocks of image blocks, may refer to code blocks of subbands of the image block.
EBCOT编码模块742可用于执行图1中的tier-1编码模块182执行的操作,如对码块进行比特平面编码和算术编码。可选地,第一编码电路74对码块进行编码之前,还可以对码块进行预处理,例如,将小波系数的符号位和绝对值分离。此外,在一些实施例中,第一编码电路74将码块编码成码流之后,还可以对码块进行后处理,如可以将码流拼接在一起,供第二编码电路76使用。The EBCOT encoding module 742 may be used to perform operations performed by the tier-1 encoding module 182 in FIG. 1, such as bit-plane encoding and arithmetic encoding on the code block. Optionally, before the first encoding circuit 74 encodes the code block, the code block may also be preprocessed, for example, the sign bit and the absolute value of the wavelet coefficient are separated. In addition, in some embodiments, after the first encoding circuit 74 encodes the code block into a code stream, it can also perform post-processing on the code block. For example, the code stream can be spliced together for use by the second encoding circuit 76.
码率控制电路75可用于根据待编码图像的统计信息确定待编码图像中的图像块的目标码率(target size)。The code rate control circuit 75 may be used to determine the target code rate (target size) of the image block in the image to be encoded according to the statistical information of the image to be encoded.
以待编码图像的统计信息为待编码图像中的图像块的复杂度为例,码率控制电路75可以根据各个图像块的复杂度,为各个图像块分配权值。图像块的复杂度越高,权值越大。码率控制电路75可以根据各个图像块的权值以及当前网络状况(如网络带宽),计算各个图像块的目标码率,使得图像块的权值越大,目标码率越高。可选地,计算电路输出的待编码图像的统计信息可以包括各个图像块的权值,码率控制电路75直接利用图像块的权值计算目标码率即可。Taking the statistical information of the image to be encoded as the complexity of the image block in the image to be encoded as an example, the rate control circuit 75 may assign weights to each image block according to the complexity of each image block. The higher the complexity of the image block, the greater the weight. The code rate control circuit 75 may calculate the target code rate of each image block according to the weight of each image block and current network conditions (such as network bandwidth), so that the larger the weight of the image block, the higher the target code rate. Optionally, the statistical information of the image to be encoded output by the calculation circuit may include the weight of each image block, and the code rate control circuit 75 may directly use the weight of the image block to calculate the target code rate.
第二编码电路76可用于实现上文提及的tier-2编码模块184的功能。例如,第二编码电路76可用于根据目标码率对图像块的码流进行tier-2编码,以截断图像块的码流。具体地,第二编码电路76接收到第一编码电路74发送的每个码块的码流后,可以根据输出码率的要求(例如输出的目标码率),组合每个码块的码流,对所有码块的码流进行优化截断排序、打包等处理,以得到JPEG2000的码流。The second encoding circuit 76 can be used to implement the function of the tier-2 encoding module 184 mentioned above. For example, the second encoding circuit 76 may be used to perform tier-2 encoding on the bit stream of the image block according to the target bit rate, so as to cut the bit stream of the image block. Specifically, after the second encoding circuit 76 receives the code stream of each code block sent by the first encoding circuit 74, it can combine the code streams of each code block according to the output code rate requirements (for example, the output target code rate). , Carry out optimization truncation sorting, packing and other processing on the code stream of all code blocks to obtain the JPEG2000 code stream.
第二编码电路76可以包括率失真计算电路762(或称slope maker)和截断电路764(或称truncator)。The second encoding circuit 76 may include a rate-distortion calculation circuit 762 (or slopemaker) and a truncation circuit 764 (or truncator).
率失真计算电路762可用于计算第一编码电路74输出的码流的率失真斜率。例如,率失真计算电路762可以根据第一编码电路74输出的每片码流(即每个码块的码流(pass))的码率(rate)和失真度(distortion)计算率失真斜率(slope)。率失真斜率可用于评估当前码块的每一段码流在整个图像块的贡献度。该率失真斜率可用于后续的码流组织,如码流的分层、截断等。具体而言,在编码过程中,当前码块会被分为若干比特平面,每个比特平面通过编码后会产生3段码流(3-pass编码,除了最高比特平面只会产生1段码流之外),其中,每一段码流都会对应一个slope值。The rate-distortion calculation circuit 762 can be used to calculate the rate-distortion slope of the code stream output by the first encoding circuit 74. For example, the rate-distortion calculation circuit 762 may calculate the rate-distortion slope (distortion) based on the rate and distortion of each code stream (that is, the code stream (pass) of each code block) output by the first encoding circuit 74. slope). The rate-distortion slope can be used to evaluate the contribution of each segment of the current code block to the entire image block. The rate-distortion slope can be used for subsequent code stream organization, such as code stream layering and truncation. Specifically, in the encoding process, the current code block will be divided into several bit planes, and each bit plane will generate 3 bit streams after encoding (3-pass encoding, except for the highest bit plane, only 1 bit stream will be generated. Outside), where each segment of the code stream corresponds to a slope value.
也就是说,当前码块对应的率失真斜率可以包括当前码块经过位比特平面编码后产生的每一段码流对应的slope值。That is, the rate-distortion slope corresponding to the current code block may include the slope value corresponding to each segment of the code stream generated after the current code block is bit-plane encoded.
截断电路764可用于根据目标码率以及率失真斜率对图像块的码流进行处理。例如,截断电路764可用于根据目标码率以及率失真斜率截断图像块的码流。进一步地,截断电路764还可用于对码流进行重新组织,码流分层等。此外,在某些实施例中,截断电路764还可用于生成码流的header信息,并将header信息与码流一块传输至后级的码流写出电路77。The truncation circuit 764 can be used to process the bit stream of the image block according to the target bit rate and the rate-distortion slope. For example, the truncation circuit 764 can be used to cut the bit stream of the image block according to the target bit rate and the rate-distortion slope. Further, the truncation circuit 764 can also be used to reorganize the code stream, layer the code stream, and so on. In addition, in some embodiments, the truncation circuit 764 may also be used to generate header information of the code stream, and transmit the header information together with the code stream to the subsequent code stream write circuit 77.
码流写出电路77可用于接收截断电路764输出的已经组织好的码流,并将码流写到外部的存储器中。例如,可以通过总线写到外部的存储器中。该总线例如可以是高级扩展接口(advanced extensible interface,AXI)总线。码流写出电路77还可以为码流追加图像块头部(tile header)等信息。The code stream write circuit 77 can be used to receive the organized code stream output by the truncation circuit 764 and write the code stream to an external memory. For example, it can be written to an external memory via the bus. The bus may be, for example, an advanced extensive interface (AXI) bus. The code stream writing circuit 77 may also add information such as a tile header to the code stream.
在一些实施例中,码率控制电路75还可用于根据图像块的统计信息,生成码率控制缓冲区的状态信息(或称缓冲区大小,buffer size)。第一编码电路74还可用于根据码率控制缓冲区的状态信息,对tier-1编码进行控制。缓冲区的状态信息可用于第一编码电路74对码流进行预截断。例如,第一编码电路74可以根据缓冲区的状态信息删除超出预定大小的码流,或者删除不符合要求的码流。因此,缓冲区的状态信息也可称为预截断信息。进一步地,在一些实施例中,码率控制电路75还可以接收第一编码电路74实际编码的码流大小的反馈,并更新对应小波子带下图像块的的预截断信息。In some embodiments, the rate control circuit 75 may also be used to generate the state information of the rate control buffer (or buffer size) according to the statistical information of the image block. The first encoding circuit 74 can also be used to control the tier-1 encoding according to the state information of the code rate control buffer. The status information of the buffer can be used by the first encoding circuit 74 to pre-truncate the code stream. For example, the first encoding circuit 74 may delete code streams that exceed a predetermined size according to the status information of the buffer, or delete code streams that do not meet the requirements. Therefore, the status information of the buffer can also be called pre-truncation information. Further, in some embodiments, the rate control circuit 75 may also receive feedback of the size of the code stream actually encoded by the first encoding circuit 74, and update the pre-truncation information of the image block corresponding to the wavelet subband.
在一些实施例中,编码器7还可以包括用于软件配置的接口电路(图中未示出),通过该接口电路可以配置或改变编码器7内部的寄存器中的信息,从而控制编码器7的编码方式。In some embodiments, the encoder 7 may also include an interface circuit (not shown in the figure) for software configuration, through which the information in the register inside the encoder 7 can be configured or changed, thereby controlling the encoder 7 Encoding method.
本申请实施例计算待编码图像中的图像块的统计信息,并根据该统计信 息截断图像块的码流,从而对各个图像块进行相对独立的码率控制,无需以各个图像块的码块为单位进行优化,避免产生大量的中间数据,因此,本申请实施例可以降低编码器对系统带宽的要求。整个待编码图像的编码过程甚至完全可以在片上进行。The embodiment of the present application calculates the statistical information of the image blocks in the image to be encoded, and cuts the code stream of the image blocks according to the statistical information, thereby performing relatively independent bit rate control on each image block without taking the code block of each image block as The unit is optimized to avoid generating a large amount of intermediate data. Therefore, the embodiment of the present application can reduce the requirement of the encoder on the system bandwidth. The entire encoding process of the image to be encoded can even be carried out completely on the chip.
在一些实施例中,变换电路72内部或输出端可以设置缓存(片上缓存),用于缓存变换电路72输出的中间结果。In some embodiments, a buffer (on-chip buffer) may be set inside the conversion circuit 72 or at the output terminal, for buffering the intermediate results output by the conversion circuit 72.
在一些实施例中,截断电路764内部或输出端可以设置缓存(片上缓存),用于缓存截断电路764输出的中间结果。In some embodiments, a buffer (on-chip buffer) may be set inside or at the output end of the truncation circuit 764 for buffering the intermediate results output by the truncation circuit 764.
在一些实施例中,可以对编码器7中的相邻两级电路进行速率匹配,以提高编码器7编码效率。例如,可以将相邻两级电路中的处理速度较慢的电路设置成多路并行结构;然后,可以采用一定的机制控制二者之间的数据传输,使得两级电路充分流水。In some embodiments, rate matching can be performed on adjacent two-stage circuits in the encoder 7 to improve the encoding efficiency of the encoder 7. For example, circuits with slower processing speeds in adjacent two-stage circuits can be set to a multi-channel parallel structure; then, a certain mechanism can be used to control the data transmission between the two, so that the two-stage circuits are fully streamlined.
作为一个示例,可以对量化电路73与第一编码电路74的速率进行匹配。具体地,如图2所示,第一编码电路74包括多个EBCOT编码模块742时,该多个EBCOT编码模块742可用于对量化电路73输出的各个码块并行地进行tier-1编码,即第一编码电路74可以采用多路并行结构进行tier-1编码。由于量化电路73输给第一编码电路74的码块可以是多个频率分量对应的码流(例如LL、HL、LH、HH对应的码块),因此,量化电路73和多个EBCOT编码模块742之间可以采用分组仲裁或自由仲裁的方式确定量化电路73输出的中间结果所对应的EBCOT编码模块742。其中,分组仲裁指的是将量化电路73输出的某个频率分量对应的码块始终分配给固定的一组编码单元(每组编码单元可以由若干个编码单元组成),而自由仲裁是指量化电路73输出的每个码块均有可能被多路并行的编码单元中的一路接收。分组仲裁方式的优点在于硬件实现时电路连接较为简单,而自由仲裁方式则在某些情况下能提高编码单元的利用效率。As an example, the rates of the quantization circuit 73 and the first encoding circuit 74 may be matched. Specifically, as shown in FIG. 2, when the first encoding circuit 74 includes multiple EBCOT encoding modules 742, the multiple EBCOT encoding modules 742 can be used to perform tier-1 encoding on each code block output by the quantization circuit 73 in parallel, that is, The first encoding circuit 74 may adopt a multi-path parallel structure to perform tier-1 encoding. Since the code blocks output by the quantization circuit 73 to the first encoding circuit 74 may be code streams corresponding to multiple frequency components (for example, code blocks corresponding to LL, HL, LH, and HH), the quantization circuit 73 and multiple EBCOT encoding modules Group arbitration or free arbitration can be adopted between 742 to determine the EBCOT encoding module 742 corresponding to the intermediate result output by the quantization circuit 73. Among them, group arbitration refers to always assigning the code block corresponding to a certain frequency component output by the quantization circuit 73 to a fixed group of coding units (each group of coding units can be composed of several coding units), while free arbitration refers to quantization Each code block output by the circuit 73 may be received by one of the multiple parallel encoding units. The advantage of the packet arbitration method is that the circuit connection is relatively simple in hardware implementation, while the free arbitration method can improve the utilization efficiency of the coding unit in some cases.
作为另一示例,可以对第一编码电路74和率失真斜率计算电路762的速率进行匹配。例如,率失真计算电路762可以包括多个率失真斜率计算单元。该多个率失真斜率计算单元可用于并行地计算第一编码电路74输出的码流的率失真斜率。第一编码电路74与率失真计算电路762之间也可以采用分组仲裁或自由仲裁的方式确定第一编码电路74输出的中间结果所对应的率失真斜率计算单元。以分组仲裁为例,一个率失真斜率计算单元可以对 应第一编码电路74中的一组编码单元。一个率失真斜率计算单元对应一组编码单元可以使得整个电路的设计更加简单。As another example, the rates of the first encoding circuit 74 and the rate-distortion slope calculation circuit 762 may be matched. For example, the rate-distortion calculation circuit 762 may include a plurality of rate-distortion slope calculation units. The multiple rate-distortion slope calculation units can be used to calculate the rate-distortion slope of the code stream output by the first encoding circuit 74 in parallel. The first encoding circuit 74 and the rate-distortion calculation circuit 762 may also adopt a group arbitration or free arbitration method to determine the rate-distortion slope calculation unit corresponding to the intermediate result output by the first encoding circuit 74. Taking packet arbitration as an example, one rate-distortion slope calculation unit can correspond to a group of coding units in the first coding circuit 74. A rate-distortion slope calculation unit corresponding to a group of encoding units can make the design of the entire circuit easier.
图3是图2所示的EBCOT编码模块742的示意性结构图。FIG. 3 is a schematic structural diagram of the EBCOT encoding module 742 shown in FIG. 2.
如图3所示,EBCOT编码模块742可以包括预处理单元64、tier-1编码单元6以及后处理单元65。As shown in FIG. 3, the EBCOT encoding module 742 may include a preprocessing unit 64, a tier-1 encoding unit 6, and a post-processing unit 65.
tier-1编码单元6对码块进行编码之前,预处理单元64可以用于对码块进行预处理,例如,将小波系数的符号位和绝对值分离。tier-1编码单元6将码块编码成码流之后,后处理单元65可以用于对码块的码流进行后处理,如可以将码流拼接在一起,供第二编码电路76使用。Before the tier-1 encoding unit 6 encodes the code block, the preprocessing unit 64 may be used to preprocess the code block, for example, to separate the sign bit and the absolute value of the wavelet coefficient. After the tier-1 encoding unit 6 encodes the code block into a code stream, the post-processing unit 65 can be used to perform post-processing on the code stream of the code block. For example, the code streams can be spliced together for use by the second encoding circuit 76.
预处理模块64可以包括第一存储器641和第二存储器642,tier-1编码单元6可通过第一存储器641和第二存储器642读取预处理单元64预处理后的码块。The preprocessing module 64 may include a first memory 641 and a second memory 642, and the tier-1 encoding unit 6 can read the code blocks preprocessed by the preprocessing unit 64 through the first memory 641 and the second memory 642.
后处理模块65可以包括存取指令生成单元651、第三存储器652以及第四存储器653,后处理模块65可用于接收tier-1编码单元6输出的码流,并基于接收到的码流生成存取指令,然后基于存取指令存储tier-1编码单元6输出的码流。存取指令生成单元651具体用于接收第一算术编码器621和码流组织单元63输出的码流,并将这些码流存储至所述第三存储器652和/或所述第四存储器653的对应地址。The post-processing module 65 may include an access instruction generation unit 651, a third memory 652, and a fourth memory 653. The post-processing module 65 may be used to receive the code stream output by the tier-1 encoding unit 6, and generate a memory based on the received code stream. The instruction is fetched, and then the code stream output by the tier-1 encoding unit 6 is stored based on the access instruction. The access instruction generating unit 651 is specifically configured to receive the code streams output by the first arithmetic encoder 621 and the code stream organizing unit 63, and store these code streams in the third memory 652 and/or the fourth memory 653. Corresponding address.
tier-1编码单元6可以包括位平面编码单元61、算术编码单元62以及码流组织单元63,用于负责数据的具体压缩。The tier-1 coding unit 6 may include a bit-plane coding unit 61, an arithmetic coding unit 62, and a code stream organizing unit 63, which are used for specific compression of data.
其中,位平面编码单元61可以对每个码块进行多通道位平面编码,以生成上下文信息和判决结果,该判决结果用于生成码流,该上下文信息用于算术编码单元62建立概率模型,进而对位平面编码单元61输出的码流进行算术编码。Wherein, the bit-plane coding unit 61 may perform multi-channel bit-plane coding on each code block to generate context information and a decision result. The decision result is used to generate a code stream, and the context information is used for the arithmetic coding unit 62 to establish a probability model. Furthermore, arithmetic coding is performed on the code stream output by the bit-plane coding unit 61.
预处理模块64将码块的小波系数分解成位平面(也称为比特平面),并将分解后的位平面重新组织后发送至位平面编码单元61,位平面编码单元61接收到预处理模块64发送的已组织的位平面进行位平面编码。位平面上存放的是系数的二进制对应位上的位值。位平面编码单元61对每一位平面上的比特进行扫描以及编码,然后将生成的上下文信息和码流发送至算术编码单元62或码流组织单元63,以便算术编码单元62进行算术编码以及码流组织单元63进行码流组织。The preprocessing module 64 decomposes the wavelet coefficients of the code block into bit planes (also called bit planes), reorganizes the decomposed bit planes and sends them to the bit plane encoding unit 61, and the bit plane encoding unit 61 receives the preprocessing module 64 transmitted organized bit planes are bit plane encoded. Stored on the bit plane is the bit value of the binary corresponding bit of the coefficient. The bit-plane encoding unit 61 scans and encodes the bits on each bit-plane, and then sends the generated context information and code stream to the arithmetic encoding unit 62 or the code stream organizing unit 63, so that the arithmetic encoding unit 62 performs arithmetic encoding and coding. The stream organization unit 63 performs code stream organization.
具体而言,位平面编码单元61对部分位平面(高位平面以及高位平面之下的3个平面)上的比特进行扫描以及编码后,通过分发单元613并将生成的上下文信息和码流发送至第一算术编码器621,由第一算术编码器621进行算术编码,第一算术编码器621将编码后的码流发送至后处理模块65。此外,位平面编码单元61对剩余部分的位平面上的比特进行扫描以及编码后,通过分发单元613并将生成的上下文信息和码流发送至第二算术编码器622,由第二算术编码器622进行算术编码,第二算术编码器622将编码后的码流发送至码流组织单元63,由码流组织单元63重新组织后发送至后处理模块65。后处理模块65将第一算术编码器621和码流组织单元63输出的码流存储至所述第三存储器652和/或所述第四存储器653的对应地址。Specifically, the bit-plane encoding unit 61 scans and encodes the bits on part of the bit-plane (the upper-level plane and the 3 planes below the upper-level plane), and then sends the generated context information and code stream to the distribution unit 613. The first arithmetic encoder 621 performs arithmetic encoding by the first arithmetic encoder 621, and the first arithmetic encoder 621 sends the encoded bit stream to the post-processing module 65. In addition, after the bit-plane encoding unit 61 scans and encodes the bits on the remaining part of the bit-plane, the distribution unit 613 sends the generated context information and code stream to the second arithmetic encoder 622, and the second arithmetic encoder 622 performs arithmetic coding, and the second arithmetic encoder 622 sends the encoded bitstream to the bitstream organizing unit 63, which is reorganized by the bitstream organizing unit 63 and then sent to the post-processing module 65. The post-processing module 65 stores the code streams output by the first arithmetic encoder 621 and the code stream organizing unit 63 to the corresponding addresses of the third memory 652 and/or the fourth memory 653.
位平面编码单元61可以对每个码块进行多通道位平面编码,多通道位平面编码可以包括显著性传播通道(significance propagation pass,SPP或SP)编码、幅度细化通道(magnitude refinement pass,MRP或MR)编码和清除通道(clean up pass,CUP或SP)编码。The bit-plane coding unit 61 can perform multi-channel bit-plane coding for each code block, and the multi-channel bit-plane coding can include significance propagation pass (significance propagation pass, SPP or SP) coding, amplitude refinement pass (magnitude refinement pass, MRP) Or MR) encoding and clean up pass (CUP or SP) encoding.
其中,显著性传播通道是每个位平面的第一个编码通道(除了最高位平面,在最高位平面中,只有一种编码通道,即清除编码通道),用于编码当前不是显著系数,但其8个邻域有已被标注为显著系数的。例如,对于并未被标注为重要的待编码数据X,只要其周围的8个比特数据至少有一个是已被标注为显著系数,则该待编码数据X将在此通道中进行编码。位平面中的每一个系数可以对应一个用于表示“显著状态”的二进制状态变量s[j],j表示系数扫描坐标。显著状态初始化为0,s状态值在每个位平面都会更新,当某个系数在当前位平面变为显著,则将对应的s[j]=1(系数一旦变为显著,则接下来对应的显著状态s[j]=1不会再改变),同时会从最高位平面一直传导到需要编码的最低位平面。Among them, the saliency propagation channel is the first encoding channel of each bit plane (except for the highest bit plane, in the highest bit plane, there is only one encoding channel, that is, the clear encoding channel), which is used to encode currently not significant coefficients, but The 8 neighborhoods have been marked as significant coefficients. For example, for the data X to be encoded that is not marked as important, as long as at least one of the surrounding 8-bit data has been marked as a significant coefficient, the data X to be encoded will be encoded in this channel. Each coefficient in the bit plane can correspond to a binary state variable s[j] used to represent a "significant state", where j represents the coefficient scan coordinate. The saliency state is initialized to 0, and the s state value will be updated in each bit plane. When a coefficient becomes significant in the current bit plane, the corresponding s[j] = 1 (once the coefficient becomes significant, the next corresponding The significant state s[j]=1 will not change), and it will be conducted from the highest bit plane to the lowest bit plane that needs to be coded.
幅度细化通道是每个位平面的第二个编码通道(除了最高位平面,在最高位平面中,只有一种编码通道,即清除编码通道),用于编码在上一个比特平面已经被标注为显著的系数。The amplitude refinement channel is the second encoding channel of each bit plane (except for the highest bit plane, in the highest bit plane, there is only one encoding channel, that is, the clear encoding channel), which is used for encoding when the previous bit plane has been marked Is a significant coefficient.
清除通道是每个位平面的第三个编码通道(除了最高位平面,在最高位平面中,只有一种编码通道,即清除编码通道),用于编码剩下的系数。清除编码通道可以加入游程编码的编码方式和零编码的编码方式。具体地,在此通道中可以对一排的四个比特同时进行判断。例如,当四个比特都没有已 经被标注为显著的相邻数据时,则对其采用游程长度编码,否则分别对每个比特采用零编码。The clear channel is the third encoding channel of each bit plane (except for the highest bit plane, in the highest bit plane, there is only one encoding channel, that is, the clear encoding channel), which is used to encode the remaining coefficients. To clear the coding channel, run-length coding and zero coding can be added. Specifically, the four bits in a row can be judged simultaneously in this channel. For example, when four bits have no adjacent data that has been marked as significant, run-length coding is used for them, otherwise zero coding is used for each bit.
在前文所述的三种编码通道中,位平面编码单元61在不同的编码通道中可以采用不同的编码方式对位平面进行位平面编码。其中,在编码通道中采用的编码方式包括但不限于:显著性编码(Significance Coding,ZC),符号编码(Symbolic Coding,SC),幅度细化编码(Magnitude Refinement Coding,MRC)和游程长度编码(Run Length Encoding,RLC)。In the three encoding channels described above, the bit-plane encoding unit 61 may use different encoding methods to perform bit-plane encoding on the bit-plane in different encoding channels. Among them, the coding methods used in the coding channel include but are not limited to: Significance Coding (ZC), Symbol Coding (SC), Magnitude Refinement Coding (MRC) and run length coding ( Run Length Encoding, RLC).
例如,在显著性传播通道中,可以对位平面上的比特进行ZC编码和SC编码;在幅值细化通道中,可以对位平面上的比特进行MRC编码;在清除通道中,对位平面上的比特可以进行ZC编码、SC编码和RLC编码。位平面上的比特经过上述多通道位平面编码后,算术编码单元62对其输出进行算术编码。For example, in the saliency propagation channel, ZC encoding and SC encoding can be performed on the bits on the bit plane; in the amplitude refinement channel, the bits on the bit plane can be MRC encoded; in the clear channel, the bit plane The above bits can be ZC coded, SC coded and RLC coded. After the bits on the bit plane are coded by the above-mentioned multi-channel bit plane, the arithmetic coding unit 62 performs arithmetic coding on its output.
位平面编码单元61通过对位平面进行位平面编码后,可以得到每个位平面的3组二进制序列,即每个通道对应一组二进制序列。After the bit-plane encoding unit 61 performs bit-plane encoding on the bit-plane, it can obtain three sets of binary sequences for each bit-plane, that is, each channel corresponds to a set of binary sequences.
请继续参见图3,位平面编码单元61可以包括第一通道611和第二通道612。算术编码单元62可包括第一算术编码器621和第二算术编码器622。其中第一算术编码器621和第二算术编码器622可以为相同类型的算术编码器或不同类型的算术编码器。第一通道611和第二通道612可分别对应第一算术编码器621和第二算术编码器622。算术编码单元62也可以只包括一个算术编码器,或其它数量的算术编码器,本申请不做具体限制。Please continue to refer to FIG. 3, the bit-plane encoding unit 61 may include a first channel 611 and a second channel 612. The arithmetic encoding unit 62 may include a first arithmetic encoder 621 and a second arithmetic encoder 622. The first arithmetic encoder 621 and the second arithmetic encoder 622 may be the same type of arithmetic encoder or different types of arithmetic encoders. The first channel 611 and the second channel 612 may correspond to the first arithmetic encoder 621 and the second arithmetic encoder 622, respectively. The arithmetic coding unit 62 may also include only one arithmetic encoder or other number of arithmetic encoders, which is not specifically limited in this application.
其中,第一算术编码器621和第二算术编码器622可以为多量化(Multiple Quantization,MQ)算术编码器。MQ算术编码器包括但不限于自适应算术编码器(context-based adaptive arithmetic coding)和传统的算术编码器。Wherein, the first arithmetic encoder 621 and the second arithmetic encoder 622 may be multiple quantization (MQ) arithmetic encoders. MQ arithmetic encoders include, but are not limited to, context-based adaptive arithmetic coding and traditional arithmetic encoders.
算术编码器进行编码时,信源符号序列连续的进入编码器,通过编码器的运算得到连续的输出。算术编码是将一条信源符号序列映射成一条码序列(也称为码字)。When the arithmetic encoder performs encoding, the source symbol sequence enters the encoder continuously, and the continuous output is obtained through the operation of the encoder. Arithmetic coding is to map a source symbol sequence into a code sequence (also called a codeword).
下面对传统的算术编码器的工作原理进行说明。The working principle of the traditional arithmetic encoder is described below.
传统的算术编码器将一条信源信息序列映射到[0,1)区间中的一个子区间,这种映射是一种一一对应关系,以保证唯一译码,然后取这个子区间内的一点所代表的数值作为码字。The traditional arithmetic encoder maps a source information sequence to a sub-interval in the [0, 1) interval. This mapping is a one-to-one correspondence to ensure unique decoding, and then take a point in this sub-interval The value represented is used as a codeword.
举例来说,假设信源符号为{A,B,C,D},且这些符号的概率分别为{0.1,0.4,0.2,0.3},根据这些概率可把间隔[0,1]分成4个子间隔:符号A对应的[0,0.1),符号B对应的[0.1,0.5),符号C对应的[0.5,0.7)以及符号D对应的[0.7,1]。如果二进制消息序列的输入为:CADACDB。编码时首先输入的符号是C,其属于的编码范围是[0.5,0.7]。由于消息中第二个符号A的编码范围是[0,0.1],因此它的间隔就取[0.5,0.7]的第一个十分之一作为新间隔[0.5,0.52]。依此类推,编码第3个符号D时取新间隔为[0.514,0.52],编码第4个符号A时,取新间隔为[0.514,0.5146],依次类推。消息的编码输出可以是最后一个间隔中的任意数。For example, suppose that the source symbols are {A, B, C, D}, and the probabilities of these symbols are {0.1, 0.4, 0.2, 0.3} respectively. According to these probabilities, the interval [0, 1] can be divided into 4 sub Interval: [0, 0.1) for symbol A, [0.1, 0.5) for symbol B, [0.5, 0.7) for symbol C, and [0.7, 1] for symbol D. If the input of the binary message sequence is: CADACDB. When encoding, the first input symbol is C, and the encoding range it belongs to is [0.5, 0.7]. Since the coding range of the second symbol A in the message is [0, 0.1], its interval takes the first tenth of [0.5, 0.7] as the new interval [0.5, 0.52]. By analogy, the new interval is [0.514, 0.52] when encoding the third symbol D, and the new interval is [0.514, 0.5146] when encoding the fourth symbol A, and so on. The encoded output of the message can be any number in the last interval.
传统的算术编码器的算术编码过程均建立在已知各个符号概率的基础上。只有已知各符号概率才能根据其划分概率区间。The arithmetic coding process of the traditional arithmetic encoder is based on the known probability of each symbol. Only when the probability of each symbol is known can the probability interval be divided according to it.
下面对自适应二进制算术编码器的工作原理进行说明。The working principle of the adaptive binary arithmetic encoder is described below.
自适应算术编码在一次扫描中可完成两个过程,即概率模型建立过程和扫描编码过程。自适应算术编码在扫描符号序列前并不知道各符号的统计概率,这时假定每个符号的概率相等,并平均分配区间[0,1]。然后在扫描符号序列的过程中不断调整各个符号的概率。Adaptive arithmetic coding can complete two processes in one scan, namely the probability model establishment process and the scan coding process. Adaptive arithmetic coding does not know the statistical probability of each symbol before scanning the symbol sequence. At this time, it is assumed that the probability of each symbol is equal, and the interval [0, 1] is evenly allocated. Then continuously adjust the probability of each symbol in the process of scanning the symbol sequence.
举例来说,假定要编码的是一个来自四符号信源{A,B,C,D}的五个符号组成的符号序列:ABBCD。编码开始前首先将区间[0,1]等分为四个子区间,分别对应A,B,C,D四个符号。扫描符号序列,第一个符号是A,对应区间为[0,0.25],然后改变各个符号的统计概率,符号A的概率为2/5,符号B的概率为1/5,符号C的概率为1/5,符号D的概率为1/5,再将区间[0,0.25]等分为五份,A占两份,其余各占一份。接下来对第二个符号B进行编码,对应的区间为[0.1,0.15],再重复前面的概率调整和区间划分过程。For example, suppose that what is to be encoded is a symbol sequence consisting of five symbols from a four-symbol source {A, B, C, D}: ABBCD. Before encoding starts, the interval [0,1] is divided into four sub-intervals, corresponding to the four symbols A, B, C, and D. Scan the symbol sequence, the first symbol is A, the corresponding interval is [0,0.25], and then change the statistical probability of each symbol, the probability of symbol A is 2/5, the probability of symbol B is 1/5, and the probability of symbol C The probability of symbol D is 1/5, and the interval [0,0.25] is divided into five equal parts, A occupies two parts, and the rest occupies one part each. Next, encode the second symbol B, the corresponding interval is [0.1,0.15], and then repeat the previous probability adjustment and interval division process.
自适应算术编码首先需要知道信源发出每个符号的概率大小,然后再扫描符号序列,依次分割相应的区间,最终得到符号序列所对应的码字。Adaptive arithmetic coding first needs to know the probability of each symbol sent by the source, and then scan the symbol sequence, divide the corresponding interval in turn, and finally obtain the codeword corresponding to the symbol sequence.
从算术编码器的输入来说,算术编码器的输入可以包括位平面编码单元61生成的待编码位D和上下文矢量(CX)。CX是位平面编码单元61根据邻域相关性归纳而来的概率统计模型,共有l9种。即对于不同的CX,符号概率不相同。本实施例中,第一算术编码器621和第二算术编码器621均可为自适应算术编码器,即第一算术编码器621和第二算术编码器621均可以采用CX确定符号概率。From the input of the arithmetic encoder, the input of the arithmetic encoder may include the to-be-encoded bit D and the context vector (CX) generated by the bit-plane encoding unit 61. CX is a probability statistical model summarized by the bit-plane coding unit 61 based on neighborhood correlation, and there are 19 types in total. That is, for different CX, the symbol probability is not the same. In this embodiment, both the first arithmetic encoder 621 and the second arithmetic encoder 621 can be adaptive arithmetic encoders, that is, both the first arithmetic encoder 621 and the second arithmetic encoder 621 can use CX to determine the symbol probability.
继续参见图3,第一通道611和第二通道612均可包括SPP、MRP以及CUP,且SPP、MRP以及CUP均对应至少一个编码器。Continuing to refer to FIG. 3, the first channel 611 and the second channel 612 may each include SPP, MRP, and CUP, and SPP, MRP, and CUP all correspond to at least one encoder.
利用标准协议指定的选择模式(selective mode)算法的特点,前4层位平面和后续位平面的概率是打断的。因此考虑提前把4层位平面的显著性状态提取出来,这样后续位平面就可以开始扫描编码工作了。本申请中,将前4位平面设置为在第一通道611上进行编码,将后续位平面设置在第二通道612上进行编码。即所述位平面编码单元61包括所述第一通道611和所述第二通道612,所述第一通道611和所述第二通道612将码块的多个位平面划分为两组位平面,并对所述两组位平面并行地进行位平面编码,得到所述码块的码流。Using the characteristics of the selective mode algorithm specified by the standard protocol, the probability of the first 4-layer bit plane and the subsequent bit plane is interrupted. Therefore, consider extracting the saliency state of the 4-level bit-plane in advance, so that the subsequent bit-plane can start scanning and encoding. In this application, the first 4 bit planes are set to be encoded on the first channel 611, and the subsequent bit planes are set to be encoded on the second channel 612. That is, the bit plane encoding unit 61 includes the first channel 611 and the second channel 612, and the first channel 611 and the second channel 612 divide the multiple bit planes of the code block into two groups of bit planes. And perform bit-plane coding on the two sets of bit-planes in parallel to obtain the code stream of the code block.
此外,由于在编码图像比特位深较大的情况下(比如12bit/pixel或14bit/pixel或16bit/pixel),码块的后续位平面将会很多(远多于4,即第一通道611处理的位平面数目)。基于这种考虑,本申请可以将第二通道312的计算能力设置为SPP、MRP、CUP三个扫描通道并行,可选地,三个扫描通道并行针对同一位平面进行扫描,而第一通道611只能是SPP、MRP两个扫描通道并行或CUP单扫描通道。例如,对应处理一个位平面,第一通道611的处理速率与第二通道612的处理速率的比值为1:2(除了最高位平面只进行CUP扫描外),由此,能够平衡两条通路的处理速率,并降低第一通道611的并行度,也有助于减少实现的硬件资源和峰值功耗。In addition, since the bit depth of the encoded image is large (such as 12bit/pixel or 14bit/pixel or 16bit/pixel), the subsequent bit planes of the code block will be many (far more than 4, that is, the first channel 611 processing The number of bit planes). Based on this consideration, the present application can set the computing power of the second channel 312 to the three scan channels of SPP, MRP, and CUP in parallel. Optionally, the three scan channels scan for the same bit plane in parallel, and the first channel 611 It can only be SPP and MRP two scanning channels in parallel or CUP single scanning channel. For example, corresponding to processing a bit plane, the ratio of the processing rate of the first channel 611 to the processing rate of the second channel 612 is 1:2 (except that the highest bit plane only performs CUP scanning), thus, the two channels can be balanced. Processing rate and reducing the parallelism of the first channel 611 also help to reduce the hardware resources and peak power consumption of the implementation.
具体而言,第一通道611处理码块的前4位平面时,第一个时刻被配置为利用CUP扫描最高位平面,第二个时刻被配置为利用SPP+MRP扫描第2个位平面(其中由于显著信息s的更新和传递,SPP和MRP需要错开若干个时钟周期,例如2个时钟周期),第三个时刻被配置为利用CUP扫描第2个位平面,第四个时刻被配置为利用SPP+MRP扫描第3个位平面,第五个时刻被配置为利用CUP扫描第3个位平面,依次类推。Specifically, when the first channel 611 processes the first 4 bit planes of the code block, the first time is configured to scan the highest bit plane using CUP, and the second time is configured to scan the second bit plane using SPP+MRP ( Among them, due to the update and transfer of the significant information s, SPP and MRP need to be staggered by several clock cycles, such as 2 clock cycles), the third time is configured to scan the second bit plane with CUP, and the fourth time is configured to Use SPP+MRP to scan the third bit plane, the fifth time is configured to use CUP to scan the third bit plane, and so on.
应理解,上述“一个时刻”可以指一个扫描通道对一个位平面扫描处理完成的时间,以4bit/cycle的位平面扫描速率为例,以位平面大小为32x32bit为例,一个时刻即256cycle(实际上还需要考虑上数据调度、流水级若干cycle)。It should be understood that the "one moment" mentioned above can refer to the time for a scan channel to complete the scanning process of a bit plane. Taking the bit plane scan rate of 4bit/cycle as an example, taking the bit plane size of 32x32bit as an example, one moment is 256 cycle (actually It is also necessary to consider data scheduling and several cycles of pipeline).
第二通道612被配置为用于处理后续的位平面,其中,第一个时刻被配置为利用SPP+MRP+CUP扫描第5个位平面(其中由于显著信息s的更新和 传递,SPP与MRP+CUP需要错开若干个时钟周期,例如2个时钟周期),第二个时刻被配置为利用SPP+MRP+CUP扫描第6个位平面,第三个时刻被配置为利用SPP+MRP+CUP扫描第7个位平面,依次类推直到需扫描编码的最低位平面。The second channel 612 is configured to process subsequent bit planes, where the first time is configured to scan the fifth bit plane using SPP+MRP+CUP (wherein due to the update and transfer of the significant information s, SPP and MRP +CUP needs to be staggered by several clock cycles, such as 2 clock cycles), the second time is configured to scan the 6th bit plane with SPP+MRP+CUP, and the third time is configured to scan with SPP+MRP+CUP The seventh bit plane, and so on until the lowest bit plane that needs to be scanned and coded.
本申请实施例中,第一通道611可以通过配置成为SPP或者MRP或者CUP。即所述第一通道611也可以被称为x通道(pass),其中x表示SPP或者MRP或者CUP。第一通道611可以包括或配置有1个RLC编码器、4个MRC编码器、4个ZC编码器以及4个SC编码器。由此,不仅能够实现对经过所述第一通道611的位平面进行位平面编码,而且能够有效简化硬件结构,进而降低成本。In the embodiment of the present application, the first channel 611 may be configured as SPP, MRP, or CUP. That is, the first channel 611 may also be called an x-pass (pass), where x represents SPP, MRP, or CUP. The first channel 611 may include or be configured with 1 RLC encoder, 4 MRC encoders, 4 ZC encoders, and 4 SC encoders. As a result, not only can bit-plane coding be performed on the bit-plane passing through the first channel 611, but also the hardware structure can be effectively simplified, thereby reducing the cost.
换句话说,第一通道611可以包括SPP、MRP以及CUP。此时SPP和CUP配置有共用的4个ZC编码器以及4个SC编码器,MRP配置有4个MRC编码器,此外CUP还配置有一个RLC编码器。本实施例中,SPP和CUP通过共用4个ZC编码器以及4个SC编码器,能够简化EBCOT编码模块742的硬件结构,进一步地,能够保证EBCOT编码模块742中各个编码器的利用率。In other words, the first channel 611 may include SPP, MRP, and CUP. At this time, SPP and CUP are configured with 4 ZC encoders and 4 SC encoders in common, MRP is configured with 4 MRC encoders, and CUP is also configured with an RLC encoder. In this embodiment, SPP and CUP share 4 ZC encoders and 4 SC encoders, which can simplify the hardware structure of the EBCOT encoding module 742, and further, can ensure the utilization of each encoder in the EBCOT encoding module 742.
第二通道612也可以称为lazy pass,其可以包括SPP、MRP以及CUP,其中,SPP可以包括或配置有4个ZC编码器以及4个SC编码器,MRP可以包括或配置有4个MRC编码器,CUP可以包括或配置有1个RLC编码器、4个ZC编码器以及4个SC编码器。The second channel 612 can also be called lazy pass, which can include SPP, MRP, and CUP, where SPP can include or be configured with 4 ZC encoders and 4 SC encoders, and MRP can include or be configured with 4 MRC encoders. CUP can include or be configured with 1 RLC encoder, 4 ZC encoders, and 4 SC encoders.
EBCOT编码模块742通过所述第一通道611和所述第二通道612对码块的位平面进行编码时,所述第一通道611可以同时对一个位平面进行SPP、MRP扫描编码,或者对位平面进行CUP扫描编码,所述第二通道612可以同时对一个位平面进行SPP、MRP、CUP扫描编码。When the EBCOT encoding module 742 encodes the bit plane of the code block through the first channel 611 and the second channel 612, the first channel 611 can simultaneously perform SPP, MRP scan encoding, or bit alignment on a bit plane The plane performs CUP scan coding, and the second channel 612 can simultaneously perform SPP, MRP, and CUP scan coding on a bit plane.
即通过第一通道611和第二通道612并行处理码块位平面,能够有效提高编码效率。That is, the code block bit plane is processed in parallel through the first channel 611 and the second channel 612, which can effectively improve the coding efficiency.
当然,可替代地,在其他实施例中,第一通道611和第二通道612还可以包括或配置有其它数量的ZC编码器、SC编码器以及MRC编码器,本申请对此不做具体限定。Of course, alternatively, in other embodiments, the first channel 611 and the second channel 612 may also include or be configured with other numbers of ZC encoders, SC encoders, and MRC encoders, which are not specifically limited in this application. .
综上所述,本申请实施例中,通过第一通道611和第二通道612可以并行的对码块的位平面进位平面编码,能够有效提高编码效率。此外,分别配 置所述第一通道611中的编码器和所述第二通道612中的编码器,能够简化EBCOT编码模块742的硬件结构,进一步地,能够保证EBCOT编码模块742中各个编码器的利用率。In summary, in the embodiment of the present application, the bit plane carry plane of the code block can be coded in parallel through the first channel 611 and the second channel 612, which can effectively improve the coding efficiency. In addition, separately configuring the encoder in the first channel 611 and the encoder in the second channel 612 can simplify the hardware structure of the EBCOT encoding module 742, and further, can ensure the performance of each encoder in the EBCOT encoding module 742. Utilization rate.
继续参见图3,位平面编码单元61还可以包括分发单元613。Continuing to refer to FIG. 3, the bit-plane encoding unit 61 may further include a distributing unit 613.
分发单元613可以用于将编码通道的输出结果分配给相应的算术编码器和其它单元模块。例如,分发单元613可以用于将第一通道611的上下文信息和码流分配给第一算术编码器621,并将第二通道612的上下文信息和码流分配给第二算术编码器622,和/或将第二通道612的输出的上下文信息和码流直接分配给码流组织单元63。The distributing unit 613 may be used to distribute the output result of the encoding channel to the corresponding arithmetic encoder and other unit modules. For example, the distribution unit 613 may be used to distribute the context information and code stream of the first channel 611 to the first arithmetic encoder 621, and distribute the context information and code stream of the second channel 612 to the second arithmetic encoder 622, and /Or directly distribute the output context information and code stream of the second channel 612 to the code stream organizing unit 63.
码流组织单元63可以用于对算术编码单元62输出的码流进行组织,并将组织后的码流输出给存储指令生成单元651,以便存储指令生成单元651生成存储指令,并基于该存储指令将码流组织单元63输出的码流存储至第三存储器652和第四存储器653。The code stream organizing unit 63 may be used to organize the code stream output by the arithmetic coding unit 62, and output the organized code stream to the storage instruction generating unit 651, so that the storage instruction generating unit 651 generates a storage instruction based on the storage instruction The code stream output by the code stream organizing unit 63 is stored in the third memory 652 and the fourth memory 653.
在本申请中,最高位平面以及最高位平面之下的k个平面可以通过第一通道611进行位平面编码,剩余的位平面可以通过第二通道622进行位平面编码。其中k可以是小于n的任一正整数,n是码块对应的位平面的总数。In this application, the highest bit plane and the k planes below the highest bit plane can be bit-plane encoded through the first channel 611, and the remaining bit planes can be bit-plane encoded through the second channel 622. Where k can be any positive integer less than n, and n is the total number of bit planes corresponding to the code block.
最高位平面可以是码块(block)中所有系数组成的第一个非全0的比特平面。例如,根据标准规定的选择编码模式(select encode mode),前4个位平面用于算术编码的概率会向后面的位平面传递,后面的位平面用于算术编码的概率不传递,本申请可以利用这个特点为前4位平面和后续位平面分别部署一套硬件,并行处理码块的位平面,以提高编码速率。即上述k等于3。当然,本申请并不限于此。在其他实施例中,所述k也可以为其它正整数。The highest bit plane may be the first non-zero bit plane composed of all coefficients in the code block. For example, according to the select encoding mode specified by the standard, the probability of the first 4 bit planes used for arithmetic coding will be transferred to the following bit planes, and the probability of the latter bit planes used for arithmetic coding will not be transferred. This application can Use this feature to deploy a set of hardware for the first 4 bit planes and subsequent bit planes to process the bit planes of the code block in parallel to increase the coding rate. That is, the above k is equal to 3. Of course, this application is not limited to this. In other embodiments, the k may also be other positive integers.
图4是本申请的位平面和编码通道之间的关系的示意性结构图。Fig. 4 is a schematic structural diagram of the relationship between the bit plane and the coding channel of the present application.
如图4所示,第n-4个位平面至第n-1个位平面通过第一通道611进行位平面编码,第n-5个位平面至第0个位平面通过第二通道612进行位平面编码。由于第一通道611和第二通道612分别对应算术编码单元62中的不同编码器,因此,能够对不同位平面进行不同的算术编码。As shown in FIG. 4, the n-4th bit plane to the n-1th bit plane are subjected to bit plane coding through the first channel 611, and the n-5th bit plane to the 0th bit plane are performed through the second channel 612. Bit plane coding. Since the first channel 611 and the second channel 612 respectively correspond to different encoders in the arithmetic coding unit 62, different arithmetic coding can be performed on different bit planes.
具体而言,第一通道611对应的第一算术编码器621的概率是逐个位平面逐个通道(pass)传递的,其编码效率好;第二通道612对应的第二算术编码器622的概率是每个位平面每个pass间都是相互独立的,即通过部署多 路并行位平面编码器+算术编码器来大大提升编码速度,其编码效率较差(由于概率不传递,第二算术编码器622的码流的压缩率小于第一算术编码器621)。Specifically, the probability of the first arithmetic encoder 621 corresponding to the first channel 611 is transmitted bit plane by channel (pass), and its coding efficiency is good; the probability of the second arithmetic encoder 622 corresponding to the second channel 612 is Each bit plane and each pass are independent of each other, that is, by deploying multiple parallel bit plane encoders + arithmetic encoders to greatly improve the encoding speed, the encoding efficiency is poor (because the probability is not transmitted, the second arithmetic encoder The compression rate of the code stream of 622 is lower than that of the first arithmetic encoder 621).
在本申请实施例中,通过逐个位平面和逐个通道的传递重要的(例如前4个)位平面的用于算术编码的概率,不传递不重要的位平面(例如后面的位平面)用于算术编码的概率,能够同时兼顾编码速度和编码效率。In the embodiments of the present application, the probability of important (for example, the first 4) bit-planes for arithmetic coding is transmitted bit-plane and channel-by-channel, and the unimportant bit-planes (for example, the latter bit-plane) are not transmitted for arithmetic coding. The probability of arithmetic coding can take into account both coding speed and coding efficiency.
需要说明的是,上述数字仅为一种示例,不应理解为对本申请的限制。换句话说,第一通道611可以用于编码预设数量的位平面,第二通道612可以用于编码除预设数量的位平面之外的平面,其中预设数量的位平面之间用于算术编码的概率发送传递,其它位平面之间的用于算术编码概率不发生传递。It should be noted that the above-mentioned number is only an example and should not be construed as a limitation of the application. In other words, the first channel 611 can be used to encode a preset number of bit-planes, and the second channel 612 can be used to encode planes other than the preset number of bit-planes. The probability of arithmetic coding is sent and passed, and the probability of arithmetic coding between other bit planes is not passed.
请继续参见图4,所述算术编码单元62可以包括第一算术编码器621和第二算术编码器622。其中,所述第一算术编码器621可以被配置为其用于算术编码的概率是逐个位平面逐个通道(例如按照SPP、MRP以及CUP的顺序)传递的,其编码效率高,但是编码速度过慢。所述第二编码器622可以被配置为其用于算术编码的概率在每个位平面以及每个通道(例如SPP、MRP以及CUP)间都是相互独立的,由此可以通过部署多路并行位平面编码器+算术编码器提升其编码速度,但其编码效率较差(因为概率不传递,码流的压缩率没有所述第一算术编码器612的压缩率大)。Please continue to refer to FIG. 4, the arithmetic encoding unit 62 may include a first arithmetic encoder 621 and a second arithmetic encoder 622. Wherein, the first arithmetic encoder 621 may be configured to transmit the probability of arithmetic coding bit-plane-by-channel (for example, in the order of SPP, MRP, and CUP). The coding efficiency is high, but the coding speed is too high. slow. The second encoder 622 can be configured such that the probability for arithmetic coding is independent of each bit plane and each channel (for example, SPP, MRP, and CUP), so that multiple parallel channels can be deployed. The bit-plane encoder+arithmetic encoder improves its encoding speed, but its encoding efficiency is poor (because the probability is not transmitted, the compression rate of the code stream is not as large as that of the first arithmetic encoder 612).
换句话说,所述第一算术编码器621配置为由所述第一通道611编码的多个位平面之间传递用于算术编码的概率,且所述第一通道611中的通道之间传递用于算术编码的概率;所述第二算术编码器622配置为由所述第二通道612编码的多个位平面之间用于算术编码的概率相互独立,且所述第二通道612中的通道之间的用于算术编码的概率相互独立。例如,所述第一算术编码器621配置为由所述第一通道611进行位平面编码的前4个位平面用于算术编码的概率传递;所述第二算术编码器622配置为由所述第二通道612进行位平面编码的后面的位平面用于算术编码的概率不传递。In other words, the first arithmetic encoder 621 is configured to transfer probabilities for arithmetic coding between the multiple bit planes encoded by the first channel 611, and transfer the probabilities between channels in the first channel 611. The probability used for arithmetic coding; the second arithmetic encoder 622 is configured such that the probabilities used for arithmetic coding among the multiple bit planes encoded by the second channel 612 are independent of each other, and the The probabilities used for arithmetic coding between channels are independent of each other. For example, the first arithmetic encoder 621 is configured to use the first 4 bit-planes of the first channel 611 to perform bit-plane coding for probability transfer of arithmetic coding; the second arithmetic encoder 622 is configured to be used by the The second channel 612 performs bit-plane coding with a probability that the subsequent bit-plane is used for arithmetic coding is not transmitted.
本申请实施例中,通过结合所述第一算术编码器611和所述第二算术编码器612,形成并行编码器结构(即所述算术编码器62),以同时兼顾编码速度和编码效率。In the embodiment of the present application, by combining the first arithmetic encoder 611 and the second arithmetic encoder 612, a parallel encoder structure (that is, the arithmetic encoder 62) is formed, so as to take into account both encoding speed and encoding efficiency.
在一些实施例中,tier-1编码单元6还可以设置有一个或多个缓存(片 上缓存),用于存储各个单元模块输出的编码结果。In some embodiments, the tier-1 encoding unit 6 may also be provided with one or more buffers (on-chip buffers) for storing the encoding results output by each unit module.
例如,分别为第一通道611和第二通道612分别设置缓存(片上缓存),用于存储经所述第一通道611和所述第二通道612编码后的码流。For example, the first channel 611 and the second channel 612 are respectively provided with buffers (on-chip buffers) for storing code streams encoded by the first channel 611 and the second channel 612.
请继续参见图4,分发单元613内部或输出端可以还可以设置有第一通道611对应的xP先进先出(First Input First Output,FIFO)存储器,xPFIFO存储器可以是第一通道611中的SPP编码器对应的缓存,也可以是第一通道611中的CUP编码器对应的缓存,用于缓存SPP编码器和CUP编码器的编码结果,即SPP编码器和CUP编码器输出的上下文和判决信息。如前文所述,由于同一时刻所述第一通道611用作SPP+MRP或者CUP,因此SPP编码器和CUP编码器可以共用一个缓存,进而不仅能够有效简化tier-1编码单元6结构,而且提高了缓存的利用率。Please continue to refer to FIG. 4, the distribution unit 613 may also be provided with an xP first input first output (FIFO) memory corresponding to the first channel 611 inside or at the output end, and the xPFIFO memory may be the SPP code in the first channel 611 The buffer corresponding to the SPP encoder may also be the buffer corresponding to the CUP encoder in the first channel 611 for buffering the encoding results of the SPP encoder and the CUP encoder, that is, the context and decision information output by the SPP encoder and the CUP encoder. As mentioned above, since the first channel 611 is used as SPP+MRP or CUP at the same time, the SPP encoder and the CUP encoder can share a buffer, which not only can effectively simplify the structure of the tier-1 encoding unit 6, but also improve The utilization of the cache is improved.
又例如,分发单元613内部或输出端可以还可以设置有第一通道611中MRP编码器对应的MR随机存取器(random access memory,RAM),用于缓存MRP编码器的编码结果。For another example, the distribution unit 613 may also be provided with an MR random access memory (RAM) corresponding to the MRP encoder in the first channel 611 inside or at the output terminal, for buffering the encoding result of the MRP encoder.
需要说明的是,为MRP编码器设置对应的MR RAM,可以有效控制分发单元613的体积,避免分发单元613体积过大。当然,本申请实施例并不限于此,在其他可替代实施例中,也可以为MRP编码器设置对应的FIFO,以便同时读写MRP编码器的编码结果。具体地,可以根据实际需要确定缓存的类型。It should be noted that setting the corresponding MR RAM for the MRP encoder can effectively control the volume of the distribution unit 613 and avoid the distribution unit 613 from being too large. Of course, the embodiment of the present application is not limited to this. In other alternative embodiments, a corresponding FIFO may also be set for the MRP encoder, so as to read and write the encoding result of the MRP encoder at the same time. Specifically, the type of cache can be determined according to actual needs.
即上文或下文中涉及的FIFO可以替换为RAM,或者说上文或下文中涉及的RAM也可以替换为FIFO,本申请对此不做具体限定。That is, the FIFO mentioned above or below can be replaced with RAM, or the RAM mentioned above or below can also be replaced with FIFO, which is not specifically limited in this application.
又例如,分发单元613内部或输出端可以还可以设置有第二通道612中MRP编码器对应的MP RAM,用于缓存MRP编码器的编码结果。进一步地,MP RAM还可以用于缓存第二通道612中SPP编码器的编码结果。For another example, an MP RAM corresponding to the MRP encoder in the second channel 612 may also be provided in the distribution unit 613 or at the output end, for buffering the encoding result of the MRP encoder. Further, the MP RAM can also be used to buffer the encoding result of the SPP encoder in the second channel 612.
又例如,分发单元613内部或输出端可以还可以设置有第二通道612中CUP编码器对应的CP FIFO,用于缓存CUP编码器的编码结果。For another example, the distribution unit 613 may also be provided with a CP FIFO corresponding to the CUP encoder in the second channel 612 inside or at the output end, for buffering the encoding result of the CUP encoder.
继续参见图4,分发单元613还可以包括原始编码器6131,与第二通道612中的SPP编码器相连,用于接收第二通道612中的SPP编码器输出的码流,并对第二通道612中的SPP编码器输出的码流进行原始(raw)编码后,输出至码流组织单元63。例如,原始编码器6131对第二通道612中的SPP编码器输出的码流进行补位和/或打包后,发送至码流组织单元63,以便码 流组织单元63对一个码块对应的多个码流进行码流组织。4, the distribution unit 613 may also include an original encoder 6131, which is connected to the SPP encoder in the second channel 612, and is used to receive the code stream output by the SPP encoder in the second channel 612, and perform the The code stream output by the SPP encoder in 612 is raw coded and output to the code stream organization unit 63. For example, the original encoder 6131 supplements and/or packs the code stream output by the SPP encoder in the second channel 612, and then sends it to the code stream organizing unit 63, so that the code stream organizing unit 63 calculates the number of codes corresponding to one code block. Each code stream is organized into code streams.
位平面编码指SPP/MRP/CUP编码,位平面扫描、编码的结果是上下文和判决信息。位平面编码单元61将编码结果发送至算术编码单元62或者原始编码器(raw coder)6131,由算术编码单元62或者原始编码器6131进行编码。对于每个位平面,如图5所示,位平面编码单元61可以以每4行为单位将其划分为一个条带(stripe),按照从上到下的顺序扫描条带,按照从左到右的顺序扫描每个条带内的比特,从最高位平面开始,依次编码到最低位平面。Bit-plane coding refers to SPP/MRP/CUP coding. The result of bit-plane scanning and coding is context and decision information. The bit-plane encoding unit 61 sends the encoding result to the arithmetic encoding unit 62 or the raw encoder 6131, and the arithmetic encoding unit 62 or the raw encoder 6131 performs encoding. For each bit plane, as shown in FIG. 5, the bit plane encoding unit 61 can divide it into a stripe every 4 rows, and scan the stripe in the order from top to bottom, from left to right. The order of scanning the bits in each strip, starting from the highest bit plane, and then coding to the lowest bit plane.
具体地,首先进行SPP扫描、编码,然后进行MRP扫描、编码,最后进行CUP扫描、编码,为了加快速度,可以部署三通道(SPP、MRP和CUP)并行扫描、编码。Specifically, SPP scanning and coding are performed first, then MRP scanning and coding are performed, and finally CUP scanning and coding are performed. In order to speed up, three channels (SPP, MRP and CUP) can be deployed in parallel scanning and coding.
SPP、MRP和CUP并行扫描、编码时,均可以基于位平面的显著性信息等编码状态,以及待扫描系数的邻域系数的状态进行编码,其中,对待扫描系数进行扫描编码后得到的编码结果即为SPP编码器、MRP编码器和CUP编码器输出的上下文和判决信息。待扫描的系数可以通过其周围的8个邻域的情况就确定这个系数的邻域系数的状态。其中,这8个邻域可以被分为3类:水平(h),垂直(v)和对角线(d)。例如,如图6所示,假设系数P为待扫描系数,则系数P的8个邻域分别为D0、V0、D1、H0、H1、D2、V1以及D3。When SPP, MRP, and CUP are scanned and coded in parallel, they can be coded based on the coding state of the bit-plane's saliency information, and the state of the neighboring coefficients of the coefficient to be scanned. The coding result obtained after scanning and coding the coefficient to be scanned That is, the context and decision information output by the SPP encoder, MRP encoder and CUP encoder. The coefficient to be scanned can be used to determine the status of the neighborhood coefficient of the coefficient through the 8 neighborhoods around it. Among them, these 8 neighborhoods can be divided into 3 categories: horizontal (h), vertical (v) and diagonal (d). For example, as shown in FIG. 6, assuming that the coefficient P is the coefficient to be scanned, the eight neighborhoods of the coefficient P are D0, V0, D1, H0, H1, D2, V1, and D3.
需要注意的是,在SPP编码通道中如果系数变为显著,则显著状态立即更新为1。因此,SPP、MRP和CUP并行扫描、编码时,MRP和CUP扫描时间需要和SPP的扫描时间之间存在间隔。It should be noted that if the coefficient becomes significant in the SPP encoding channel, the significant status is immediately updated to 1. Therefore, when SPP, MRP and CUP are scanned and coded in parallel, there is a gap between the scanning time of MRP and CUP and the scanning time of SPP.
图7是本申请的SPP、MRP和CUP的扫描窗口的示例。Fig. 7 is an example of scanning windows of SPP, MRP and CUP of the present application.
如图7所示,以条带的一列为一个扫描窗口,SPP扫描第T+1个扫描窗口中的p4、p5、p6和p7时,MRP和CUP扫描第T个扫描窗口中的p1、p2、p3和p4,即MRP和CUP的扫描窗口T落后于SPP的扫描窗口T+1,以确保MRP和CUP进行扫描时,待扫描的系数已在SPP编码通道中进行了更新,进而保证MRP和CUP编码的正确性。As shown in Figure 7, taking one column of the stripe as a scanning window, when SPP scans p4, p5, p6, and p7 in the T+1 scan window, MRP and CUP scan p1, p2 in the T scan window , P3 and p4, that is, the scanning window T of MRP and CUP lags behind the scanning window T+1 of SPP to ensure that when MRP and CUP are scanning, the coefficients to be scanned have been updated in the SPP encoding channel, thereby ensuring that MRP and CUP The correctness of the CUP encoding.
在图7所示的扫描窗口中,SPP、MRP和CUP并行扫描、编码时,其扫描、编码顺序为p0、p1、p2、p3、p4、p5、p6、p7,…。其中p1的编码需要获知p0的重要性信息(p0为p1的顶上邻居),p2的编码需要获知p1 的重要性信息,依次类推,可以实现4bit/cycle速率的位平面编码,其逻辑最长的路径为p0-p3。In the scanning window shown in Figure 7, when SPP, MRP and CUP are scanned and coded in parallel, the scanning and coding sequence is p0, p1, p2, p3, p4, p5, p6, p7,.... The coding of p1 needs to know the importance information of p0 (p0 is the top neighbor of p1), and the coding of p2 needs to know the importance information of p1. By analogy, bit-plane coding at a rate of 4bit/cycle can be realized with the longest logic The path is p0-p3.
SPP、MRP和CUP均以条带的一列为一个扫描窗口,在一个扫描窗口内可以实现对4个系数(也称为比特)的扫描、编码。SPP, MRP, and CUP all use one column of a stripe as a scanning window, and the scanning and encoding of 4 coefficients (also called bits) can be realized in one scanning window.
但是由于在p1扫描结束时,已经可以确定p4的邻居,因此p4是可以和p2同时开始扫描编码的;类似地,在p2扫描结束时,可以确定p5的邻居,p5可以和p3同时开始扫描编码。But because at the end of p1 scan, the neighbors of p4 can already be determined, so p4 can start scanning and coding at the same time as p2; similarly, at the end of p2 scanning, the neighbors of p5 can be determined, and p5 can start scanning and coding at the same time as p3. .
由此可见,通过设置SPP、MRP和CUP的扫描窗口包括的系数的数量(例如6个),可以在不改变逻辑最长路径的情况下,进一步提高位平面编码速率(6bit/cycle)。It can be seen that by setting the number of coefficients (for example, 6) included in the scan windows of SPP, MRP, and CUP, the bit-plane coding rate (6bit/cycle) can be further increased without changing the logical longest path.
图8是本申请的SPP、MRP和CUP的扫描窗口的另一示例。Fig. 8 is another example of scanning windows of SPP, MRP and CUP of the present application.
如图8所示,由此,以条带的6个系数(也称为比特)为一个扫描窗口,以第T个扫描窗口为例,在p1扫描结束时,可以同时确定p4的邻居,进而可以同时对p4和p2进行扫描、编码;类似地,在p2扫描结束时,可以确定p5的邻居,进而可以同时对p5和p3进行扫描、编码。由此,实现6bit/cycle速率的位平面编码,其逻辑最长的路径仍然为p0-p3。As shown in Figure 8, therefore, taking the 6 coefficients (also called bits) of the stripe as a scanning window, taking the T-th scanning window as an example, at the end of the p1 scan, the neighbors of p4 can be determined at the same time, and then P4 and p2 can be scanned and coded at the same time; similarly, at the end of the p2 scan, the neighbors of p5 can be determined, and then p5 and p3 can be scanned and coded at the same time. As a result, the bit-plane coding at a rate of 6bit/cycle is realized, and the longest logical path is still p0-p3.
上文结合图3至图8,对本申请实施例提供的编码器7的结构进行了举例说明。下文结合图9,对本申请实施例提供的解码器8的结构进行举例说明。The structure of the encoder 7 provided in the embodiment of the present application has been exemplified above in conjunction with FIGS. 3 to 8. The structure of the decoder 8 provided by the embodiment of the present application will be illustrated below with reference to FIG. 9.
如图9所示,解码器8可以包括以下电路中的一种或多种:码流读取电路81,码流解析电路82,解码电路83,逆量化电路84,逆变换电路85,输出电路86。As shown in FIG. 9, the decoder 8 may include one or more of the following circuits: code stream reading circuit 81, code stream analysis circuit 82, decoding circuit 83, inverse quantization circuit 84, inverse transform circuit 85, output circuit 86.
码流读取电路81可用于读取待解码的码流。该码流读取电路81例如可以利用高级可扩展接口(advanced eXtensible interface,AXI)从外部存储器(如内存)中读取该待解码的码流。The code stream reading circuit 81 can be used to read the code stream to be decoded. The code stream reading circuit 81 can, for example, use an advanced extensible interface (AXI) to read the code stream to be decoded from an external memory (such as a memory).
码流解析电路82也可称为码流头部解析电路(header parser)。码流解析电路82可以解析码流中的各种类型的头部信息,并从中分离出与解码相关的参数和码流数据,供后级的解码电路83使用。The code stream parsing circuit 82 may also be referred to as a code stream header parser circuit (header parser). The code stream analysis circuit 82 can parse various types of header information in the code stream, and separate parameters and code stream data related to decoding therefrom for use by the decoding circuit 83 at a later stage.
解码电路83可以包括一个解码单元,也可以包括并行的多路解码单元(具体数量可以根据实际需要配置,如可以配置并行地8路解码单元)。解码电路83中的每个解码单元可以独立地对一个码块进行解码。The decoding circuit 83 may include one decoding unit or parallel multiple decoding units (the specific number can be configured according to actual needs, for example, 8 parallel decoding units can be configured). Each decoding unit in the decoding circuit 83 can independently decode a code block.
在某些实施例中,在解码电路83之前,还可以设置预处理电路。预处理电路可用于将码流解析电路82输出的解码参数、码流数据等分配给并行的多路解码单元。In some embodiments, before the decoding circuit 83, a preprocessing circuit may also be provided. The preprocessing circuit can be used to distribute the decoding parameters, code stream data, etc. output by the code stream analysis circuit 82 to parallel multiple decoding units.
在某些实施例中,在解码电路83之后,还可以设置后处理电路。后处理电路可用于对解码电路83输出的解码数据进行重新组织,并将组织好的数据输出给后级电路。In some embodiments, after the decoding circuit 83, a post-processing circuit may also be provided. The post-processing circuit can be used to reorganize the decoded data output by the decoding circuit 83 and output the organized data to the subsequent circuit.
逆量化电路84可用于对解码电路83解码得到的数据进行逆量化。The inverse quantization circuit 84 can be used to inverse quantize the data decoded by the decoding circuit 83.
逆变换电路85可用于对逆量化电路84输出的数据进行逆变换。逆变换的方式可以是离散小波逆变换。The inverse transform circuit 85 can be used to inversely transform the data output by the inverse quantization circuit 84. The inverse transform can be discrete wavelet inverse transform.
输出电路86可用于将逆变换电路85输出的数据写入到外部的存储器中。例如,可以通过AXI将逆变换电路85输出的数据写入到外部的存储器中。The output circuit 86 can be used to write the data output by the inverse conversion circuit 85 into an external memory. For example, the data output from the inverse conversion circuit 85 can be written into an external memory through AXI.
在某些实施例中,解码器8还可以包括软件配置接口。通过该软件配置接口可以配置或改变解码器8内部的寄存器中的信息,从而控制解码器8的解码方式。In some embodiments, the decoder 8 may also include a software configuration interface. The software configuration interface can configure or change the information in the internal registers of the decoder 8 to control the decoding mode of the decoder 8.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其他任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, it can be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid state disk (SSD)), etc. .
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结 合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this document can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, the functional units in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Should be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (35)

  1. 一种编码器,其特征在于,包括:An encoder, characterized in that it comprises:
    Tier-1编码单元,对待编码图像的图像块的码块进行tier-1编码,得到所述码块的码流;The Tier-1 coding unit performs tier-1 coding on the code block of the image block of the image to be coded to obtain the code stream of the code block;
    其中,所述Tier-1编码单元包括:Wherein, the Tier-1 coding unit includes:
    位平面编码单元,所述位平面编码单元包括第一通道和第二通道,所述第一通道和所述第二通道用于对所述码块的多个位平面并行地进行位平面编码,得到所述码块的码流;A bit-plane encoding unit, the bit-plane encoding unit includes a first channel and a second channel, the first channel and the second channel are used to perform bit-plane encoding on multiple bit-planes of the code block in parallel, Obtain the code stream of the code block;
    算术编码单元,用于对所述码块的码流进行算术编码,得到目标码流。The arithmetic coding unit is used to perform arithmetic coding on the code stream of the code block to obtain the target code stream.
  2. 根据权利要求1所述的编码器,其特征在于,所述第一通道用于对所述多个位平面中的最高位平面以及最高位平面之下的3个平面进行位平面编码,所述第二通道用于对所述多个位平面中除最高位平面以及最高位平面之下的3个平面之外的平面进行位平面编码。The encoder according to claim 1, wherein the first channel is used to perform bit plane encoding on the highest bit plane of the plurality of bit planes and three planes below the highest bit plane, and The second channel is used to perform bit plane encoding on the planes other than the highest bit plane and the three planes below the highest bit plane among the multiple bit planes.
  3. 根据权利要求1或2所述的编码器,其特征在于,所述第一通道和所述所述第二通道均配置有显著性传播通道SPP、幅度细化通道MRP以及清除通道CUP。The encoder according to claim 1 or 2, wherein the first channel and the second channel are both configured with a saliency propagation channel SPP, an amplitude refinement channel MRP, and a clear channel CUP.
  4. 根据权利要求3所述的编码器,其特征在于,所述第一通道中的SPP和MRP用于并行地进行扫描和编码,所述第一通道中的CUP用于单独地扫描和编码,且所述第二通道中SPP、MRP和CUP用于并行地进行扫描和编码。The encoder according to claim 3, wherein the SPP and MRP in the first channel are used for scanning and encoding in parallel, and the CUP in the first channel is used for scanning and encoding separately, and The SPP, MRP and CUP in the second channel are used to scan and encode in parallel.
  5. 根据权利要求3所述的编码器,其特征在于,所述第一通道配置有1个游程长度编码RLC编码器、4个幅度细化编码MRC编码器、4个显著性编码ZC编码器以及4个符号编码SC编码器,其中所述第一通道中的SPP和CUP共用所述4个ZC编码器以及4个SC编码器。The encoder according to claim 3, wherein the first channel is configured with 1 run-length encoding RLC encoder, 4 amplitude refinement encoding MRC encoders, 4 saliency encoding ZC encoders, and 4 A symbol encoding SC encoder, wherein the SPP and CUP in the first channel share the 4 ZC encoders and 4 SC encoders.
  6. 根据权利要求3所述的编码器,其特征在于,所述第一通道中的SPP、MRP和CUP以6个比特为单位进行扫描和编码,所述第二通道中的SPP、MRP和CUP以6个比特为单位进行扫描和编码。The encoder according to claim 3, wherein the SPP, MRP and CUP in the first channel are scanned and encoded in units of 6 bits, and the SPP, MRP and CUP in the second channel are Scanning and encoding are performed in units of 6 bits.
  7. 根据权利要求3所述的编码器,其特征在于,所述位平面编码单元还包括:The encoder according to claim 3, wherein the bit-plane coding unit further comprises:
    分发单元,用于将所述第一通道输出的编码结果和所述第二通道输出的 编码结果分发至所述算术编码单元。The distribution unit is configured to distribute the coding result output by the first channel and the coding result output by the second channel to the arithmetic coding unit.
  8. 根据权利要求7所述的编码器,其特征在于,所述分发单元还包括:The encoder according to claim 7, wherein the distributing unit further comprises:
    原始编码器,所述原始编码器用于对所述第二通道中的SPP输出的编码结果和MRP输出的结果进行打包。The original encoder, which is used to pack the encoding result of the SPP output and the result of the MRP output in the second channel.
  9. 根据权利要求7所述的编码器,其特征在于,所述分发单元包括:The encoder according to claim 7, wherein the distributing unit comprises:
    第一缓存,用于缓存所述第一通道输出的编码结果;The first buffer is used to buffer the encoding result output by the first channel;
    第二缓存,用于缓存所述第二通道输出的编码结果。The second buffer is used to buffer the encoding result output by the second channel.
  10. 根据权利要求9所述的编码器,其特征在于,所述第一缓存包括:The encoder according to claim 9, wherein the first buffer comprises:
    第三缓存,用于缓存所述第一通道中的SPP和CUP输出的编码结果;The third buffer is used to buffer the encoding results output by the SPP and CUP in the first channel;
    第四缓存,用于缓存所述第一通道中的MRP输出的编码结果。The fourth buffer is used to buffer the encoding result output by the MRP in the first channel.
  11. 根据权利要求9所述的编码器,其特征在于,所述第二缓存包括:The encoder according to claim 9, wherein the second buffer comprises:
    第五缓存,用于缓存所述第二通道中的MRP输出的编码结果;The fifth buffer is used to buffer the encoding result output by the MRP in the second channel;
    第六缓存,用于缓存所述第二通道中的CUP输出的编码结果。The sixth buffer is used to buffer the coding result output by the CUP in the second channel.
  12. 根据权利要求11所述的编码器,其特征在于,所述位平面编码单元还包括:The encoder according to claim 11, wherein the bit-plane coding unit further comprises:
    码流组织单元,所述码流组织单元用于对所述第五缓存输出的编码结果和由所述第六缓存输出的并经过算术编码的编码结果进行组织。A code stream organizing unit, the code stream organizing unit is used to organize the encoding result output by the fifth buffer and the encoding result output by the sixth buffer and subjected to arithmetic coding.
  13. 根据权利要求12所述的编码器,其特征在于,所述码流组织单元包括:The encoder according to claim 12, wherein the code stream organization unit comprises:
    第七缓存,用于缓存经过所述码流组织单元组织后的码流。The seventh buffer is used to buffer the code stream organized by the code stream organization unit.
  14. 根据权利要求1至13中任一项所述的编码器,其特征在于,所述算术编码单元包括:The encoder according to any one of claims 1 to 13, wherein the arithmetic coding unit comprises:
    第一算术编码器,用于根据所述第一通道输出的上下文信息对所述第一通道输出的码流进行算术编码;A first arithmetic encoder, configured to perform arithmetic coding on the code stream output by the first channel according to the context information output by the first channel;
    第二算术编码器,用于根据所述第二通道输出的上下文信息对所述第二通道输出的码流进行算术编码。The second arithmetic encoder is configured to perform arithmetic coding on the code stream output by the second channel according to the context information output by the second channel.
  15. 根据权利要求14所述的编码器,其特征在于,所述第一算术编码器配置为由所述第一通道进行位平面编码的前4个位平面用于算术编码的概率传递;所述第二算术编码器配置为由所述第二通道进行位平面编码的后面的位平面用于算术编码的概率不传递。The encoder according to claim 14, wherein the first arithmetic encoder is configured such that the first 4 bit planes of the bit plane encoding performed by the first channel are used for probability transfer of arithmetic encoding; The two arithmetic encoders are configured such that the probability that a subsequent bit plane is used for arithmetic coding by bit plane coding by the second channel is not transmitted.
  16. 根据权利要求1至15中任一项所述的编码器,其特征在于,所述编 码器还包括:The encoder according to any one of claims 1 to 15, wherein the encoder further comprises:
    后处理模块,用于存储经由所述码块经过编码形成的码流。The post-processing module is used to store the code stream formed by encoding the code block.
  17. 根据权利要求1至16中任一项所述的编码器,其特征在于,所述编码器还包括:The encoder according to any one of claims 1 to 16, wherein the encoder further comprises:
    预处理模块,用于将码块的小波系数分解成多个位平面,并将分解后的多个位平面重新组织后发送至所述位平面编码单元。The preprocessing module is used to decompose the wavelet coefficients of the code block into multiple bit planes, and reorganize the multiple bit planes after decomposing and send them to the bit plane coding unit.
  18. 一种编解码系统,其特征在于,包括:An encoding and decoding system, characterized in that it comprises:
    根据权利要求1至17中任一项所述的编码器;The encoder according to any one of claims 1 to 17;
    以及对应所述编码器的解码器。And a decoder corresponding to the encoder.
  19. 一种编码方法,其特征在于,包括:An encoding method, characterized by comprising:
    通过第一通道和第二通道对待编码图像的图像块的码块的多个位平面并行地进行位平面编码,得到所述码块的码流;Bit-plane encoding is performed in parallel on multiple bit-planes of the code block of the image block of the image to be coded through the first channel and the second channel to obtain the code stream of the code block;
    对所述码块的码流进行算术编码,得到目标码流。Perform arithmetic coding on the code stream of the code block to obtain the target code stream.
  20. 根据权利要求19所述的方法,其特征在于,所述通过第一通道和第二通道对待编码图像的图像块的码块的多个位平面并行地进行位平面编码,包括:The method according to claim 19, wherein said performing bit-plane coding in parallel on multiple bit-planes of the code block of the image block of the image to be coded through the first channel and the second channel comprises:
    通过所述第一通道对所述多个位平面中的最高位平面以及最高位平面之下的3个平面进行位平面编码;Performing bit plane encoding on the highest bit plane of the plurality of bit planes and the three planes below the highest bit plane through the first channel;
    通过所述第二通道对所述多个位平面中除最高位平面以及最高位平面之下的3个平面之外的平面进行位平面编码。Bit-plane coding is performed on the planes other than the highest bit plane and the three planes below the highest bit plane among the multiple bit planes through the second channel.
  21. 根据权利要求19或20所述的方法,其特征在于,所述第一通道和所述所述第二通道均配置有显著性传播通道SPP、幅度细化通道MRP以及清除通道CUP。The method according to claim 19 or 20, wherein the first channel and the second channel are both configured with a saliency propagation channel SPP, an amplitude refinement channel MRP, and a clear channel CUP.
  22. 根据权利要求21所述的方法,其特征在于,所述第一通道中的SPP和MRP用于并行地进行扫描和编码,所述第一通道中的CUP用于单独地扫描和编码,且所述第二通道中SPP、MRP和CUP用于并行地进行扫描和编码。The method according to claim 21, wherein the SPP and MRP in the first channel are used for scanning and encoding in parallel, and the CUP in the first channel is used for scanning and encoding individually, and the The SPP, MRP and CUP in the second channel are used to scan and encode in parallel.
  23. 根据权利要求21所述的方法,其特征在于,所述第一通道配置有1个游程长度编码RLC编码器、4个幅度细化编码MRC编码器、4个显著性编码ZC编码器以及4个符号编码SC编码器,其中所述第一通道中的SPP和CUP共用所述4个ZC编码器以及4个SC编码器。The method according to claim 21, wherein the first channel is configured with 1 run-length encoding RLC encoder, 4 amplitude refinement encoding MRC encoders, 4 saliency encoding ZC encoders, and 4 Symbol encoding SC encoder, wherein SPP and CUP in the first channel share the 4 ZC encoders and 4 SC encoders.
  24. 根据权利要求21所述的方法,其特征在于,所述第一通道中的SPP、MRP和CUP以6个比特为单位进行扫描和编码,所述第二通道中的SPP、MRP和CUP以6个比特为单位进行扫描和编码。The method according to claim 21, wherein the SPP, MRP and CUP in the first channel are scanned and coded in units of 6 bits, and the SPP, MRP and CUP in the second channel are scanned and encoded in units of 6 bits. Scanning and encoding are performed in units of bits.
  25. 根据权利要求21所述的方法,其特征在于,所述方法还包括:The method of claim 21, wherein the method further comprises:
    将所述第一通道输出的编码结果和所述第二通道输出的编码结果分发至所述算术编码单元。Distribute the encoding result output by the first channel and the encoding result output by the second channel to the arithmetic coding unit.
  26. 根据权利要求21所述的方法,其特征在于,所述方法还包括:The method of claim 21, wherein the method further comprises:
    对所述第二通道中的SPP输出的编码结果和MRP输出的结果进行打包。Packing the encoding result of the SPP output and the result of the MRP output in the second channel.
  27. 根据权利要求26所述的方法,其特征在于,所述方法包括:The method of claim 26, wherein the method comprises:
    将所述第一通道输出的编码结果缓存至第一缓存;Buffering the encoding result output by the first channel in the first buffer;
    将所述第二通道输出的编码结果缓存至第二缓存。The encoding result output by the second channel is buffered in the second buffer.
  28. 根据权利要求27所述的方法,其特征在于,所述第一缓存包括第三缓存和第四缓存;The method according to claim 27, wherein the first cache includes a third cache and a fourth cache;
    其中,所述将所述第一通道输出的编码结果缓存至第一缓存,包括:Wherein, the buffering the encoding result output by the first channel to the first buffer includes:
    将缓存所述第一通道中的SPP和CUP输出的编码结果缓存至所述第三缓存;Buffering the encoding results output by the SPP and CUP in the first channel in the third buffer;
    将所述第一通道中的MRP输出的编码结果缓存至所述第四缓存。Buffer the encoding result output by the MRP in the first channel to the fourth buffer.
  29. 根据权利要求28所述的方法,其特征在于,所述第二缓存包括第五缓存和第六缓存:The method according to claim 28, wherein the second cache includes a fifth cache and a sixth cache:
    其中,所述将所述第二通道输出的编码结果缓存至第二缓存,包括:Wherein, the buffering the encoding result output by the second channel to the second buffer includes:
    将所述第二通道中的MRP输出的编码结果缓存至所述第五缓存;Buffering the encoding result output by the MRP in the second channel to the fifth buffer;
    将所述第二通道中的CUP输出的编码结果缓存至所述第六缓存。Buffer the coding result output by the CUP in the second channel to the sixth buffer.
  30. 根据权利要求29所述的方法,其特征在于,所述方法还包括:The method according to claim 29, wherein the method further comprises:
    对所述第五缓存输出的编码结果和由所述第六缓存输出的并经过算术编码的编码结果进行组织。Organize the encoding result output by the fifth buffer and the encoding result output by the sixth buffer and subjected to arithmetic coding.
  31. 根据权利要求30所述的方法,其特征在于,所述方法包括:The method of claim 30, wherein the method comprises:
    缓存经过所述码流组织单元组织后的码流。Buffer the code stream organized by the code stream organization unit.
  32. 根据权利要求19至31中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 19 to 31, wherein the method further comprises:
    根据所述第一通道输出的上下文信息,利用第一算术编码器对所述第一通道输出的码流进行算术编码;Using a first arithmetic encoder to perform arithmetic coding on the code stream output by the first channel according to the context information output by the first channel;
    根据所述第二通道输出的上下文信息,利用第二算术编码器对所述第二通道输出的码流进行算术编码。According to the context information output by the second channel, a second arithmetic encoder is used to perform arithmetic coding on the code stream output by the second channel.
  33. 根据权利要求32所述的方法,其特征在于,所述第一算术编码器配置为由所述第一通道进行位平面编码的前4个位平面用于算术编码的概率传递;所述第二算术编码器配置为由所述第二通道进行位平面编码的后面的位平面用于算术编码的概率不传递。The method according to claim 32, wherein the first arithmetic encoder is configured to use the first 4 bit planes of the first channel to perform bit plane coding for probability transfer of arithmetic coding; the second The arithmetic encoder is configured such that the probability of the subsequent bit-plane encoded by the second channel for the arithmetic encoding is not transmitted.
  34. 根据权利要求19至33中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 19 to 33, wherein the method further comprises:
    存储经由所述码块经过编码形成的码流。Store a code stream formed by encoding through the code block.
  35. 根据权利要求19至34中任一项所述的方法,其特征在于,所述通过第一通道和第二通道对待编码图像的图像块的码块的多个位平面并行地进行位平面编码之前,所述方法还包括:The method according to any one of claims 19 to 34, wherein the multiple bit planes of the code block of the image block of the image to be coded through the first channel and the second channel are subjected to bit-plane encoding in parallel , The method further includes:
    将码块的小波系数分解成多个位平面,并将分解后的多个位平面重新组织后发送至所述位平面编码单元。The wavelet coefficients of the code block are decomposed into multiple bit planes, and the decomposed multiple bit planes are reorganized and sent to the bit plane coding unit.
PCT/CN2019/083781 2019-04-23 2019-04-23 Coder, coding system, and coding method WO2020215193A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/083781 WO2020215193A1 (en) 2019-04-23 2019-04-23 Coder, coding system, and coding method
CN201980005065.6A CN111316645A (en) 2019-04-23 2019-04-23 Encoder, encoding system and encoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/083781 WO2020215193A1 (en) 2019-04-23 2019-04-23 Coder, coding system, and coding method

Publications (1)

Publication Number Publication Date
WO2020215193A1 true WO2020215193A1 (en) 2020-10-29

Family

ID=71159516

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/083781 WO2020215193A1 (en) 2019-04-23 2019-04-23 Coder, coding system, and coding method

Country Status (2)

Country Link
CN (1) CN111316645A (en)
WO (1) WO2020215193A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953990A (en) * 2020-07-07 2020-11-17 西安万像电子科技有限公司 Encoding method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1398116A (en) * 2001-07-12 2003-02-19 三洋电机株式会社 Image coding appliance and image coding method
CN1564200A (en) * 2004-04-07 2005-01-12 西安交通大学 VLS realizing method for position plane coder of 0 redundancy coded clock
CN1564580A (en) * 2004-04-07 2005-01-12 西安交通大学 Channel parallel realizing method for down position plane coder under JPEG 2000 range associated mode
US7352903B2 (en) * 2004-08-17 2008-04-01 Pegasus Imaging Corporation Methods and apparatus for implementing JPEG 2000 encoding operations
US7760948B1 (en) * 2006-10-13 2010-07-20 Xilinx, Inc. Parallel coefficient bit modeling
CN101848311A (en) * 2010-02-21 2010-09-29 哈尔滨工业大学 JPEG2000 EBCOT encoder based on Avalon bus
CN102790882A (en) * 2012-07-25 2012-11-21 南京信息工程大学 Encoding method of remote sensing image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671177A (en) * 2004-03-19 2005-09-21 北京大学 JPEG2000 fraction bit-plane encoding method and circuit
US20110052087A1 (en) * 2009-08-27 2011-03-03 Debargha Mukherjee Method and system for coding images

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1398116A (en) * 2001-07-12 2003-02-19 三洋电机株式会社 Image coding appliance and image coding method
CN1564200A (en) * 2004-04-07 2005-01-12 西安交通大学 VLS realizing method for position plane coder of 0 redundancy coded clock
CN1564580A (en) * 2004-04-07 2005-01-12 西安交通大学 Channel parallel realizing method for down position plane coder under JPEG 2000 range associated mode
US7352903B2 (en) * 2004-08-17 2008-04-01 Pegasus Imaging Corporation Methods and apparatus for implementing JPEG 2000 encoding operations
US7760948B1 (en) * 2006-10-13 2010-07-20 Xilinx, Inc. Parallel coefficient bit modeling
CN101848311A (en) * 2010-02-21 2010-09-29 哈尔滨工业大学 JPEG2000 EBCOT encoder based on Avalon bus
CN102790882A (en) * 2012-07-25 2012-11-21 南京信息工程大学 Encoding method of remote sensing image

Also Published As

Publication number Publication date
CN111316645A (en) 2020-06-19

Similar Documents

Publication Publication Date Title
US11470322B2 (en) Method and apparatus for image compression
CN101569170B (en) Encoding device, encoding method, decoding device, and decoding method
US7289677B2 (en) Reversible embedded wavelet system implementation
US6229927B1 (en) Reversible embedded wavelet system implementation
US20210211728A1 (en) Image Compression Method and Apparatus
KR100317792B1 (en) Data Compression/decompression apparatus using reversible embeded wavelet and method thereof
US20150156517A1 (en) Image encoding system and method thereof
WO2020215193A1 (en) Coder, coding system, and coding method
AU2019356526B2 (en) A method and apparatus for image compression
CN111316644B (en) Image encoding method, decoding method, and applicable devices and systems
Hoon Son et al. An embedded compression algorithm integrated with Motion JPEG2000 system for reduction of off-chip video memory bandwidth
WO2020168520A1 (en) Encoder, encoding system, and encoding method
JP2001045482A (en) Device and method for image processing
Tsai et al. A Low Complexity Scalable Video Compressor for Multiple Source Digit Home Set-Top Box
Zheng et al. Fast algorithm for remote sensing image progressive compression
Lossless Compress System couple crowd lax lena man woman1 woman2

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: 19926646

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: 19926646

Country of ref document: EP

Kind code of ref document: A1