CN106034238B - The method and its system of the calculation code distortion factor and coding mode control - Google Patents

The method and its system of the calculation code distortion factor and coding mode control Download PDF

Info

Publication number
CN106034238B
CN106034238B CN201510106648.1A CN201510106648A CN106034238B CN 106034238 B CN106034238 B CN 106034238B CN 201510106648 A CN201510106648 A CN 201510106648A CN 106034238 B CN106034238 B CN 106034238B
Authority
CN
China
Prior art keywords
coefficient
coding
residual
prediction mode
matrix
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
CN201510106648.1A
Other languages
Chinese (zh)
Other versions
CN106034238A (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 FULHAN MICROELECTRONICS Co Ltd
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
SHANGHAI FULHAN MICROELECTRONICS Co Ltd
Hangzhou Hikvision Digital 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 FULHAN MICROELECTRONICS Co Ltd, Hangzhou Hikvision Digital Technology Co Ltd filed Critical SHANGHAI FULHAN MICROELECTRONICS Co Ltd
Priority to CN201510106648.1A priority Critical patent/CN106034238B/en
Publication of CN106034238A publication Critical patent/CN106034238A/en
Application granted granted Critical
Publication of CN106034238B publication Critical patent/CN106034238B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The present invention relates to Video codings and process field, disclose the method and system of a kind of the calculation code distortion factor and coding mode control.Method includes the following steps: the predicted pixel values according to the pixel value of coded macroblocks and under current prediction mode calculate prediction residual value in the present invention, and obtain the DCT coefficient X that prediction residual value exports after discrete cosine transform;Obtain the frequency coefficient Y that X is exported after quantifying and inverse quantization is handled;To DCT coefficient X through predetermined coefficient matrix EfFrequency coefficient and frequency coefficient Y adjusted carries out residual computations;To the coding distortion degree obtained after residual computations result progress inverse discrete cosine transformation under current prediction mode.In the present invention, pixel residual computations in spatial domain are converted into frequency coefficient residual computations, the calculating of coding distortion degree only can be completed by the residual error relationship of frequency domain data, shorten the delay of residual error meter, memory sync buffering space is reduced, brings convenience for hardware realization.

Description

The method and its system of the calculation code distortion factor and coding mode control
Technical field
The present invention relates to Video codings and process field, the in particular to side of the calculation code distortion factor and coding mode control Method and its system.
Background technique
Propose to lose using the rate based on Lagrangian optimization algorithm in the meeting document of JVT (Joint Video Team) True coding mode Controlling model realizes the scheme control strategy of Video coding, considers the set S=of K information source sample value (S1,...,SK), macro block SkLagrangian cost function it is as follows:
JMODE(Sk,Ik|Q,λMODE)=DREC(Sk,Ik|Q)+λMODE×RREC(Sk,Ik|Q,λMODE)
Wherein, IkFor the coding mode of respective macroblock, Q is quantization parameter, λMODEFor Lagrangian parameter.DRECFor coding The distortion factor, RRECFor the code rate of code stream after coding.
Distortion factor DRECCalculating have 2 kinds of calculations, i.e., absolute difference and SAD and difference quadratic sum SSD:
Wherein, A is current macro, and s [x, y, t] is the pixel value of current coding macro block, and p [x, y, t] is that present encoding is macro The corresponding predicted value of block, r [x, y, t] are the corresponding reconstructed value of current coding macro block.
SAD only needs to calculate the residual error between current coding macro block and predicted value, and calculating process is simple, the residual error meter of SSD Calculation needs reconstructed value, and the acquisition of reconstructed value is needed by prediction, frequency domain direct transform, quantization, inverse quantization, frequency domain inverse transformation, weight Build the AVC coding calculating process of equal a series of complex.But SSD has more accurately reacted coding distortion degree, mould compared to SAD The accuracy of formula selection is obviously improved, and coding efficiency is also promoted accordingly.Complexity will be brought based on the calculating process of SSD Arithmetic logic and serious data calculating access are delayed, and this is real, and mainstream encoder all abandons coding efficiency and significantly mentions at present The RDO strategy risen, and generally use the model selection of SAD/SATD.
Summary of the invention
The purpose of the present invention is to provide methods and its system that a kind of calculation code distortion factor and coding mode control, will The calculating process of SSD is optimized accordingly, under the premise of retaining SSD algorithm advantage, significantly reduces computational complexity And buffer space, and corresponding boosting algorithm accuracy and calculating accuracy.
In order to solve the above technical problems, embodiments of the present invention disclose a kind of method of calculation code distortion factor, in advance Equipped with coefficient matrix Ef, method includes the following steps:
Predicted pixel values according to the pixel value of coded macroblocks and under current prediction mode calculate prediction residual value, and Obtain the DCT coefficient X that the prediction residual value exports after discrete cosine transform;
Obtain the frequency coefficient Y that the DCT coefficient X is exported after quantifying and inverse quantization is handled;
To the DCT coefficient X through the predetermined coefficient matrix EfFrequency coefficient adjusted and the frequency coefficient Y are carried out Residual computations;
Inverse discrete cosine transformation, and exporting according to the inverse discrete cosine transformation are carried out to the residual computations result Coding distortion degree under current prediction mode out.
Embodiments of the present invention also disclose a kind of coding mode control method, comprising the following steps:
Coding distortion degree under the current prediction mode obtained according to the calculation method of above-mentioned coding distortion degree, and it is current Encoder bit rate under prediction mode calculates the coding cost value under current prediction mode;
Concentrate the prediction mode using minimum code cost value is corresponded to as coded macroblocks in all optional prediction modes Optimal prediction modes, the coding for coded macroblocks.
Embodiments of the present invention also disclose a kind of system of calculation code distortion factor, are preset with coefficient matrix Ef, should System comprises the following modules:
DCT coefficient obtains module, the DCT coefficient X exported after discrete cosine transform for obtaining prediction residual value, institute Stating prediction residual value is calculated according to the pixel value and the predicted pixel values under current prediction mode of coded macroblocks;
Inverse quantization exports frequency coefficient and obtains module, for obtaining the DCT coefficient X after quantifying and inverse quantization is handled The frequency coefficient Y of output;
Logical operation module is used for the DCT coefficient X through the predetermined coefficient matrix EfFrequency coefficient adjusted and The frequency coefficient Y carries out residual computations;
Inverse discrete cosine transformation module, for carrying out inverse discrete cosine transformation to the residual computations result, and according to institute The output for stating inverse discrete cosine transformation obtains coding distortion degree under current prediction mode.
Embodiments of the present invention also disclose a kind of coding mode control system, comprise the following modules:
Coding cost value computing module, the current prediction mode for being obtained according to the system of the above-mentioned calculation code distortion factor Under coding distortion degree and current prediction mode under encoder bit rate, calculate current prediction mode under coding cost value;
Optimal prediction modes determining module, for minimum code cost value will to be corresponded in all optional prediction mode concentrations Optimal prediction modes of the prediction mode as coded macroblocks, the coding for coded macroblocks.
Compared with prior art, the main distinction and its effect are embodiment of the present invention:
Standard SSD is calculated into the method migration of pixel residual error in spatial domain into the calculating of frequency coefficient residual error, it is only necessary to according to Rely and the calculating of coding distortion degree can be completed in the residual error relationship of frequency domain data, avoid prediction module, prediction residual calculates mould Block rebuilds module, DCT module and IDCT module and is calculating the delay in access, to shorten residual computations on the whole Delay, reduces memory sync buffering space, brings great convenience for hardware realization.
It is introduced into coding mode control using the calculation method of improved coding distortion degree, coding mode selects accurate Degree is obviously improved.
Further, according to the surplus of the bit bit wide of dequantized coefficients matrix, to predetermined coefficient matrix EfIt amplifies, It can guarantee to calculate accuracy.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of the method for the calculation code distortion factor in first embodiment of the invention;
Fig. 2 (a) is the flow diagram of the SSD calculation method of prior art Plays, and Fig. 2 (b) is that the present invention first is real Apply the flow diagram of SSD distortion factor calculation method in mode;
Fig. 3 is a kind of flow diagram of coding mode control method in third embodiment of the invention;
Fig. 4 is a kind of structural schematic diagram of the system of the calculation code distortion factor in four embodiment of the invention;
Fig. 5 is a kind of structural schematic diagram of coding mode control system in sixth embodiment of the invention.
Specific embodiment
In the following description, in order to make the reader understand this application better, many technical details are proposed.But this The those of ordinary skill in field is appreciated that even if without these technical details and many variations based on the following respective embodiments And modification, each claim of the application technical solution claimed can also be realized.
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to implementation of the invention Mode is described in further detail.
First embodiment of the invention is related to a kind of method of calculation code distortion factor, and Fig. 1 is the calculation code distortion factor Method flow diagram.
Specifically, as shown in Figure 1, the method for the calculation code distortion factor is preset with coefficient matrix Ef, this method includes Following steps:
Step 101, the predicted pixel values according to the pixel value of coded macroblocks and under current prediction mode calculate prediction Residual values, and obtain the DCT coefficient X that the prediction residual value exports after discrete cosine transform;
Step 102, the frequency coefficient Y that DCT coefficient X is exported after quantifying and inverse quantization is handled is obtained;
Step 103, to DCT coefficient X through predetermined coefficient matrix EfFrequency coefficient and frequency coefficient Y adjusted carries out residual error It calculates;
Step 104, inverse discrete cosine transformation is carried out to the residual computations result, and according to the inverse discrete cosine transformation Output obtain the coding distortion degree under current prediction mode.
In AVC video encoding standard, the structure of coding still based on traditional coding framework, i.e., encoder according to Picture material, using rate-distortion optimization, (wherein, rate-distortion optimization is under conditions of limiting bit rate is R, i.e., R value cannot surpass Cross transmission rate, forced coding mode selected, so that the distortion factor is minimum) method, in frame with the numerous optional volumes of interframe Optimal mode is chosen in pattern (or prediction mode), its distortion factor and bit will be calculated to each coding mode Rate.
Wherein, there are two types of mode, i.e., absolute difference and SAD and difference quadratic sum SSD for the calculating of the distortion factor.Compared to being based on The coding mode control strategy of SAD only needs prediction and residual computations module in prediction and model selection stage, based on SSD's Rate distortion coding mode control strategy is also additionally required dct transform module (i.e. discrete cosine transform) in an encoding process, is quantified Module, inverse quantization module, inverse DCT conversion module, mode selection module rebuild the rate estimation module of module and complexity, more Add and accurately reacted coding distortion degree, and provides corresponding parameter for accurately calculating for bit rate, the standard of model selection Exactness is obviously improved, so that coding efficiency be made accordingly to be substantially improved.
But as above, coding cost value of the rate distortion coding mode control strategy based on SSD for every kind of coding mode Calculating process must pass through prediction module, residual computations module, dct transform module, quantization modules, inverse quantization module, inverse DCT Conversion module, an interminable data such as mode selection module and reconstruction module calculate access, and there are biggish data paths Delay.
And the method calculation code distortion factor in present embodiment using the step 101 to step 104 is then based on reason Data path delay is optimized by deriving.Specifically:
In AVC encoder architecture, shown in flow diagram such as Fig. 2 (a) of the SSD calculation method of standard, the algorithm of SSD Prototype is as follows:
Wherein, Rec (x, y) is the reconstructed results of encoding pass, needs (intraframe or interframe) prediction by pixel value, in advance Residual computations, DCT frequency domain direct transform are surveyed, quantization Q is calculated, and inverse quantization IQ is calculated, DCT frequency domain inverse transformation, the reconstruction etc. of pixel value The calculating process of a series of complex obtains.
Firstly, according to fig. 2 (a), doing following derivation to SSD prototype calculation formula:
Wherein, Cmb (x, y) is the pixel value of current macro, and Pred (x, y) is the prediction result of corresponding prediction mode, Rec (x, y) is the reconstructed results of corresponding prediction mode, and Diff (x, y) is the output of prediction residual computing module DIFF as a result, Diff' (x, y) is the output result of DCT frequency domain inversion module I DCT.
It is found by the derivation, it can be to avoid (in interframe or frame) prediction module, residual computations mould when calculating the SSD distortion factor Block rebuilds module in the delay of the coding cost value of the SSD of script calculated in access, and the part for reducing data path is prolonged When.
Secondly, further directed to Diff'(x, y)-Diff (x, y) handled, and concrete processing procedure is as follows:
According to AVC data processing feature, Diff'(x, y) be specifically described as to the block matrix D ' of 4x4, and by Diff (x, y) It is described as the block matrix D, such Diff'(x, y of 4x4) calculating process of-Diff (x, y) is embodied in a luminance macroblock The corresponding operation of 16, portion 4x4 block matrix (being then 8 4x4 block matrix for chrominance macroblock), formulation process are as follows:
D'-D=E (D'-D) E
Wherein, E is unit matrix, is decomposed as follows:
E=AAT=ATA
Wherein, A is orthogonal matrix, is obtained;
D'-D=ATA(D'-D)ATA
Here, according to the characteristic of orthogonal matrix, the following two kinds is carried out to A and decomposes construction:
Wherein, P0For the transformation matrices of DCT frequency domain inverse transformation in AVC standard, P1For DCT frequency domain direct transform square in AVC standard Battle array.
Decomposition based on front obtains following formula:
Wherein, available according to main diagonal matrix characteristic:
By formulaIn It is split:
(1) as follows for the frequency domain direct transform processing of D ':
Wherein, Y is the output of inverse quantization IQ as a result, D ' is output of the Y after IDCT as a result, i.e.Meter It obtains:
(2) output that D is DIFF is as a result, be directed to the frequency domain direct transform of D, according to the definition of AVC standard, it should use P1Matrix Rather than P0Matrix, respective handling are as follows:
Wherein, X is the output of DCT direct transform as a result, according to main diagonal matrix characteristic, is obtained:
Therefore, it is handled, is obtained as drawn a conclusion by the above-mentioned frequency domain direct transform to D ' and D:
According to the characteristic of diagonal matrix, diagonal matrix can be multiplied and be converted into coefficient matrix, such as
Accordingly, can be following expression-form by simplified formula:
In addition, as can be seen from the above equation, in step 103, the predetermined coefficient matrix EfThe DCT coefficient X is adjusted Frequency coefficient afterwards isWhereinFor matrix multiple operation.
Illustrated using the process of SSD distortion factor calculation method in the available present embodiment as shown in Fig. 2 (b) of above formula Figure.
It is calculated in prototype SSD standard compared to the distortion factor and equals the reconstructed value of coded macroblocks and the difference of coded macroblocks pixel value Side and as the coding distortion degree under corresponding coding mode, as shown in Fig. 2 (a), the embodiment by residual computations be converted to from The calculating for dissipating the frequency coefficient residual error of the output X of cosine transform and the output Y of inverse quantization, as shown in Fig. 2 (b), thus only need to be according to The calculating of coding distortion degree can be completed in the residual error relationship of the frequency domain data at Lai Yu quantization and inverse quantization both ends.
Standard SSD is calculated the method migration of pixel residual error in spatial domain into the meter of frequency coefficient residual error by present embodiment It calculates, it is only necessary to which the calculating that coding distortion degree can be completed dependent on the residual error relationship of frequency domain data avoids prediction module, predicts residual Poor computing module rebuilds module, DCT module and IDCT module and is calculating the delay in access, to shorten on the whole residual The delay that difference calculates, reduces memory sync buffering space, brings great convenience for hardware realization.
Second embodiment of the invention is related to a kind of method of calculation code distortion factor, and second embodiment is implemented first It is improved on the basis of mode, is mainly theed improvement is that: is right according to the surplus of the bit bit wide of dequantized coefficients matrix Predetermined coefficient matrix EfIt amplifies, can guarantee to calculate accuracy.Specifically:
Preferably, further include sub-step in the step 103:
The bit of used dequantized coefficients matrix when according to the DCT coefficient X by quantization and inverse quantization processing Wide surplus, correspondingly to the predetermined coefficient matrix EfAmplify processing.
It is mainly considered furthermore, it is to be understood that making above-mentioned optimization processing:
It is defined according to AVC standard, dequantized coefficients matrix V value has the surplus of 6 bit bit wides to guarantee DCT inverse transformation and picture Plain reconstruction precision, i.e. Y value, which are equivalent to, is exaggerated 64 times, therefore, in order to guarantee to calculate accuracy, needs that X is equally amplified 64 Times.
Moreover it is preferred that predetermined coefficient matrix are as follows:
Furthermore, it is to be understood that further including to predetermined coefficient matrix E in other embodiments of the present inventionfIt carries out approximate The step of floating-point operation, in order to which co-efficient multiplication operation is realized in the displacement of hardware.
Such as it can be to EfFollowing approximation is carried out, realizes co-efficient multiplication operation convenient for the displacement of hardware:
Below to the method for Fig. 2 (a) He two kinds of calculated distortion degree of Fig. 2 (b) in data processing delay and required memory buffer Two, area aspect compares, and wherein Fig. 2 (a) is the flow diagram of standard SSD calculation method, and Fig. 2 (b) is of the present invention The flow diagram of SSD distortion factor calculation method:
Structure description is calculated for Fig. 2 (a), reference standard SSD, standard SSD is calculated and carries out specific quantificational description:
(1) it encodes prediction data and current macro data is sent into DIFF module simultaneously and carries out the worth calculating of prediction residual, Throughput is 1x4 (pixels/cycle), and register exports the delay for having 1cycle;
(2) prediction residual enters the progress frequency domain positive-going transition of DCT module, and throughput is 1x4 (pixels/cycle), because To complete two-dimensional dct transform, therefore transposition carrys out registered data to needs twice, and register exports the delay for having 8cycle;
(3) quantify, inverse quantization, throughput is 1x4 (pixels/cycle), and register exports the delay for respectively having 1cycle;
(4) IDCT module carries out frequency domain transformation by reciprocal direction, throughput and the same DCT of register delay;
(5) REC module completes the reconstruction of pixel, and throughput is 1x4 (pixels/cycle), and register output has The delay of 1cycle.
In conclusion being input to the calculating needs 24 for completing the SSD of a 4x4 block from the first row 1x4pixels Cycle, CMB at least need 20 grades of core buffer, ensure being computed correctly for the distortion factor with this.
For Fig. 2 (b), the method for being proposed to calculate frequency-domain residual using the present invention can intuitively be seen from Fig. 2 (b) whole A calculating process is no longer needed by DIFF module, REC module, DCT/IDCT module, and depends only on the frequency at the both ends Q/IQ The residual error relationship of numeric field data, it is available such as to draw a conclusion using above-mentioned quantitative analysis method: to complete the meter of a 4x4 block SSD It calculates and needs 15 cycle, only 2 grades of core buffer can complete the calculating of the distortion factor.
From the point of view of data comparison, the method for the calculation code distortion factor described in present embodiment is slow in data delay and memory Punching aspect effect be it will be apparent that compare standard SSD calculate structure, effectively shorten the delay of residual computations, cut down Memory sync buffering space, brings great convenience for hardware realization.
Third embodiment of the invention is related to a kind of coding mode control method, and Fig. 3 is the coding mode control method Flow diagram.
Specifically, as shown in figure 3, the coding mode control method the following steps are included:
Step 301, the coding distortion under the current prediction mode obtained according to the calculation method of such as afore-mentioned code distortion factor Encoder bit rate under degree and current prediction mode calculates the coding cost value under current prediction mode.
Step 302, concentrate the prediction mode using minimum code cost value is corresponded to as volume in all optional prediction modes The optimal prediction modes of decoding macroblock, the coding for coded macroblocks.
Present embodiment is introduced into coding mode control using the calculation method of improved coding distortion degree, coding mode The accuracy of selection is obviously improved.
Each method embodiment of the invention can be realized in a manner of software, hardware, firmware etc..Regardless of the present invention be with Software, hardware or firmware mode realize that instruction code may be stored in any kind of computer-accessible memory In (such as permanent perhaps revisable volatibility is perhaps non-volatile solid or non-solid, it is fixed or The replaceable medium etc. of person).Equally, memory may, for example, be programmable logic array (Programmable Array Logic, referred to as " PAL "), random access memory (Random Access Memory, referred to as " RAM "), it may be programmed read-only deposit Reservoir (Programmable Read Only Memory, referred to as " PROM "), read-only memory (Read-Only Memory, letter Claim " ROM "), electrically erasable programmable read-only memory (Electrically Erasable Programmable ROM, referred to as " EEPROM "), disk, CD, digital versatile disc (Digital Versatile Disc, referred to as " DVD ") etc..
Four embodiment of the invention is related to a kind of system of calculation code distortion factor, and Fig. 4 is the calculation code distortion factor System structural schematic diagram.
Specifically, the systemic presupposition of the calculation code distortion factor has coefficient matrix Ef, which comprises the following modules:
DCT coefficient obtains module, the DCT coefficient X exported after discrete cosine transform for obtaining prediction residual value, institute Stating prediction residual value is calculated according to the pixel value and the predicted pixel values under current prediction mode of coded macroblocks;
Inverse quantization exports frequency coefficient and obtains module, for obtaining the DCT coefficient X after quantifying and inverse quantization is handled The frequency coefficient Y of output;
Logical operation module is used for the DCT coefficient X through the predetermined coefficient matrix EfFrequency coefficient adjusted and The frequency coefficient Y carries out residual computations;
Inverse discrete cosine transformation module, for carrying out inverse discrete cosine transformation to the residual computations result, and according to institute The output for stating inverse discrete cosine transformation obtains coding distortion degree under current prediction mode.
Standard SSD is calculated the method migration of pixel residual error in spatial domain into the meter of frequency coefficient residual error by present embodiment It calculates, it is only necessary to which the calculating that coding distortion degree can be completed dependent on the residual error relationship of frequency domain data avoids prediction module, predicts residual Poor computing module rebuilds module, DCT module and IDCT module and is calculating the delay in access, to shorten on the whole residual The delay that difference calculates, reduces memory sync buffering space, brings great convenience for hardware realization.
First embodiment is method implementation corresponding with present embodiment, and present embodiment can be implemented with first Mode is worked in coordination implementation.The relevant technical details mentioned in first embodiment are still effective in the present embodiment, in order to It reduces and repeats, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in the first implementation In mode.
Fifth embodiment of the invention is related to a kind of system of calculation code distortion factor, and the 5th embodiment is implemented the 4th It is improved on the basis of mode, is mainly theed improvement is that: is right according to the surplus of the bit bit wide of dequantized coefficients matrix Predetermined coefficient matrix EfIt amplifies, can guarantee to calculate accuracy.Specifically:
Preferably, in logical operation module, predetermined coefficient matrix EfIt is to DCT coefficient X frequency coefficient adjustedWhereinFor matrix multiple operation.
Preferably, further include submodule in logical operation module:
Bit wide surplus is aligned submodule, used when for being handled according to the DCT coefficient X by quantization and inverse quantization The surplus of the bit bit wide of dequantized coefficients matrix, correspondingly to the predetermined coefficient matrix EfAmplify processing.
Preferably, predetermined coefficient matrix EfAre as follows:
Second embodiment is method implementation corresponding with present embodiment, and present embodiment can be implemented with second Mode is worked in coordination implementation.The relevant technical details mentioned in second embodiment are still effective in the present embodiment, in order to It reduces and repeats, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in the second implementation In mode.
Sixth embodiment of the invention is related to a kind of coding mode control system, and Fig. 5 is the coding mode control system Structural schematic diagram.
Specifically, as shown in figure 5, the coding mode control system comprises the following modules:
Coding cost value computing module, the current prediction mode for being obtained according to the system of the aforementioned calculation code distortion factor Under coding distortion degree and current prediction mode under encoder bit rate, calculate current prediction mode under coding cost value;
Optimal prediction modes determining module, for minimum code cost value will to be corresponded in all optional prediction mode concentrations Optimal prediction modes of the prediction mode as coded macroblocks, the coding for coded macroblocks.
Present embodiment is introduced into coding mode control using the calculation method of improved coding distortion degree, coding mode The accuracy of selection is obviously improved.
Third embodiment is method implementation corresponding with present embodiment, and present embodiment can be implemented with third Mode is worked in coordination implementation.The relevant technical details mentioned in third embodiment are still effective in the present embodiment, in order to It reduces and repeats, which is not described herein again.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in third implementation In mode.
The invention belongs to Video codings and process field, and in particular to a kind of optimized calculation method of AVC rate distortion algorithms, It is optimized in particular for the complexity and cushion space of realization.
The technical problem to be solved by the present invention is to calculate the high complexity of bring operation and huge data for standard SSD Cushion space.
The algorithm optimization scheme provided according to the present invention is embodying advantage following aspects:
1, in terms of logical complexity: under the premise of complete multiplexing criteria AVC encoder data access, being not introduced into any volume Outer calculating logic resource also eliminates pixel reconstruction process on this basis.
2, in terms of cushion space: in comparison with standard SSD calculating process, interminable data are logical between two residual computations nodes Road, the residual computations node that this algorithm provides are only the back end of two adjacent blocks, it is only necessary to which standard SSD calculates 1/10 Memory buffer space.
3, in terms of algorithm performance: standard SSD residual computations, the only pixel precision of 8 bits, and become in the IDCT damaged Alternatively complete afterwards;And the residual computations that this algorithm provides are completed in frequency-domain calculations, it is residual while having higher bit wide accuracy guarantee Poor calculating process is before idct transform, therefore, there is higher arithmetic accuracy and accuracy.
It should be noted that each module mentioned in each equipment embodiment of the present invention is all logic module, physically, One logic module can be a physical module, be also possible to a part of a physical module, can also be with multiple physics The combination of module realizes that the Physical realization of these logic modules itself is not most important, these logic modules institute reality The combination of existing function is only the key for solving technical problem proposed by the invention.In addition, in order to protrude innovation of the invention Part, there is no the technical problem relationship proposed by the invention with solution is less close for the above-mentioned each equipment embodiment of the present invention Module introduce, this does not indicate above equipment embodiment and there is no other modules.
It should be noted that in the claim and specification of this patent, such as first and second or the like relationship Term is only used to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying There are any actual relationship or orders between these entities or operation.Moreover, the terms "include", "comprise" or its Any other variant is intended to non-exclusive inclusion so that include the process, methods of a series of elements, article or Equipment not only includes those elements, but also including other elements that are not explicitly listed, or further include for this process, Method, article or the intrinsic element of equipment.In the absence of more restrictions, being wanted by what sentence " including one " limited Element, it is not excluded that there is also other identical elements in the process, method, article or apparatus that includes the element.
Although being shown and described to the present invention by referring to some of the preferred embodiment of the invention, It will be understood by those skilled in the art that can to it, various changes can be made in the form and details, without departing from this hair Bright spirit and scope.

Claims (8)

1. a kind of method of the calculation code distortion factor, which is characterized in that be preset with coefficient matrix Ef, method includes the following steps:
Predicted pixel values according to the pixel value of coded macroblocks and under current prediction mode calculate prediction residual value, and obtain The DCT coefficient X that the prediction residual value exports after discrete cosine transform;
Obtain the frequency coefficient Y that the DCT coefficient X is exported after quantifying and inverse quantization is handled;
To the DCT coefficient X through the predetermined coefficient matrix EfFrequency coefficient adjusted and the frequency coefficient Y carry out residual error It calculates, wherein the predetermined coefficient matrix EfIt is to the DCT coefficient X frequency coefficient adjustedWherein,For Matrix multiple operation;
Inverse discrete cosine transformation is carried out to the residual computations result, and is obtained and is worked as according to the output of the inverse discrete cosine transformation Coding distortion degree under preceding prediction mode.
2. the method for the calculation code distortion factor according to claim 1, which is characterized in that described " to the DCT system Number X is through the predetermined coefficient matrix EfIn the step of frequency coefficient adjusted and frequency coefficient Y progress residual computations ", Further include sub-step:
The bit bit wide of used dequantized coefficients matrix when according to the DCT coefficient X by quantization and inverse quantization processing Surplus, correspondingly to the predetermined coefficient matrix EfAmplify processing.
3. the method for the calculation code distortion factor according to claim 2, which is characterized in that the predetermined coefficient matrix EfAre as follows:
4. a kind of coding mode control method, which is characterized in that including encoding mistake as claimed any one in claims 1 to 3 The step of calculation method really spent, the coding distortion degree under the current prediction mode obtained according to the step of this method, and work as Encoder bit rate under preceding prediction mode calculates the coding cost value under current prediction mode;
Also, it also comprises the steps of:
Concentrate the prediction mode using minimum code cost value is corresponded to as the optimal of coded macroblocks in all optional prediction modes Prediction mode, the coding for the coded macroblocks.
5. a kind of system of the calculation code distortion factor, which is characterized in that be preset with coefficient matrix Ef, which comprises the following modules:
DCT coefficient obtains module, the DCT coefficient X for obtaining that prediction residual value exports after discrete cosine transform, described pre- Surveying residual values is calculated according to the pixel value and the predicted pixel values under current prediction mode of coded macroblocks;
Inverse quantization exports frequency coefficient and obtains module, exports after quantifying and inverse quantization is handled for obtaining the DCT coefficient X Frequency coefficient Y;
Logical operation module is used for the DCT coefficient X through the predetermined coefficient matrix EfFrequency coefficient adjusted and described Frequency coefficient Y carries out residual computations, wherein the predetermined coefficient matrix EfIt is to the DCT coefficient X frequency coefficient adjustedWherein,For matrix multiple operation;
Inverse discrete cosine transformation module, for carrying out inverse discrete cosine transformation to the residual computations result, and according to described anti- The output of discrete cosine transform obtains the coding distortion degree under current prediction mode.
6. the system of the calculation code distortion factor according to claim 5, which is characterized in that in the logical operation module In, further include submodule:
Bit wide surplus is aligned submodule, used inverse when for being handled according to the DCT coefficient X by quantization and inverse quantization The surplus for changing the bit bit wide of coefficient matrix, correspondingly to the predetermined coefficient matrix EfAmplify processing.
7. the system of the calculation code distortion factor according to claim 6, which is characterized in that the predetermined coefficient matrix EfAre as follows:
8. a kind of coding mode control system, which is characterized in that comprise the following modules:
Coding cost value computing module, the system comprising the calculation code distortion factor as described in any one of claim 5 to 7, Coding distortion degree under the current prediction mode obtained according to the system and the encoder bit rate under current prediction mode calculate Coding cost value under current prediction mode;
Optimal prediction modes determining module will correspond to the pre- of minimum code cost value for concentrating in all optional prediction modes Optimal prediction modes of the survey mode as coded macroblocks, the coding for the coded macroblocks.
CN201510106648.1A 2015-03-11 2015-03-11 The method and its system of the calculation code distortion factor and coding mode control Active CN106034238B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510106648.1A CN106034238B (en) 2015-03-11 2015-03-11 The method and its system of the calculation code distortion factor and coding mode control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510106648.1A CN106034238B (en) 2015-03-11 2015-03-11 The method and its system of the calculation code distortion factor and coding mode control

Publications (2)

Publication Number Publication Date
CN106034238A CN106034238A (en) 2016-10-19
CN106034238B true CN106034238B (en) 2019-04-02

Family

ID=57149790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510106648.1A Active CN106034238B (en) 2015-03-11 2015-03-11 The method and its system of the calculation code distortion factor and coding mode control

Country Status (1)

Country Link
CN (1) CN106034238B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106534870B (en) * 2016-12-19 2019-12-03 国网新疆电力公司电力科学研究院 A kind of rate-distortion optimal coding method based on RGB source video
CN108156457B (en) * 2017-12-27 2021-10-15 郑州云海信息技术有限公司 Image coding method and device for converting JPEG (Joint photographic experts group) into WebP (Web WebP)
CN109729233B (en) * 2018-11-29 2020-09-25 东软集团股份有限公司 Information hiding method and device based on image, storage medium and electronic equipment
CN116886913B (en) * 2023-08-03 2024-03-08 镕铭微电子(济南)有限公司 Rate distortion optimization quantization method, device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6173080B1 (en) * 1996-09-21 2001-01-09 Samsung Electronics Co., Ltd. Prediction method for discrete cosine transform coefficient
CN101207810A (en) * 2006-12-21 2008-06-25 联想(北京)有限公司 Method and apparatus for fast mode selecting of H264 video coding
CN101237580A (en) * 2008-02-29 2008-08-06 西北工业大学 Integer pixel quick mixing search method based on center prediction
WO2008136338A1 (en) * 2007-04-26 2008-11-13 Nec Corporation Dynamic image decoding device, dynamic image decoding program, and dynamic image decoding method
CN101677400A (en) * 2008-09-19 2010-03-24 华为技术有限公司 Coding and decoding method, coder, decoder and encoder/decoder system
CN103024392A (en) * 2012-12-26 2013-04-03 清华大学 Method and device for intra-frame mode prediction based on two-dimensional Hadamard transformation
CN104104966A (en) * 2013-04-08 2014-10-15 华为技术有限公司 Video block dividing method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6173080B1 (en) * 1996-09-21 2001-01-09 Samsung Electronics Co., Ltd. Prediction method for discrete cosine transform coefficient
CN101207810A (en) * 2006-12-21 2008-06-25 联想(北京)有限公司 Method and apparatus for fast mode selecting of H264 video coding
WO2008136338A1 (en) * 2007-04-26 2008-11-13 Nec Corporation Dynamic image decoding device, dynamic image decoding program, and dynamic image decoding method
CN101237580A (en) * 2008-02-29 2008-08-06 西北工业大学 Integer pixel quick mixing search method based on center prediction
CN101677400A (en) * 2008-09-19 2010-03-24 华为技术有限公司 Coding and decoding method, coder, decoder and encoder/decoder system
CN103024392A (en) * 2012-12-26 2013-04-03 清华大学 Method and device for intra-frame mode prediction based on two-dimensional Hadamard transformation
CN104104966A (en) * 2013-04-08 2014-10-15 华为技术有限公司 Video block dividing method and device

Also Published As

Publication number Publication date
CN106034238A (en) 2016-10-19

Similar Documents

Publication Publication Date Title
US8325804B2 (en) Video encoding with intra encoding selection
CN100586184C (en) Infra-frame prediction method
CN103650496B (en) Intra prediction pixel-based for being encoded in HEVC
CN101965734B (en) Method And Apparatus For Image Intra Prediction
CN103797800B (en) It derives reference model value and coding and decoding represents the information of prediction mode
CN104718759B (en) The simplification of LM mode
TWI471013B (en) Computational complexity and precision control in transform-based digital media codec
CN106034238B (en) The method and its system of the calculation code distortion factor and coding mode control
US20100086028A1 (en) Video encoding and decoding method and apparatus
CN106034235B (en) Method and system for calculating coding distortion degree and controlling coding mode
US10085028B2 (en) Method and device for reducing a computational load in high efficiency video coding
CN107087170A (en) Encoding device, coding method, decoding device and coding/decoding method
BR112012025307B1 (en) METHOD OF INTERPOLING AN IMAGE, EQUIPMENT FOR INTERPOLATING AN IMAGE, AND COMPUTER-READABLE RECORDING MEDIA
CN104255033A (en) Reduced look-up table for lm mode calculation
CN103456033A (en) Image processing apparatus and method for three-dimensional (3d) image
CN104429077A (en) Image encoding method, image decoding method, image encoding device, image decoding device, image encoding program, image decoding program, and recording medium
KR20090043353A (en) Method and apparatus of encoding/decoding image using diffusion property of image
CN102752596A (en) Rate distortion optimization method
CN105120282A (en) Code rate control bit distribution method of temporal dependency
EP3053337B1 (en) Encoder and method for video processing
US9106917B2 (en) Video encoding apparatus and video encoding method
CN101883283B (en) Control method for code rate of three-dimensional video based on SAQD domain
CN102780886A (en) Rate distortion optimization method
US20230319259A1 (en) Coding and decoding methods and apparatuses
Wu et al. Mode dependent down-sampling and interpolation scheme for high efficiency video coding

Legal Events

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