The content of the invention
Based on this, the purpose of the embodiment of the present invention is that forced coding code check setting can be carried out to different type of machines by providing one kind
Coding adaptation method, device, mobile terminal and storage medium.
In a first aspect, the invention provides one kind to encode adaptation method, methods described includes:
The pre-arranged code value scope being locally stored is inquired about, obtains any one encoder bit rate in the range of the pre-arranged code value
Value, and default code check value scope is calculated according to the encoder bit rate value;
Treat that adapting appts are encoded according to encoder bit rate value control, to obtain bit rate output value, and described in judgement
Whether bit rate output value is in the range of the default code check value;
If it is not, the maximum in the range of the pre-arranged code value or minimum value are then replaced with into the encoder bit rate value, and
Returned to perform according to the pre-arranged code value scope after replacement and obtain any one encoder bit rate in the range of the pre-arranged code value
The step of value, untill the bit rate output value is determined in the range of the default code check value, by the coding now
Code check value is arranged to the optimal code check for treating adapting appts.
Above-mentioned coding adaptation method, by the acquisition of the encoder bit rate value, to treat that it is suitable that adapting appts are opened described in control
With coding step, and obtain the bit rate output value for treating adapting appts, by judge the bit rate output value whether
Design in the range of the default code check value, to judge whether the encoder bit rate value that currently obtains is described to treat adapting appts
The corresponding optimal code check, improve it is described coding adaptation method accuracy, by by the encoder bit rate to described pre-
If the alternative design of encoded radio scope, to improve the probability for getting the optimal code check, by according to described pre- after replacement
If encoded radio scope returns to the design for performing the step of obtaining any one encoder bit rate value in the range of the pre-arranged code value, so that
Auto-returned continues the acquisition of the encoder bit rate value, and the encoder bit rate value for continuing to judge currently to get corresponds to
The bit rate output whether in the range of the corresponding default code check value, above-mentioned coding adaptation method automaticity compared with
Height, the acquisition of the optimal code check is carried out by way of iterative cycles adaptation, so that can be effectively to being treated described in different type of machines
The adaptation of the optimal code check is set corresponding to adapting appts progress, and then prevents the coding rate parameter and reality due to setting
The larger unsharp situation of view data caused after output of the encoder bit rate difference of output, improves the image after coding output
The definition of data.
Further, the maximum or minimum value by the range of the pre-arranged code value replaces with the encoder bit rate
The step of value, includes:
Judge the maximum whether the bit rate output value is more than in the default code check value scope;
If so, the maximum in the range of the pre-arranged code value is then replaced with into the encoder bit rate value;
If it is not, the minimum value in the range of the pre-arranged code value is then replaced with into the encoder bit rate value;
Wherein, when determining the maximum that the bit rate output value is more than in the default code check value scope, then judge
The value of the encoder bit rate set is bigger than normal, and then the maximum in the range of the pre-arranged code value is replaced with into the coding code
Rate value, so as to further reduce the acquisition scope of the encoder bit rate, improve the adaptation precision of the coding adaptation method.
Further, the maximum or minimum value by the range of the pre-arranged code value replaces with the encoder bit rate
The step of value, includes:
Judge the minimum value whether the bit rate output value is less than in the default code check value scope;
If so, the minimum value in the range of the pre-arranged code value is then replaced with into the encoder bit rate value;
If it is not, the maximum in the range of the pre-arranged code value is then replaced with into the encoder bit rate value;
Wherein, when determining the minimum value that the bit rate output value is less than in the default code check value scope, then judge
The value of the encoder bit rate set is less than normal, and then the minimum value in the range of the pre-arranged code value is replaced with into the coding code
Rate value, so as to further reduce the acquisition scope of the encoder bit rate, improve the adaptation precision of the coding adaptation method.
Further, described the step of obtaining any one encoder bit rate value in the range of the pre-arranged code value, includes:
The maximum and minimum value of the pre-arranged code value scope are obtained respectively;
The average value of sum between the maxima and minima of the pre-arranged code value scope is calculated, and the average value is set
It is set to the encoder bit rate value;
Wherein, the calculating of the average value is carried out by using the mode averaged, so as to facilitate to the coding
The setting of code check value, and then improve the acquisition efficiency to the encoder bit rate value.
Further, it is described judge the step of bit rate output value is whether in the range of default code check value before, it is described
Method also includes:
Judge the maximum whether the bit rate output value is more than in the pre-arranged code value scope, or it is default less than described
Minimum value in encoded radio scope;
When determining the maximum that the bit rate output value is more than in the pre-arranged code value scope, by the default volume
Maximum in code value scope is arranged to described and treats the optimal code check of adapting appts, and stops encoding adaptation step;
When determining the minimum value that the bit rate output value is less than in the pre-arranged code value scope, by the default volume
Minimum value in code value scope is arranged to described and treats the optimal code check of adapting appts, and stops encoding adaptation step;
Wherein, by when determining the maximum that the bit rate output value is more than in the pre-arranged code value scope, inciting somebody to action
Maximum in the pre-arranged code value scope is arranged to the design of the optimal code check, to prevent due to the bit rate output value
Endless loop caused by being more than the maximum in the pre-arranged code value scope always, and determine the bit rate output value by working as
During less than minimum value in the pre-arranged code value scope, by the minimum value in the pre-arranged code value scope be arranged to it is described most
The design of good code check, to prevent from causing because the bit rate output value is less than the minimum value in the pre-arranged code value scope always
Endless loop, and then improve it is described coding adaptation method Adaption efficiency.
Further, it is described to treat that the step of adapting appts are encoded includes according to encoder bit rate value control:
Treat that adaptation is equipped with described in initialization, the encoder bit rate is treated that adapting appts carry out parameter setting, operation to described
It is described to treat adapting appts, and treat that adapting appts open coding flow described in control, to obtain coding result;
The bit rate output value is calculated according to the coding result;
Wherein, by by it is described treat adapting appts initialize design, to prevent because other data are waited to fit to described
Influence with device coding, the accuracy that the adaptation result obtains is improved, and by the way that the encoder bit rate is treated to described
Adapting appts carry out the design of parameter setting, so as to treat that adapting appts provide a normal encoder bit rate parameter for described in, enter
And the normal operation of the encoding function for treating adapting appts is ensured.
Further, treat that the step of adapting appts open coding flow includes described in the control:
Obtain default code stream information;
According to the yuv data of the default default frame number of code stream information generation got, and the yuv data is inputted
Treat that adapting appts are encoded to described;
Wherein, by the acquisition of the default code stream information, so as to facilitate the conversion of the yuv data, and pass through by
The default code stream information is converted to the design of the yuv data of the default frame number, so as to treat that adaptation is set described in facilitating
Standby coding, improve it is described treat the code efficiency of adapting appts, and then further increase the suitable of the coding adaptation method
With efficiency.
Second aspect, the invention provides one kind to encode adaptive device, including:
Acquisition module, for inquiring about the pre-arranged code value scope being locally stored, obtain and appoint in the range of the pre-arranged code value
Anticipate an encoder bit rate value, and default code check value scope is calculated according to the encoder bit rate value;
Judge module is exported, for treating that adapting appts are encoded according to encoder bit rate value control, to be exported
Code check value, and judge the bit rate output value whether in the range of the default code check value;
Replacement module, for determining the bit rate output value not in the default code check value when the output judge module
In the range of when, the maximum in the range of the pre-arranged code value or minimum value are replaced with into the encoder bit rate value, and according to for
The pre-arranged code value scope after changing returns to the step for performing and obtaining any one encoder bit rate value in the range of the pre-arranged code value
Suddenly, untill the bit rate output value is determined in the range of the default code check value, by the encoder bit rate value now
It is arranged to the optimal code check for treating adapting appts.
Above-mentioned coding adaptive device, by the design of the acquisition module and the output judge module, with described in control
Treat that adapting appts open adaptation coding step, and obtain the bit rate output value for treating adapting appts, and by described defeated
Go out judge module judge the bit rate output value whether design in the range of the default code check value, to judge currently to obtain
The encoder bit rate value whether be it is described treat the optimal code check corresponding to adapting appts, improve the coding adaptation method
Accuracy, by the design of the replacement module, to improve the probability for getting the optimal code check, after according to replacement
The pre-arranged code value scope, which returns, performs setting for the step of obtaining any one encoder bit rate value in the range of the pre-arranged code value
Meter, so that auto-returned continues the acquisition of the encoder bit rate value, and continue to judge the coding code currently got
Whether the bit rate output corresponding to rate value is in the range of the corresponding default code check value, above-mentioned coding adaptive device automation
Degree is higher, the acquisition of the optimal code check is carried out by way of iterative cycles adaptation, so that can be effectively to different type of machines
The adaptation for treating the optimal code check corresponding to adapting appts progress is set, and then prevents the coding rate parameter due to setting
With the encoder bit rate difference of reality output it is larger cause output after the unsharp situation of view data, improve coding output after
View data definition.
The third aspect, the invention provides a kind of mobile terminal, including memory and processor, the memory is used for
Computer program is stored, the processor runs the computer program so that the mobile terminal performs above-mentioned coding adaptation
Method.
Fourth aspect, the invention provides a kind of storage medium, is stored thereon with processor in above-mentioned mobile terminal and is transported
Capable computer program.
Embodiment
For the ease of more fully understanding the present invention, the present invention is carried out further below in conjunction with related embodiment accompanying drawing
Explain.Embodiments of the invention are given in accompanying drawing, but the present invention is not limited in above-mentioned preferred embodiment.Conversely, there is provided
The purpose of these embodiments be in order that disclosure of the invention face more fully.
Because the combination of each electronic component in the equipment with encoding function of different model is different, and then make
It is inconvenient when carrying out coding parameter setting to different models of equipment to obtain, and when the coding parameter and reality that are set in equipment are defeated
When the error gone out between code check is larger, easily cause the fogging image of APP programs in system, such as Google is from Android4.1
Version starts to add the api interface of system hard coded, and APP can easily call this interface, greatly reduce CPU
Occupancy, improve coding efficiency, but because Android fragmentations are serious, the hard coded parameter set on the type having with
The encoder bit rate of reality output has a tremendous difference and when the setting for carrying out multiple different type of machines is inconvenient for operation, therefore the present invention
Purpose be to provide it is a kind of can carry out coding parameter setting automatic to different models of equipment coding adaptation method, to reduce people
Member's cost, improve the efficiency set to the coding adaptation of different models of equipment.
Referring to Fig. 1, the flow chart of the coding adaptation method provided for first embodiment of the invention, including step S10 is extremely
S50。
Step S10, inquire about the pre-arranged code value scope being locally stored;
Wherein, the inquiry of the pre-arranged code value scope is just carried out when receiving coding adaptation signal, and the coding
The transmission means of adaptation signal can be push button signalling transmission, transmitting voice signal, infrared signal transmission or touching signals transmission
Etc. mode, and then facilitate the operation of user so that the mode variation that the coding adaptation method is opened, the pre-arranged code
Value may range from any range, it is preferred that the maximum in the scope of pre-arranged code value described in the present embodiment is Bmax, minimum
Be worth for Bmin, now the pre-arranged code value scope be Bmin to Bmax, and the pre-arranged code value scope being locally stored
Quantity can be multiple, and the pre-arranged code value scope is used to conveniently treat the code check setting that adapting appts carry out first time, with
Make guarantee to the normally-open of the adaptation step for treating adapting appts.
Step S20, any one encoder bit rate value in the range of the pre-arranged code value is obtained, and according to the encoder bit rate value
Calculate default code check value scope;
Wherein, obtain any one encoder bit rate value in the range of the pre-arranged code value mode can use take out at random
The mode that takes, in the way of default label, sequentially obtain from big to small in the way of or carry out in the way of sequentially obtaining from small to large
Obtain, it is possible to understand that the present embodiment be not limited only to above-mentioned acquisition modes.
By the acquisition of the encoder bit rate in the present embodiment, so as to facilitate to the coding parameter for treating adapting appts
Setting, the mode that the default code check value scope is calculated according to the encoder bit rate value is the coding code that will be got
Rate value is multiplied by 0.9 times, to obtain the first encoder bit rate threshold value, the encoder bit rate value got is multiplied by into 1.1 times, to obtain
Second encoder bit rate threshold value, and the first encoder bit rate threshold value is arranged to the minimum value in the default code check value scope,
The second encoder bit rate threshold value is arranged to the maximum in the default code check value scope, to obtain the default code check value
Scope;
In the present embodiment, the encoder bit rate value got is Z, now the pre-arranged code value scope be 0.9Z extremely
1.1Z。
Step S30, treat that adapting appts are encoded according to encoder bit rate value control, to obtain bit rate output value, and
Judge the bit rate output value whether in the range of the default code check value;
Wherein, after getting the encoder bit rate and the pre-arranged code value scope is calculated, institute is sent a signal to
State and treat adapting appts, the encoded test for treating adapting appts is started with control, treat that adapting appts complete encoded test when described
Afterwards, the acquisition of the bit rate output value is carried out, and judges the bit rate output value whether in the range of the default code check value, with
Judge whether be now optimal code check to the encoder bit rate for treating that adapting appts are set;
Whether in the present embodiment, the bit rate output value is arranged to Y, that is, judge Y in the range of 0.9Z to 1.1Z.
When the step S30 determines the bit rate output value not in the range of the default code check value, step is performed
S40;
Wherein, when determining Y not in the range of 0.9Z to 1.1Z, then judge that Y is not described to treat the described of adapting appts
Optimal code check.
Step S40, the maximum in the range of the pre-arranged code value or minimum value are replaced with into the encoder bit rate value, and
Return and perform step S20.
Wherein, returned to perform to obtain according to the pre-arranged code value scope after replacement and appointed in the range of the pre-arranged code value
The step of encoder bit rate value of anticipating, i.e., when determining Y not in the range of 0.9Z to 1.1Z, by the pre-arranged code value scope
0.9Z or 1.1Z replace with Z, to obtain the new pre-arranged code value scope, now replace after the pre-arranged code value model
Enclose less than the pre-arranged code value scope before replacing, and then serve the effect to reduce the scope.
Returned in the present embodiment after replacing and obtaining the new pre-arranged code value scope and perform any encoder bit rate
The acquisition of value, and sequentially circulate the calculating of the progress default code check value scope repeatedly, re-start and described treat adapting appts
Coding parameter after the bit rate output value that exports and the default code check value scope judgement, it is possible to understand that, when to institute
When stating encoder bit rate value and being reacquired, the pre-arranged code value scope is with the change meeting of the different encoder bit rate values
Change, but maximum in the range of the pre-arranged code value and minimum value and the encoder bit rate value that now gets
Multiple proportion does not change, i.e., the described maximum stated in the range of pre-arranged code value and minimum value are described with now getting
The multiple proportion of encoder bit rate value is respectively 1.1 times and 0.9 times, it is possible to understand that, it is described in other embodiments to state default volume
The multiple proportion of the encoder bit rate value of maximum and minimum value with now getting in the range of code value can also be other
Multiple proportion, but multiple proportion will not change described in same embodiment.
Step S40 described in the present embodiment is until the step S30 determines the bit rate output value in the code presupposition
Just stop when in the range of rate value, and then cause by using circulation carrying out to the code check parameter for treating adapting appts repeatedly
Adaptation is set, until get the optimal code check, and then to treated described in different type of machines adapting appts can reach it is described most
The effect that the adaptation of good code check is set so that the coding adaptation method use range is wide, versatile.
When the step S30 determines the bit rate output value in the range of default code check value, step S50 is performed.
Step S50, the encoder bit rate value now is arranged to the optimal code check for treating adapting appts.
Wherein, when the step 30 or by the step S40 return the step S20 to the step S30 when, judge
To the bit rate output value in the range of the default code check value when, now the encoder bit rate value will be arranged to described and wait to be adapted to
The optimal code check of equipment;
Specifically, the optimal code check now will be arranged to the Z for treating that adapting appts are set.
The present embodiment is walked by the acquisition of the encoder bit rate value with treating that adapting appts open adaptation coding described in control
Suddenly, and the bit rate output value for treating adapting appts is obtained, by judging the bit rate output value whether described default
Design in the range of code check value, to judge whether the encoder bit rate value that currently obtains is described to treat institute corresponding to adapting appts
State optimal code check, improve it is described coding adaptation method accuracy, by by the encoder bit rate to the pre-arranged code value
The alternative design of scope, to improve the probability for getting the optimal code check, by according to the pre-arranged code value after replacement
Scope returns to the design for performing the step of obtaining any one encoder bit rate value in the range of the pre-arranged code value, so that auto-returned
Continue the acquisition of the encoder bit rate value, and continue described defeated corresponding to the encoder bit rate value that judgement is currently got
Go out code check whether in the range of the corresponding default code check value, above-mentioned coding adaptation method automaticity is higher, by anti-
Multiple circulation adaptation mode carries out the acquisition of the optimal code check, so that can be effectively to treating that adapting appts enter described in different type of machines
The adaptation of the optimal code check is set corresponding to row, and then prevents the coding of the coding rate parameter and reality output due to setting
The larger unsharp situation of view data caused after output of code check difference, improve the clear of the view data after coding output
Degree.
Referring to Fig. 2, the flow chart of the coding adaptation method provided for second embodiment of the invention, methods described include step
Rapid S11 to S101.
Step S11, inquire about the pre-arranged code value scope being locally stored;
Wherein, the inquiry of the pre-arranged code value scope is just carried out when receiving coding adaptation signal, and the coding
The transmission means of adaptation signal can be push button signalling transmission, transmitting voice signal, infrared signal transmission or touching signals transmission
Etc. mode, and then facilitate the operation of user so that the mode variation that the coding adaptation method is opened, the pre-arranged code
Value may range from any range, it is preferred that the maximum in the scope of pre-arranged code value described in the present embodiment is Bmax, minimum
Be worth for Bmin, now the pre-arranged code value scope be Bmin to Bmax, and the pre-arranged code value scope being locally stored
Quantity can be multiple, and the pre-arranged code value scope is used to conveniently treat the code check setting that adapting appts carry out first time, with
Make guarantee to the normally-open of the adaptation step for treating adapting appts.
Step S21, the maximum and minimum value of the pre-arranged code value scope are obtained respectively;
Step S31, the average value of sum between the maxima and minima of the pre-arranged code value scope is calculated, will be described flat
Average is arranged to encoder bit rate value, and calculates default code check value scope according to the encoder bit rate value;
Wherein, obtain any one encoder bit rate value in the range of the pre-arranged code value mode can use take out at random
The mode that takes, in the way of default label, sequentially obtain from big to small in the way of or carry out in the way of sequentially obtaining from small to large
Obtain, it is preferred that the acquisition of the encoder bit rate value is carried out in the present embodiment by the way of averaging, so as to facilitate pair
The setting of the encoder bit rate value, and then improve the acquisition efficiency to the encoder bit rate value, i.e. Z=(Bmin+Bmax)/2,
It is appreciated that the present embodiment be not limited only to above-mentioned acquisition modes;
By the acquisition of the encoder bit rate in the present embodiment, so as to facilitate to the coding parameter for treating adapting appts
Setting, the mode that the default code check value scope is calculated according to the encoder bit rate value is the coding code that will be got
Rate value is multiplied by 0.9 times, to obtain the first encoder bit rate threshold value, the encoder bit rate value got is multiplied by into 1.1 times, to obtain
Second encoder bit rate threshold value, and the first encoder bit rate threshold value is arranged to the minimum value in the default code check value scope,
The second encoder bit rate threshold value is arranged to the maximum in the default code check value scope, to obtain the default code check value
Scope, i.e., described default code check value scope is 0.9Z to 1.1Z.
Step S41, treat that adaptation is equipped with described in initialization, the encoder bit rate is treated that adapting appts carry out parameter and set to described
Put, adapting appts are treated described in operation;
Wherein, by by it is described treat adapting appts initialize design, to prevent because other data are waited to fit to described
Influence with device coding, the accuracy that the adaptation result obtains is improved, and by the way that the encoder bit rate is treated to described
Adapting appts carry out the design of parameter setting, so as to treat that adapting appts provide a normal encoder bit rate parameter for described in, enter
And the normal operation of the encoding function for treating adapting appts is ensured.
Step S51, default code stream information is obtained, default frame number is generated according to the default code stream information got
Yuv data, and the yuv data is inputted to described and treats that adapting appts are encoded;
Wherein, by the acquisition of the default code stream information, so as to facilitate the conversion of the yuv data, and pass through by
The default code stream information is converted to the design of the yuv data of the default frame number, so as to treat that adaptation is set described in facilitating
Standby coding, improve it is described treat the code efficiency of adapting appts, and then further increase the suitable of the coding adaptation method
With efficiency.
Specifically, being inputted when by the yuv data to described after adapting appts are encoded, the coding knot can obtain
During fruit, and the bit rate output value can be calculated according to the coding result.
Treated described in the present embodiment adaptation set in encode be apart from flow:
(1) encoder is initialized, sets coding parameter, wherein the code check parameters such as the width of video, height, code check to be arranged to
The encoder bit rate value now got;
(2) 2000 frame yuv datas are generated using mathematical function;
(3) yuv data is input into encoder to be encoded;
(4) actual code check is calculated according to output code flow, the actual code check is the bit rate output.
Step S61, judge the bit rate output value whether in the range of default code check value;
Wherein, whether the bit rate output value is arranged to Y, that is, judge Y in the range of 0.9Z to 1.1Z.
When the step S61 is when determining the bit rate output value not in the range of the default code check value, step is performed
Rapid S71.
Step S71, judges whether the bit rate output value is more than 1.1 times of the encoder bit rate value;
Wherein, that is, judge whether Y is more than 1.1Z.
When the step S71, which determines the bit rate output value, is more than 1.1 times of the encoder bit rate value, step is performed
S81。
Step S81, the maximum in the range of the pre-arranged code value is replaced with into the encoder bit rate value, and according to replacement
The pre-arranged code value scope afterwards, which returns, performs step S21.
Wherein, when determining the maximum that the bit rate output value is more than in the default code check value scope, then judge
The value of the encoder bit rate set is bigger than normal, and then the maximum in the range of the pre-arranged code value is replaced with into the coding code
Rate value, Z that will be now replace with 1.1Z, so as to further reduce the acquisition scope of the encoder bit rate, improve the volume
The adaptation precision of code adaptation method, such as when the encoder bit rate value is 4, the pre-arranged code value scope is 3.6 to 4.4,
Now the maximum 4.4 in the default code check value scope is replaced, so that the pre-arranged code value after being replaced
Scope 3.6 to 4, and returned according to the pre-arranged code value scope after replacement and perform step S21.
When the step S71, which determines the bit rate output value, is not more than 1.1 times of the encoder bit rate value, then judge
The bit rate output value is less than 0.9 times of the encoder bit rate value, performs step S91.
Step S91, the minimum value in the range of the pre-arranged code value is replaced with into the encoder bit rate value, and according to replacement
The pre-arranged code value scope afterwards, which returns, performs step S21.
Wherein, when determining the minimum value that the bit rate output value is less than in the default code check value scope, then judge
The value of the encoder bit rate set is less than normal, and then the minimum value in the range of the pre-arranged code value is replaced with into the coding code
Rate value, Z that will be now replace with 0.9Z, so as to further reduce the acquisition scope of the encoder bit rate, improve the volume
The adaptation precision of code adaptation method, such as when the encoder bit rate value is 4, the pre-arranged code value scope is 3.6 to 4.4,
Now the minimum value 3.6 in the default code check value scope is replaced, so that the pre-arranged code value after being replaced
Scope 4 to 4.4, and the step S21 is returned to according to the pre-arranged code value scope after replacement.
Wherein, the step S71 can also be:Judge whether the bit rate output value is less than 0.9 times of the coding code
Rate value;
When determining the encoder bit rate value of the bit rate output value less than 0.9 times, the step S81 is:By institute
State the minimum value in the range of pre-arranged code value and replace with the encoder bit rate value, and according to the pre-arranged code value model after replacement
Enclose return and perform step S21.
When determining the encoder bit rate value of the bit rate output value not less than 0.9 times, the step S91 is:Will
Maximum in the range of the pre-arranged code value replaces with the encoder bit rate value, and according to the pre-arranged code value after replacement
Scope, which returns, performs step S21.
By judging whether the bit rate output value is less than 0.9 times of the encoder bit rate value or more than described in 1.1 times
The design of encoder bit rate value, judge presently described encoder bit rate whether be the optimal code check mode variation.
When the step S61 is when determining the bit rate output value in the range of the default code check value, step is performed
S101。
Step S101, the now encoder bit rate value is arranged to the optimal code check for treating adapting appts.
Wherein, when the step 61, the step S21 to the step S61 returned to by the step S81 or pass through institute
When stating the step S91 return step S21 to the step S61, the bit rate output value is determined in the default code check value
In the range of when, the now encoder bit rate value is arranged to the optimal code check for treating adapting appts;
Specifically, the optimal code check now will be arranged to the Z for treating that adapting appts are set.
It is described before the step S61 judges the step of bit rate output value is whether in the range of default code check value
Method also includes:
Judge the maximum whether the bit rate output value is more than in the pre-arranged code value scope, or it is default less than described
Minimum value in encoded radio scope;
When determining the maximum that the bit rate output value is more than in the pre-arranged code value scope, by the default volume
Maximum in code value scope is arranged to described and treats the optimal code check of adapting appts, and stops encoding adaptation step;
When determining the minimum value that the bit rate output value is less than in the pre-arranged code value scope, by the default volume
Minimum value in code value scope is arranged to described and treats the optimal code check of adapting appts, and stops encoding adaptation step.
, will be described pre- by when determining the bit rate output value more than maximum in the pre-arranged code value scope
If the maximum in encoded radio scope is arranged to the design of the optimal code check, to prevent because the bit rate output value is big always
Endless loop caused by maximum in the pre-arranged code value scope, and it is less than institute by the way that the bit rate output value ought be determined
When stating the minimum value in pre-arranged code value scope, the minimum value in the pre-arranged code value scope is arranged to the optimal code check
Design, with prevent due to the bit rate output value always be less than the pre-arranged code value scope in minimum value caused by extremely follow
Ring, and then improve the Adaption efficiency of the coding adaptation method.
The present embodiment is walked by the acquisition of the encoder bit rate value with treating that adapting appts open adaptation coding described in control
Suddenly, and the bit rate output value for treating adapting appts is obtained, by judging the bit rate output value whether described default
Design in the range of code check value, to judge whether the encoder bit rate value that currently obtains is described to treat institute corresponding to adapting appts
State optimal code check, improve it is described coding adaptation method accuracy, by by the encoder bit rate to the pre-arranged code value
The alternative design of scope, to improve the probability for getting the optimal code check, by according to the pre-arranged code value after replacement
Scope returns to the design for performing the step of obtaining any one encoder bit rate value in the range of the pre-arranged code value, so that auto-returned
Continue the acquisition of the encoder bit rate value, and continue described defeated corresponding to the encoder bit rate value that judgement is currently got
Go out code check whether in the range of the corresponding default code check value, above-mentioned coding adaptation method automaticity is higher, by anti-
Multiple circulation adaptation mode carries out the acquisition of the optimal code check, so that can be effectively to treating that adapting appts enter described in different type of machines
The adaptation of the optimal code check is set corresponding to row, and then prevents the coding of the coding rate parameter and reality output due to setting
The larger unsharp situation of view data caused after output of code check difference, improve the clear of the view data after coding output
Degree.
Referring to Fig. 3, the structural representation of the coding adaptive device 100 provided for third embodiment of the invention, including:
Acquisition module 10, for inquiring about the pre-arranged code value scope being locally stored, obtain in the range of the pre-arranged code value
Any one encoder bit rate value, and default code check value scope is calculated according to the encoder bit rate value;
Judge module 20 is exported, it is defeated to obtain for treating that adapting appts are encoded according to encoder bit rate value control
Go out code check value, and judge the bit rate output value whether in the range of the default code check value;
Replacement module 30, for determining the bit rate output value not in the code presupposition when the output judge module 20
When in the range of rate value, the maximum in the range of the pre-arranged code value or minimum value are replaced with into the encoder bit rate value, and root
Return to perform according to the pre-arranged code value scope after replacement and obtain any one encoder bit rate value in the range of the pre-arranged code value
The step of, untill the bit rate output value is determined in the range of the default code check value, by the coding code now
Rate value is arranged to the optimal code check for treating adapting appts.
The replacement module 30 includes:
First sub- replacement module 31, for judging whether the bit rate output value is more than in the default code check value scope
Maximum, if so, the maximum in the range of the pre-arranged code value then is replaced with into the encoder bit rate value, if it is not, then by institute
State the minimum value in the range of pre-arranged code value and replace with the encoder bit rate value.
Second sub- replacement module 32, for judging whether the bit rate output value is less than in the default code check value scope
Minimum value, if so, the minimum value in the range of the pre-arranged code value then is replaced with into the encoder bit rate value, if it is not, then by institute
State the maximum in the range of pre-arranged code value and replace with the encoder bit rate value.
The acquisition module 10 includes:
Sub-acquisition module 11, for obtaining the maximum and minimum value of the pre-arranged code value scope respectively;
First computing module 12, for the acquisition result according to the sub-acquisition module 10, calculate the pre-arranged code value
The average value of sum between the maxima and minima of scope, and the average value is arranged to the encoder bit rate value, and according to
The encoder bit rate value calculates default code check value scope.
The output judge module 20 includes:
Coding module 21, for initialize it is described treat that adaptation is equipped with, the encoder bit rate is treated that adapting appts enter to described
Row parameter setting, adapting appts are treated described in operation, and treat that adapting appts open coding flow described in controlling, to obtain coding knot
Fruit.
Second computing module 22, the coding result for being obtained according to the coding module 21 are calculated described defeated
Go out code check value.
The coding module 21 includes:
Code stream conveyor module 211, for obtaining default code stream information, generated according to the default code stream information got
The yuv data of default frame number, and the yuv data is inputted to described and treats that adapting appts are encoded.
Above-mentioned coding adaptive device 100, by the design of the acquisition module 10 and the output judge module 20, with control
Treat that adapting appts open adaptation coding step described in system, and obtain it is described treat the bit rate output value of adapting appts, and pass through
It is described output judge module 20 judge the bit rate output value whether the design in the range of the default code check value, with judge work as
The encoder bit rate value of preceding acquisition whether be it is described treat the optimal code check corresponding to adapting appts, it is suitable to improve the coding
The accuracy of method of completing the square, by the design of the replacement module 30, to improve the probability for getting the optimal code check, pass through root
Return to perform according to the pre-arranged code value scope after replacement and obtain any one encoder bit rate value in the range of the pre-arranged code value
The step of design so that auto-returned continues the acquisition of the encoder bit rate value, and continue to judge what is currently got
Whether the bit rate output corresponding to the encoder bit rate value is in the range of the corresponding default code check value, above-mentioned coding adaptation
The automaticity of device 100 is higher, the acquisition of the optimal code check is carried out by way of iterative cycles adaptation, so that can be effective
To treated described in different type of machines adapting appts carry out corresponding to the adaptation of the optimal code check set, and then prevent due to setting
Coding rate parameter and reality output encoder bit rate difference it is larger cause output after the unsharp situation of view data, improve
The definition of view data after coding output.
Referring to Fig. 4, the structural representation of the coding adaptive device 100 provided for fourth embodiment of the invention, the 4th
The structure of embodiment and 3rd embodiment is more or less the same, and its difference is, adaptive device 100 is encoded described in the present embodiment and is also wrapped
Include:
Threshold value judgment module 40, for judging whether the bit rate output value is more than in the pre-arranged code value scope most
Big value, or less than the minimum value in the pre-arranged code value scope.
First setup module 41, for determining the bit rate output value more than described pre- when the threshold value judgment module 40
If during maximum in encoded radio scope, the maximum in the pre-arranged code value scope is arranged to described and treats adapting appts
Optimal code check, and stop encoding adaptation step.
Second setup module 42, for determining the bit rate output value less than described pre- when the threshold value judgment module 40
If during minimum value in encoded radio scope, the minimum value in the pre-arranged code value scope is arranged to described and treats adapting appts
Optimal code check, and stop encoding adaptation step.
In the present embodiment, by the threshold value judgment module 40 to the bit rate output value and the pre-arranged code value model
The judgement design of maximum or minimum value in enclosing, so as to be more than the pre-arranged code value model when determining the bit rate output value
During maximum in enclosing, the maximum in the pre-arranged code value scope is arranged to the design of the optimal code check, to prevent
Endless loop caused by the maximum being more than always in the pre-arranged code value scope due to the bit rate output value, and work as and determine
When the bit rate output value is less than the minimum value in the pre-arranged code value scope, by the minimum in the pre-arranged code value scope
Value is arranged to the design of the optimal code check, to prevent because the bit rate output value is less than the pre-arranged code value scope always
In minimum value caused by endless loop, and then improve it is described coding adaptive device 100 Adaption efficiency.
The present embodiment additionally provides a kind of mobile terminal, including memory and processor, and the memory is used to store
Computer program, the processor runs the computer program so that the mobile terminal performs above-mentioned coding adaptation side
Method.
The present embodiment additionally provides a kind of storage medium, is stored thereon with the meter that processor is run in above-mentioned mobile terminal
Calculation machine program, the program upon execution, comprise the following steps:
The pre-arranged code value scope being locally stored is inquired about, obtains any one encoder bit rate in the range of the pre-arranged code value
Value, and default code check value scope is calculated according to the encoder bit rate value;
Treat that adapting appts are encoded according to encoder bit rate value control, to obtain bit rate output value, and described in judgement
Whether bit rate output value is in the range of the default code check value;
If it is not, the maximum in the range of the pre-arranged code value or minimum value are then replaced with into the encoder bit rate value, and
Returned to perform according to the pre-arranged code value scope after replacement and obtain any one encoder bit rate in the range of the pre-arranged code value
The step of value, untill the bit rate output value is determined in the range of the default code check value, by the coding now
Code check value is arranged to the optimal code check for treating adapting appts.Described storage medium, such as:ROM/RAM, magnetic disc, CD etc..
Above embodiment described the technical principle of the present invention, the description is merely to explain the principles of the invention, and
The limitation of the scope of the present invention can not be construed in any way.Based on explanation herein, those skilled in the art is not required to
Other embodiments of the present invention can be associated by paying performing creative labour, and these modes fall within the present invention's
In protection domain.