CN108156466B - Image compression method and system and MEMC framework applied by same - Google Patents

Image compression method and system and MEMC framework applied by same Download PDF

Info

Publication number
CN108156466B
CN108156466B CN201711456508.2A CN201711456508A CN108156466B CN 108156466 B CN108156466 B CN 108156466B CN 201711456508 A CN201711456508 A CN 201711456508A CN 108156466 B CN108156466 B CN 108156466B
Authority
CN
China
Prior art keywords
coding
quantization
bits
quantization parameter
bit number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711456508.2A
Other languages
Chinese (zh)
Other versions
CN108156466A (en
Inventor
陈本强
林江
陈涛
王洪剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Tongtu Semiconductor Technology Co ltd
Original Assignee
Shanghai Tongtu Semiconductor Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Tongtu Semiconductor Technology Co ltd filed Critical Shanghai Tongtu Semiconductor Technology Co ltd
Priority to CN201711456508.2A priority Critical patent/CN108156466B/en
Publication of CN108156466A publication Critical patent/CN108156466A/en
Application granted granted Critical
Publication of CN108156466B publication Critical patent/CN108156466B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/587Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal sub-sampling or interpolation, e.g. decimation or subsequent interpolation of pictures in a video sequence

Abstract

The invention discloses an image compression method, an image compression system and an MEMC framework applied by the image compression system, wherein the method comprises the following steps: step one, carrying out coarse coding on an input image block to obtain a quantization parameter QP, a coding bit number and a coding mode of the image block; step two, the quantization parameter QP of the current block generated in the step one is refined so as to lead more blocks to adopt more optimal quantization parameters QP; and step three, the method is used for carrying out compression coding on the current block according to the generated coding mode and the quantization parameter QP.

Description

Image compression method and system and MEMC framework applied by same
Technical Field
The invention relates to the technical field of video processing, in particular to an image compression method, an image compression system and an MEMC (motion estimation and motion estimation) framework applied by the image compression method and the image compression system.
Background
Motion Estimation and Motion Compensation (MEMC) is a common technique in television, i.e. based on Motion Estimation (ME), Motion Compensation (Motion Compensation) is performed to convert an input low frame rate video into a high frame rate video, so as to meet the requirement of human eyes on Motion continuity.
FIG. 1 is a schematic diagram of a MEMC architecture in the prior art. Specifically, the collection end Compresses (CMP) an input image and stores the input image into a DDR (Double Data Rate, Double Data synchronous dynamic Random Access Memory), reads a compressed code stream during Motion Compensation MC (Motion Compensation), decompresses DCMP (Decompression) and stores the decompressed code stream into an on-chip Memory RAM (Random-Access Memory), and during interpolation, first obtains a Motion Vector MV (Motion Vector) of a current block during Motion estimation ME (Motion estimation), and then reads a pixel value from the on-chip RAM according to the Motion Vector MV for interpolation.
The image resolution in the current television is higher and higher, and usually reaches 4k2k, and the motion vector in the vertical direction of two adjacent frames needs to reach [ -128,128], so as to meet the requirement of the MEMC algorithm. As shown in fig. 1, when MC (Motion Compensation), the pixel points pointed by the Motion vector MV need to be stored in the on-chip RAM to meet the real-time interpolation requirement of MC, so that P1 (previous frame image) and CF (current frame image) respectively need 256 4k line buffers to store the pixel points needed by the Motion Compensation MC, and the area of the line buffers is very large.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide an image compression method, an image compression system and an MEMC framework applied by the image compression method, so that the area of an on-chip RAM (random access memory) consumed by an image processing algorithm is greatly reduced by utilizing an image compression technology, and the cost and the power consumption of a chip are reduced.
To achieve the above and other objects, the present invention provides an image compression method, comprising the steps of:
step one, carrying out coarse coding on an input image block to obtain a quantization parameter QP, a coding bit number and a coding mode of the image block;
step two, thinning the quantization parameter QP of the current block generated in the step one so as to enable more blocks to adopt more optimal quantization parameters QP;
and step three, the current block is compressed and coded according to the generated coding mode and the quantization parameter QP.
Preferably, step one further comprises:
compressing the whole image block by using quantization parameters QP which are respectively 0, 1, 2, 3 and 4 to respectively obtain bit numbers used by each quantization parameter, brightness and chroma;
judging the coding mode and the quantization parameter QP of the current block according to the obtained bit number required by each QP code, and obtaining the coding bit number of the whole image block under each quantization parameter QP again;
preferably, the step of compressing the whole image block by using quantization parameters QP of 0, 1, 2, 3, and 4 respectively to obtain the bit numbers used by each quantization parameter, luminance, and chrominance respectively specifically includes:
according to the input pixel in _ pix and the predicted pixel pred, solving a residual pred _ diff;
quantizing the residual error by using a quantization parameter QP;
entropy coding is carried out on the quantized residual error coefficient;
carrying out inverse quantization on the quantized residual error coefficient;
reconstructing pixels according to the result of the inverse quantization;
and predicting pixel points according to the reconstructed pixels to obtain the predicted pixel pred.
Preferably, the step of quantizing the residual with the quantization parameter QP specifically includes:
Pred_diff_q=sign(pred_diff)*((ABS(pred_diff)+rnd)>>QP);
wherein the content of the first and second substances,
rnd=(QP==0)?0:(1<<QP-1);
Sign(x)=(x>=0)?1:-1;
ABS(x)=(x>=0)?x:-x。
preferably, the step of determining the coding mode and the quantization parameter QP of the current block according to the obtained number of bits required by each QP code, and obtaining the number of coding bits of the whole image block under each quantization parameter QP again specifically includes:
judging the coding mode of the current block, and independently judging the brightness and chrominance components;
according to the coding mode of each component, the coding bit number of each component on each quantization parameter QP is obtained again;
and adding the bit number used by the brightness under each quantization parameter QP to the bit number used by the chroma to obtain the coding bit number of the whole image block under each quantization parameter QP.
Preferably, the method for determining the encoding mode of the current block comprises: if the bit number of a certain QP variable length coding of a component is larger than the bit number of the RAW coding, the component adopts the RAW mode coding.
Preferably, the number of coding bits per QP of each component is retrieved according to the coding mode of each component as follows:
Luma_bits_qp(n)=is_raw_mode_yRaw_bits_qp(n):luma_vlc_bits_qp(n);
chroma_bits_qp(n)=is_raw_mode_cRaw_bits_qp(n):chroma_vlc_bits_qp(n);
wherein, Luma _ bits _ QP (n) and chroma _ bits _ QP (n) respectively represent the coding bits of the Luma component and the chroma component on each quantization parameter QP, the is _ RAW _ mode represents whether the component is in the RAW coding mode, if the component is in the RAW coding mode, the RAW bits are outputted, and otherwise, the variable length coding bits Luma _ vlc _ bits _ QP (n) or chroma _ vlc _ bits _ QP (n) are outputted
Preferably, in step two, the 16 × 1 image block is divided into two 8 × 1 blocks Y1 and Y2, and the chroma is 28 × 1 blocks U and V, and step two is specifically as follows:
(1) if QP is 0, then this block QP is 0, lossless compression is performed, otherwise to (2);
(2) carrying out quantization coding by using QP-1 for Y1, Y2 and U and QP for V, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, going to (3);
(3) using QP-1 for Y1 and Y2, carrying out quantization coding on UV by using QP, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, going to (4);
(4) and enabling Y1 to carry out quantization coding by using QP (quantization coding) and Y2 and UV (ultraviolet), and ending the refinement coding step by using the quantization scheme if the number of bits is less than or equal to 160, otherwise carrying out quantization coding on the whole block by using the quantity of QP.
To achieve the above object, the present invention further provides an image compression system, comprising:
the coarse coding unit is used for performing coarse coding on an input image block to obtain a quantization parameter QP, a coding bit number and a coding mode of the image block;
a refinement coding unit, configured to refine the quantization parameter QP of the current block generated by the coarse coding unit, so that more blocks adopt a better quantization parameter QP;
and the compression coding unit is used for carrying out compression coding on the current block according to the generated coding mode and the quantization level QP.
To achieve the above object, the present invention further provides an MEMC architecture applying the image compression method, including:
the acquisition end is used for compressing the input image and storing the compressed input image into the storage unit;
a first decompression unit for reading out the code streams of the current frame image CF and the previous frame image P1 from the storage unit and decompressing;
the motion estimation unit is used for calculating a motion vector according to the pixel points decompressed by the first decompression unit;
the second compression unit is used for compressing the pixel points decompressed by the first decompression unit again by using the image compression method and storing the pixel points into the on-chip RAM,
a second decompression unit for reading out code stream from the on-chip RAM according to the motion vector calculated by the motion estimation unit and decompressing when performing motion compensation;
the motion compensation unit is used for sending the pixel values decompressed by the second decompression unit into the motion compensation unit for interpolation;
and the storage unit is used for storing the input image compressed by the acquisition end.
Compared with the prior art, the image compression method, the image compression system and the MEMC framework applied by the method read out the code streams of the current frame CF and the previous frame P1 from the DDR for decompression, re-compress the decompressed pixel points by the cmp _ lb and store the decompressed pixel points into the on-chip RAM, read out the code streams from the RAM according to the motion vector MV solved by the motion estimation ME during the motion compensation MC, decompress by the dcmp _ lb and send the decompressed pixel points into the motion compensation MC for interpolation, greatly reduce the area of the on-chip RAM consumed by image processing, and reduce the cost and power consumption of a chip.
Drawings
FIG. 1 is a schematic diagram of a prior art MEMC architecture;
FIG. 2 is a flowchart illustrating steps of an image compression method according to the present invention
FIG. 3 is a system architecture diagram of an image compression system of the present invention;
FIG. 4 is a detailed block diagram of a coarse coding unit according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an MEMC architecture applying the image compression method of the present invention;
FIG. 6 illustrates a method for addressing an arbitrary MV in accordance with an embodiment of the present invention;
FIG. 7 is a block diagram of a compressed block according to an embodiment of the present invention;
FIG. 8 is a detailed structure diagram of a second compressing unit according to an embodiment of the present invention;
FIG. 9 is a diagram of a coding structure of a coding unit according to an embodiment of the present invention.
Detailed Description
Other advantages and capabilities of the present invention will be readily apparent to those skilled in the art from the present disclosure by describing the embodiments of the present invention with specific embodiments thereof in conjunction with the accompanying drawings. The invention is capable of other and different embodiments and its several details are capable of modification in various other respects, all without departing from the spirit and scope of the present invention.
FIG. 2 is a flowchart illustrating steps of an image compression method according to the present invention. As shown in fig. 2, the image compression method of the present invention includes the following steps:
step S1, is used to perform coarse coding on an input 16 × 1 image block to obtain the quantization parameter QP, the number of coded bits, and the coding mode of the image block.
Specifically, step S1 further includes:
step S100, performing compression coding on the whole image block by using QPs (Quantization parameters) of 0, 1, 2, 3 and 4 respectively to obtain each Quantization Parameter and bit numbers used by brightness and chroma respectively, wherein the coding specifically adopts differential prediction and Golomb-Rice coding;
step S100 specifically includes:
s100a, obtaining a residual pred _ diff according to the input pixel in _ pix and the predicted pixel pred;
s100b, quantizing (quant) the residual with quantization parameter QP, specifically quantizing as follows:
Pred_diff_q=sign(pred_diff)*((ABS(pred_diff)+rnd)>>QP);
wherein the content of the first and second substances,
rnd=(QP==0)?0:(1<<QP-1);
Sign(x)=(x>=0)?1:-1;
ABS(x)=(x>=0)?x:-x;
where pred _ diff is the residual found in the previous step, and pred _ diff _ q is the residual coefficient quantized with QP. That is, the smaller the post-quantization residual, the easier it is to compress.
S100c, entropy coding the quantized residual error coefficient by using golomb _ rice;
at S100d, inverse quantization (iq) is performed on the quantized residual coefficients, specifically, the inverse quantization method is as follows:
Iq_pred_diff=Pred_diff_q*(1<<QP);
s100e, reconstructing a pixel (recon) according to the result of the inverse quantization. Specifically, the reconstructed pixel expression is as follows:
Rec_pix=CLIP(0,1023,pred+iq_pred_diff)
wherein:
CLIP(min,max,x)=(x<min)?Min:((x>max)?Max:x);
where min represents the lower limit of the limit range, max represents the upper limit of the limit range, and x represents the general term of the input (e.g., pred + iq _ pred _ diff).
And S100f, predicting pixel points according to the reconstructed pixels.
In the specific embodiment of the invention, left value prediction is adopted, pixel points reconstructed from the left side are used as predicted values of right side points, if the pixel points are the first pixel points of an image block, median prediction is adopted, namely the predicted values are 512;
step S101, according to the bit number required by each QP code obtained in step S100, judging the coding mode and quantization parameter QP of the current block, and obtaining the coding bit number of the whole image block (blk) under each quantization parameter QP again. Specifically, the determination in step S101 is as follows:
and judging the coding mode of the current block, namely judging whether the coding mode of the current block adopts a raw mode or a variable length coding mode, and performing independent judgment on brightness and chroma, wherein specifically, the raw coding is to output original pixels directly in a fixed length mode after quantization, and the fixed length bit number is 10-QP. Since a macroblock input basically includes luminance and chrominance portions, each encoding mode generally needs to be determined separately, in the embodiment of the present invention, the method for determining the encoding mode includes: if the bit number of a certain QP variable length coding of one component is greater than the bit number of RAW coding, the component adopts a RAW mode for coding;
according to the coding mode of each component (including a brightness component and a chroma component), the coding bit number of each component on each quantization parameter QP is obtained again;
Luma_bits_qp(n)=is_raw_mode_yRaw_bits_qp(n):luma_vlc_bits_qp(n);
chroma_bits_qp(n)=is_raw_mode_cRaw_bits_qp(n):chroma_vlc_bits_qp(n);
the Luma _ bits _ QP (n) and the chroma _ bits _ QP (n) respectively represent the number of coding bits of the Luma component and the chroma component in each quantization parameter QP, the is _ RAW _ mode represents whether the component is in the RAW coding mode, and if the component is in the RAW coding mode, the RAW bits RAW _ bits _ QP (n) are output, and otherwise, the variable length coding bits Luma _ vlc _ bits _ QP (n) or chroma _ vlc _ bits _ QP (n) are output.
The number of bits used for luminance plus the number of bits used for chrominance for each quantization parameter QP is used to obtain the number of coded bits blk _ bits _ QP (n) for the entire image block (blk) for each quantization parameter QP, and the quantization parameter QP for the entire image block (blk) is obtained as follows: let blk _ bits _ QP (n) be less than or equal to the minimum quantization parameter QP value of 160 bits.
In step S2, the quantization parameter QP of the current image block (blk) generated in step S1 is further refined.
In order to make full use of the RAM space and to maximize the image quality, the optimal quantization parameter QP is used for as many pixels as possible without the compression result exceeding 160 bits. For simplicity of representation, in step S2, the present invention divides the whole image block into two 8 × 1 blocks Y1 and Y2, with 28 × 1 blocks U and V of chroma, and 4 blocks in total, aiming to make more blocks quantized with better quantization parameter QP, specifically, the specific procedure of step S2 is as follows:
(1) if the quantization parameter QP is 0, the block quantization parameter QP is 0, and lossless compression is carried out, otherwise, the step (2) is carried out;
(2) using QP-1 for blocks Y1, Y2 and U (namely, representing that the quantization parameter obtained by the coarse coding unit is subtracted by 1), using the quantization parameter QP for quantization coding for a block V, using the quantization scheme if the bit number is less than or equal to 160, ending the step of thinning coding, or else, going to the step (3);
(3) QP-1 is adopted for blocks Y1 and Y2, quantization coding is carried out on a block UV by using a quantization parameter QP, if the bit number is less than or equal to 160, the quantization scheme is used, the thinning coding step is ended, and otherwise, the step (4) is carried out;
(4) using QP-1 for the block Y1, using a quantization parameter QP for quantization coding for the block Y2 and the block UV, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, using the quantization parameter QP for quantization coding for the whole block;
in step S3, the current block is compressed and encoded by using the generated encoding mode and the quantization parameter QP.
Fig. 3 is a system architecture diagram of an image compression system according to the present invention. As shown in fig. 2, an image compression system of the present invention includes: coarse encoding section 301, fine encoding section 302, and compression encoding section 303.
Here, the coarse encoding unit 301 is configured to perform coarse encoding on an input 16 × 1 block to obtain a quantization parameter QP, a number of encoding bits, and an encoding mode for the image block.
Specifically, as shown in fig. 4, the coarse encoding unit 301 further includes:
a QP encoding unit 3011, which performs compression encoding on the entire image block with QPs (Quantization parameters) of 0, 1, 2, 3, and 4, respectively, to obtain each Quantization Parameter, and a bit number used for luminance and chrominance, respectively, and specifically, the encoding employs differential prediction and Golomb-Rice encoding;
QP coding unit 3011 is specifically configured to:
according to the input pixel in _ pix and the predicted pixel pred, solving a residual pred _ diff;
the residual is quantized (quant) with a quantization parameter QP, in the following way:
Pred_diff_q=sign(pred_diff)*((ABS(pred_diff)+rnd)>>QP);
wherein the content of the first and second substances,
rnd=(QP==0)?0:(1<<QP-1);
Sign(x)=(x>=0)?1:-1;
ABS(x)=(x>=0)?x:-x;
entropy coding is carried out on the quantized residual error coefficient pred _ diff by utilizing golomb _ rice;
inverse quantization (Iquant) is performed on the quantized residual coefficients
Iq_pred_diff=Pred_diff_q*(1<<QP);
Reconstructing a pixel (recon) from the result of the inverse quantization
Rec_pix=CLIP(0,1023,pred+iq_pred_diff)
Wherein:
CLIP(min,max,x)=(x<min)?Min:((x>max)?Max:x);
and predicting pixel points according to the reconstructed pixels.
In the embodiment of the invention, left value prediction is adopted, pixel points reconstructed from the left side are used as predicted values of right side points, if the pixel points are the first pixel points of a block, median prediction is adopted, namely the predicted value is 512;
the coding mode determination processing unit 3012 determines the coding mode and quantization parameter QP of the current block based on the number of bits required for each QP coding obtained by the QP coding unit 3011, and obtains the number of coding bits of the entire image block (blk) for each quantization parameter QP. Specifically, the judgment of the encoding mode judgment processing unit 2012 is specifically as follows:
and judging the coding mode of the current block, namely judging whether the coding mode of the current block adopts a raw mode or a variable length coding mode, and performing independent judgment on brightness and chroma, wherein specifically, the raw coding is to output original pixels directly in a fixed length mode after quantization, and the fixed length bit number is 10-QP. In the embodiment of the present invention, the method for determining the coding mode comprises: if the bit number of a certain QP variable length coding of one component is greater than the bit number of RAW coding, the component adopts a RAW mode for coding;
according to the coding mode of each component (including a brightness component and a chroma component), the coding bit number of each component on each QP is retrieved;
Luma_bits_qp(n)=is_raw_mode_yRaw_bits_qp(n):luma_vlc_bits_qp(n);
chroma_bits_qp(n)=is_raw_mode_cRaw_bits_qp(n):chroma_vlc_bits_qp(n);
the Luma _ bits _ QP (n) and the chroma _ bits _ QP (n) respectively represent the number of coding bits of the Luma component and the chroma component in each quantization parameter QP, the is _ RAW _ mode represents whether the component is in the RAW coding mode, and if the component is in the RAW coding mode, the RAW bits RAW _ bits _ QP (n) are output, and otherwise, the variable length coding bits Luma _ vlc _ bits _ QP (n) or chroma _ vlc _ bits _ QP (n) are output.
The number of bits used for luminance plus the number of bits used for chrominance for each quantization parameter QP is used to obtain the number of coded bits blk _ bits _ QP (n) for the entire image block (blk) for each quantization parameter QP, and the quantization parameter QP for the entire block (blk) is: let blk _ bits _ QP (n) be less than or equal to the minimum quantization parameter QP value of 160 bits.
A refinement coding unit 302, configured to refine the quantization parameter QP of the current block (blk) generated in the previous step.
In order to make full use of the RAM space and to maximize the image quality, the optimal quantization parameter QP is used for as many pixels as possible without the compression result exceeding 160 bits. For simplicity of representation, the present invention divides the whole block into two 8 × 1 blocks Y1 and Y2, chroma is 28 × 1 blocks U and V, and total 4 blocks, and aims to make more blocks quantized with better quantization parameter QP, specifically, the refinement coding unit 302 specifically processes as follows:
(1) if QP is 0, the block quantization parameter QP is 0, lossless compression is carried out, otherwise, step 2 is carried out;
(2) using QP-1 for blocks Y1, Y2 and U and QP for block V to carry out quantization coding, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of thinning coding, otherwise, going to step 3;
(3) QP-1 is adopted for blocks Y1 and Y2, QP is used for quantization coding for block UV, if the bit number is less than or equal to 160, the quantization scheme is used, the thinning coding step is ended, and otherwise, the step 4 is reached;
(4) using QP-1 for the block Y1, using a quantization parameter QP for quantization coding for the block Y2 and the block UV, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, using the QP for quantization coding for the whole block;
the compression encoding unit 303 performs compression encoding on the current block using the generated encoding mode and the quantization parameter QP.
Fig. 5 is a schematic diagram of an MEMC architecture applying the image compression method according to the present invention. As shown in fig. 5, an MEMC architecture applying the foregoing image compression method of the present invention includes:
the acquisition end 50 is configured to perform CMP on the input image and store the input image in the storage unit, and in the embodiment of the present invention, since the processing of the acquisition end 50 is the same as that in the prior art, details are not described herein;
a first decompression unit 51, configured to read out code streams of a current frame image (CF) and a previous frame image (P1) from the storage unit to perform DCMP decompression, where the first decompression unit 51 is the same as that in the prior art, and therefore is not described herein again;
a Motion Estimation (ME) unit 52, configured to calculate a motion vector MV according to the pixel point decompressed by the first decompression unit 51, which is the same as that in the prior art and is not described herein again;
the second compression unit (CMP _ lb)53, i.e. using the image compression method, compresses the pixel points decompressed by the first decompression unit 21 again by CMP _ lb and stores the pixel points into the on-chip RAM,
a second decompression unit (DCMP _ lb)54, which reads out a code stream from the on-chip RAM according to the motion vector MV obtained by the motion estimation unit 52 and decompresses the DCMP _ lb when performing the motion compensation MC;
a Motion Compensation (MC) unit 55, configured to send the pixel values decompressed by the second decompression unit 54 to the Motion Compensation (MC) unit for interpolation;
the storage unit 56 is configured to store the input image compressed by the acquisition end, and in the embodiment of the present invention, the storage unit 56 is a DDR.
Since the decompression DCMP _ lb of the second decompression unit 54 provides data to the motion compensation MC, the characteristics of the motion compensation MC will directly determine the specification of the second compression unit 53(CMP _ lb), and in the present invention, the motion compensation MC has the following characteristics:
1) a block has a motion vector MV, e.g., a 16 x 16 block uses a motion vector MV that points randomly to any position within the motion estimation search range;
2) the motion compensation MC uses the pixel values pointed by the motion vectors MV to blend (blending);
3) the luminance chrominance has the same motion vector MV.
Due to the randomness of the motion vector MV, decompression requires decompression from any position pointed to by the motion vector MV. When compressing, 16 × 1 blocks need to be compressed as a whole, and the compression ratio is constant.
As shown in fig. 6, the solid frame is a 16 × 1 block, a motion vector MV points to a position at random, and to extract 16 pixels pointed by the motion vector MV, two adjacent 16 × 1 blocks (such as BLk (n-1) and BLk (n)) need to be decompressed, and then 16 × 1 blocks are pieced together.
To implement the function of the motion compensation MC, the second compression unit (CMP _ lb)23 needs to satisfy the following condition:
1. compression is carried out according to 16 multiplied by 1(yuv422@10bit) blocks, and no correlation exists among the blocks; the block structure is shown in fig. 7, where each block has 16 luminance points, 8 points for each of the two chrominance components,
2. each block compression adopts a fixed compression multiple: the original bit number is 320 bits, if the compression is 2 times, the bit number is 160 bits after the compression, and the invention is shown by twice compression;
3. accurately controlling the bit number generated by compressing each block, wherein the generated bit number cannot be greater than the distribution space;
4. the luminance and chrominance are compressed together to obtain better compressed image quality;
5. since the space occupied by each block is fixed, the number of bits generated tries to fill this space.
In order to satisfy the above limitation of compressing CMP _ lb, in an embodiment of the present invention, the second compression unit (CMP _ lb)53 adopts an architecture as shown in fig. 8, and specifically, the second compression unit (CMP _ lb)53 further includes:
a coarse coding unit 531 is used to perform coarse coding on an input 16 × 1 block to obtain the quantization parameter QP, the number of coding bits, and the coding mode of the image block.
Specifically, the coarse encoding unit 531 further includes:
a QP encoding unit 5311 that performs compression encoding on the entire block using QPs (Quantization parameters) of 0, 1, 2, 3, and 4(ENC _ QP0, ENC _ QP1, ENC _ QP2, ENC _ QP3, ENC _ QP4) to obtain Quantization parameters, and the number of bits used for luminance and chrominance, respectively, and specifically, the encoding uses differential prediction and Golomb-Rice encoding;
as shown in fig. 9, the QP encoding unit 5311 is specifically configured to:
according to the input pixel in _ pix and the predicted pixel pred, solving a residual pred _ diff;
the residual is quantized (quant) with QP, in the following way:
Pred_diff_q=sign(pred_diff)*((ABS(pred_diff)+rnd)>>QP);
wherein the content of the first and second substances,
rnd=(QP==0)?0:(1<<QP-1);
Sign(x)=(x>=0)?1:-1;
ABS(x)=(x>=0)?x:-x;
entropy coding the quantized residual error coefficient pred _ diff by golomb _ rice;
inverse quantization (Iquant) is performed on the quantized residual coefficients
Iq_pred_diff=Pred_diff_q*(1<<QP);
Reconstructing a pixel (recon) from the result of the inverse quantization
Rec_pix=CLIP(0,1023,pred+iq_pred_diff)
Wherein:
CLIP(min,max,x)=(x<min)?Min:((x>max)?Max:x);
and predicting pixel points according to the reconstructed pixels.
In the embodiment of the invention, left value prediction is adopted, pixel points reconstructed from the left side are used as predicted values of right side points, if the pixel points are the first pixel points of a block, median prediction is adopted, namely the predicted value is 512;
the coding mode determination processing section 5312 determines the coding mode and quantization parameter QP of the current block from the number of bits required for each QP coding obtained in the QP coding section 5311. Specifically, the judgment of the encoding mode judgment processing unit 2312 is specifically as follows:
and judging the coding mode of the current block, namely judging whether the coding mode of the current block adopts a raw mode or a variable length coding mode, and performing independent judgment on brightness and chromaticity, wherein the raw coding is that original pixels are quantized and then directly output in a fixed length mode, and the fixed length bit number is 10-QP. The method for judging the coding mode comprises the following steps: if the bit number of a certain QP variable length coding of one component is greater than the bit number of RAW coding, the component adopts a RAW mode for coding;
according to the coding mode of each component, the coding bit number of each component on each QP is obtained again;
Luma_bits_qp(n)=is_raw_mode_yRaw_bits_qp(n):luma_vlc_bits_qp(n);
chroma_bits_qp(n)=is_raw_mode_cRaw_bits_qp(n):chroma_vlc_bits_qp(n);
the number of bits blk _ bits _ QP (n) for coding the entire block (blk) at each QP is obtained by adding the number of bits used for luminance to the number of bits used for chrominance at each QP, and the QP for the entire block (blk) can be obtained as: let blk _ bits _ QP (n) be less than or equal to the minimum quantization parameter QP value of 160 bits.
A refinement coding unit 532, configured to further refine the QP of the current block (blk) generated in the previous step. As shown in fig. 8, the quantization parameter QP generated by the coarse encoding unit 531 is FINE-encoded using ENC _ FINE _ QP1/2/3, ENC _ FINE _ QP1/2/3 indicates that FINE encoding is performed with the quantization parameters QP of 1, 2, and 3, and the result of encoding is subjected to FINE QP DECISION by FINE _ QP _ DECISION, and it is determined which QP is selected by performing determination on the three QP encoding results (ENC _ FINE _ QP 1/2/3).
In order to make full use of the RAM space and to maximize the image quality, the optimal quantization parameter QP is used for as many pixels as possible without the compression result exceeding 160 bits. For simplicity of representation, the present invention divides the whole block into two 8 × 1 blocks Y1 and Y2, chroma is 28 × 1 blocks U and V, for 4 blocks, and aims to make more blocks use better QP quantization, specifically, the refinement coding unit 532 specifically processes as follows:
(1) if the QP is 0, the block QP is 0, and lossless compression is carried out, otherwise, the step 2 is carried out;
(2) using QP-1 for blocks Y1, Y2 and U and QP for block V to carry out quantization coding, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of thinning coding, otherwise, going to step 3;
(2) QP-1 is adopted for blocks Y1 and Y2, QP is used for quantization coding for a block U, V, if the bit number is less than or equal to 160, the quantization scheme is used, the refinement coding step is ended, and otherwise, the step 4 is ended;
(3) the block Y1 adopts QP-1, the blocks Y2 and U, V use QP to carry out quantization coding, if the bit number is less than or equal to 160, the quantization scheme is used to finish the step of refinement coding, otherwise, the whole block uses the QP amount to carry out quantization coding;
the compression encoding unit 533 performs compression encoding on the current block using the generated encoding mode and the quantization parameter QP.
In summary, the image compression method, system and MEMC architecture applied thereto of the present invention read out the code stream of the current frame CF and the previous frame P1 from DDR for decompression, re-compress the decompressed pixel points with cmp _ lb and store them in the on-chip RAM, read out the code stream from the RAM according to the motion vector MV found by the motion estimation ME during the motion compensation MC, then decompress with dcmp _ lb and send them into the motion compensation MC for interpolation, so that the area of the on-chip RAM consumed by image processing is greatly reduced, and the cost and power consumption of the chip are reduced.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Modifications and variations can be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the present invention. Therefore, the scope of the invention should be determined from the following claims.

Claims (8)

1. An image compression method comprising the steps of:
step one, carrying out coarse coding on an input image block to obtain a quantization parameter QP, a coding bit number and a coding mode of the image block; further comprising:
compressing the whole image block by using quantization parameters QP which are respectively 0, 1, 2, 3 and 4 to respectively obtain the bit numbers respectively used by the brightness and the chroma of each quantization parameter;
judging the coding mode and the quantization parameter QP of the current block according to the obtained bit number required by each QP code, and obtaining the coding bit number of the whole image block under each quantization parameter QP again;
step two, thinning the quantization parameter QP of the current block generated in the step one so as to enable more blocks to adopt more optimal quantization parameters QP; a 16 × 1 image block is divided into two 8 × 1 blocks Y1 and Y2, with 28 × 1 blocks U and V of chroma, as follows:
(1) if QP is 0, then this block QP is 0, lossless compression is performed, otherwise to (2);
(2) carrying out quantization coding by using QP-1 for Y1, Y2 and U and QP for V, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, going to (3);
(3) using QP-1 for Y1 and Y2, carrying out quantization coding on UV by using QP, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, going to (4);
(4) using QP to carry out quantization coding on Y1 by adopting QP-1, Y2 and UV, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, carrying out quantization coding on the whole block by using the QP;
and step three, the current block is compressed and coded according to the generated coding mode and the quantization parameter QP.
2. The image compression method as claimed in claim 1, wherein the step of compressing the whole image block by using the quantization parameters QP of 0, 1, 2, 3, and 4 respectively to obtain the bit numbers used by each quantization parameter, luminance, and chrominance respectively comprises:
according to the input pixel in _ pix and the predicted pixel pred, solving a residual pred _ diff;
quantizing the residual error by using a quantization parameter QP;
entropy coding is carried out on the quantized residual error coefficient;
carrying out inverse quantization on the quantized residual error coefficient;
reconstructing pixels according to the result of the inverse quantization;
and predicting pixel points according to the reconstructed pixels to obtain the predicted pixel pred.
3. The image compression method as claimed in claim 2, wherein the step of quantizing the residual with the quantization parameter QP specifically comprises:
Pred_diff_q=sign(pred_diff)*((ABS(pred_diff)+rnd)>>QP);
wherein the content of the first and second substances,
rnd=(QP==0)?0:(1<<QP-1);
Sign(x)=(x>=0)?1:-1;
ABS(x)=(x>=0)?x:-x。
4. the image compression method of claim 1, wherein the step of determining the coding mode and the quantization parameter QP of the current block according to the obtained number of bits required for coding each QP, and obtaining the number of coding bits of the whole image block under each quantization parameter QP again comprises:
judging the coding mode of the current block, and independently judging the brightness and chrominance components;
according to the coding mode of each component, the coding bit number of each component on each quantization parameter QP is obtained again;
and adding the bit number used by the brightness under each quantization parameter QP to the bit number used by the chroma to obtain the coding bit number of the whole image block under each quantization parameter QP.
5. The image compression method of claim 4, wherein the method for determining the encoding mode of the current block comprises: if the bit number of a certain QP variable length coding of a component is larger than the bit number of the RAW coding, the component adopts the RAW mode coding.
6. An image compression method as claimed in claim 4, characterized in that: the specific details of the number of coding bits per QP of each component according to the coding mode of each component are as follows:
Luma_bits_qp(n)=is_raw_mode_yRaw_bits_qp(n):luma_vlc_bits_qp(n);
chroma_bits_qp(n)=is_raw_mode_cRaw_bits_qp(n):chroma_vlc_bits_qp(n);
the Luma _ bits _ QP (n) and the chroma _ bits _ QP (n) respectively represent the number of coding bits of the Luma component and the chroma component in each quantization parameter QP, the is _ RAW _ mode represents whether the component is in the RAW coding mode, and if the component is in the RAW coding mode, the RAW bits RAW _ bits _ QP (n) are output, and otherwise, the variable length coding bits Luma _ vlc _ bits _ QP (n) or chroma _ vlc _ bits _ QP (n) are output.
7. An image compression system comprising:
the coarse coding unit is used for performing coarse coding on an input image block to obtain a quantization parameter QP, a coding bit number and a coding mode of the image block; compressing the whole image block by using quantization parameters QP which are respectively 0, 1, 2, 3 and 4 to respectively obtain the bit numbers respectively used by the brightness and the chroma of each quantization parameter;
judging the coding mode and the quantization parameter QP of the current block according to the obtained bit number required by each QP code, and obtaining the coding bit number of the whole image block under each quantization parameter QP again;
a refinement coding unit, configured to refine the quantization parameter QP of the current block generated by the coarse coding unit, so that more blocks adopt a better quantization parameter QP; a 16 × 1 image block is divided into two 8 × 1 blocks Y1 and Y2, with 28 × 1 blocks U and V of chroma, as follows:
(1) if QP is 0, then this block QP is 0, lossless compression is performed, otherwise to (2);
(2) carrying out quantization coding by using QP-1 for Y1, Y2 and U and QP for V, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, going to (3);
(3) using QP-1 for Y1 and Y2, carrying out quantization coding on UV by using QP, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, going to (4);
(4) using QP to carry out quantization coding on Y1 by adopting QP-1, Y2 and UV, if the bit number is less than or equal to 160, using the quantization scheme to finish the step of refinement coding, otherwise, carrying out quantization coding on the whole block by using the QP;
and the compression coding unit is used for carrying out compression coding on the current block according to the generated coding mode and the quantization level QP.
8. An MEMC architecture applying the image compression method of claim 1, comprising:
the acquisition end is used for compressing the input image and storing the compressed input image into the storage unit;
a first decompression unit for reading out the code streams of the current frame image CF and the previous frame image P1 from the storage unit and decompressing;
the motion estimation unit is used for calculating a motion vector according to the pixel points decompressed by the first decompression unit;
the second compression unit is used for compressing the pixel points decompressed by the first decompression unit again by using the image compression method and storing the pixel points into the on-chip RAM,
a second decompression unit for reading out code stream from the on-chip RAM according to the motion vector calculated by the motion estimation unit and decompressing when performing motion compensation;
the motion compensation unit is used for sending the pixel values decompressed by the second decompression unit into the motion compensation unit for interpolation;
and the storage unit is used for storing the input image compressed by the acquisition end.
CN201711456508.2A 2017-12-28 2017-12-28 Image compression method and system and MEMC framework applied by same Active CN108156466B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711456508.2A CN108156466B (en) 2017-12-28 2017-12-28 Image compression method and system and MEMC framework applied by same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711456508.2A CN108156466B (en) 2017-12-28 2017-12-28 Image compression method and system and MEMC framework applied by same

Publications (2)

Publication Number Publication Date
CN108156466A CN108156466A (en) 2018-06-12
CN108156466B true CN108156466B (en) 2021-08-13

Family

ID=62463773

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711456508.2A Active CN108156466B (en) 2017-12-28 2017-12-28 Image compression method and system and MEMC framework applied by same

Country Status (1)

Country Link
CN (1) CN108156466B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114051140B (en) * 2022-01-07 2022-04-08 腾讯科技(深圳)有限公司 Video encoding method, video encoding device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1520431A1 (en) * 2002-07-01 2005-04-06 E G Technology Inc. Efficient compression and transport of video over a network
CN102595143A (en) * 2012-03-19 2012-07-18 中国科学院声学研究所 Wireless video transmission method
CN102710940A (en) * 2012-06-04 2012-10-03 公安部第三研究所 Digital signal processor (DSP) platform-based method for realizing optimization of video coding by utilizing motion estimation algorithm
CN104718753A (en) * 2012-10-03 2015-06-17 美国博通公司 Bounded rate compression with rate control for slices

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1520431A1 (en) * 2002-07-01 2005-04-06 E G Technology Inc. Efficient compression and transport of video over a network
CN102595143A (en) * 2012-03-19 2012-07-18 中国科学院声学研究所 Wireless video transmission method
CN102710940A (en) * 2012-06-04 2012-10-03 公安部第三研究所 Digital signal processor (DSP) platform-based method for realizing optimization of video coding by utilizing motion estimation algorithm
CN104718753A (en) * 2012-10-03 2015-06-17 美国博通公司 Bounded rate compression with rate control for slices

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
H.264变换和量化的分析;楼剑,等;《浙江大学学报》;20040531;第38卷(第5期);全文 *

Also Published As

Publication number Publication date
CN108156466A (en) 2018-06-12

Similar Documents

Publication Publication Date Title
JP6701391B2 (en) Digital frame encoding/decoding by downsampling/upsampling with improved information
KR100484333B1 (en) Memory Management for Image Signal Processors
JP5358482B2 (en) Display drive circuit
RU2504107C2 (en) Compressing video data without visible losses
CN102986211B (en) Speed control in Video coding
US9621900B1 (en) Motion-based adaptive quantization
US9807425B2 (en) Method and apparatus for encoding/decoding images considering low frequency components
CN107864379B (en) Compression method applied to video coding and decoding
KR20180069818A (en) Entropy Coding Techniques for Display Stream Compression (DSC) of Non-4: 4: 4 Chroma Sub-Sampling
US11166029B2 (en) Video encoding apparatus having reconstruction buffer with fixed size and/or bandwidth limitation and associated video encoding method
EP1078529A1 (en) Method and apparatus for increasing memory resource utilization in an information stream decoder
US10003802B1 (en) Motion-based adaptive quantization
CN108156466B (en) Image compression method and system and MEMC framework applied by same
CN111491163B (en) Image block encoding based on pixel domain preprocessing operation on image blocks
KR100549208B1 (en) Overhead data processor in a memory efficient image processing system
US11190810B2 (en) Device and method for compressing image data using quantization parameter and entropy tables
KR100598093B1 (en) Apparatus and method with low memory bandwidth for video data compression
CN105519108A (en) Quantization matrix (qm) coding based on weighted prediction
CN101406034B (en) Compression scheme using qualifier watermarking and apparatus using the compression scheme for temporarily storing image data in a frame memory
KR20180032570A (en) Modification to block size for transform mode in display stream compression
KR100277953B1 (en) Digital tv receiver
US10003803B1 (en) Motion-based adaptive quantization
Singh et al. A brief introduction on image compression techniques and standards
CN116828200B (en) Image processing method, processing device, equipment and medium
Silveira et al. Memory bandwidth reduction for H. 264 and HEVC encoders using lossless reference frame coding

Legal Events

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