Summary of the invention
Technical problem to be solved by this invention is to provide the fast encoding method of a kind of HEVC, and it, under the prerequisite ensureing video quality, can reduce encoder complexity effectively.
The present invention solves the problems of the technologies described above adopted technical scheme: the fast encoding method of a kind of HEVC, it is characterized in that comprising the following steps:
1. be present frame by pending frame definition current in HD video;
2. maximum coding unit to be encoded current in present frame is defined as current maximum coding unit;
3. according to frame type and the current maximum coding unit position in the current frame of present frame, the maximum coding unit of all predictions of current maximum coding unit is determined; Then be the prediction sets of current maximum coding unit by the sets definition that the maximum coding unit of all predictions by current maximum coding unit is formed, and be designated as Ω, wherein, Ω for the maximum coding unit comprised in empty set or Ω be at least one in L, T and COL, L represents the adjacent maximum coding unit in the left side of current maximum coding unit, T represents the adjacent maximum coding unit in the top of current maximum coding unit, and COL represents maximum coding unit identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame;
4. D is made
predrepresent the depth prediction value of current maximum coding unit, then establish D
predvalue and the one-to-one relationship in extreme saturation interval of current maximum coding unit, wherein, D
predvalue do not exist or D
predvalue be real number, and 0≤D
pred≤ 3;
If 5. Ω is in L, T and COL two for the maximum coding unit that comprises in empty set or Ω for the maximum coding unit comprised in L, T and COL or Ω, then determine D
predvalue do not exist, then perform step 7.; If the maximum coding unit comprised in Ω is L, T and COL, then determine D
predvalue be real number, and 0≤D
pred≤ 3, then perform step 6.;
6. by obtaining the time domain similarity TS of current maximum coding unit and the spatial domain similarity LAS of the spatial domain similarity TAS of T, current maximum coding unit and L, current maximum coding unit and COL, D is calculated
predvalue,
wherein, 1≤m≤3,1≤i≤256, and m and i is integer, ω
mrepresent the individual weight shared by maximum coding unit of m in Ω, the ω as m=1
m=LAS, the ω as m=2
m=TAS, the ω as m=3
m=TS,
i-th size in m maximum coding unit in expression Ω is the depth value of the basic unit of storage of 4 × 4;
7. according to D
predvalue and the one-to-one relationship in extreme saturation interval of current maximum coding unit, determine that the extreme saturation of current maximum coding unit is interval; Then according to the extreme saturation interval of current maximum coding unit, each coding unit in current maximum coding unit and current maximum coding unit is encoded, in an encoding process, if the frame at current maximum coding unit place is P frame in HD video or B frame, then when the proper discernable distortion value of mean time spatial domain human eye of each coding unit in current maximum coding unit or current maximum coding unit is less than the Low threshold T of setting
1or be greater than the high threshold T of setting
2then each coding unit in current maximum coding unit or current maximum coding unit is carried out to the selection of fast prediction pattern, use skip, merge, inter2N × 2N and intra2N × 2N predictive mode to carry out traversal coding respectively to each coding unit in current maximum coding unit or current maximum coding unit, choose rate distortion costs and be worth minimum predictive mode as optimal prediction modes;
8. using maximum coding unit to be encoded next in present frame as current maximum coding unit, then return step and 3. continue to perform, until all maximum coding unit in present frame is all encoded complete;
9. using frame pending for next frame in HD video as present frame, then return step 2. continue perform, until all frames in HD video are all disposed, so far complete the fast coding of HD video.
Described step 3. in the deterministic process of maximum coding unit of all predictions of current maximum coding unit be:
If present frame is the I frame in HD video, then, when current maximum coding unit is the 1st maximum coding unit in present frame, determine the maximum coding unit that current maximum coding unit is not predicted; When current maximum coding unit is all the other the maximum coding units in the maximum coding unit of the 1st row of present frame except the 1st maximum coding unit, determine that the adjacent maximum coding unit T in the top of current maximum coding unit is the maximum coding unit of the prediction of current maximum coding unit; When current maximum coding unit is all the other the maximum coding units in the maximum coding unit of the 1st row of present frame except the 1st maximum coding unit, determine that the adjacent maximum coding unit L in the left side of current maximum coding unit is the maximum coding unit of the prediction of current maximum coding unit; When current maximum coding unit is all the other the maximum coding units in present frame except the 1st maximum coding unit of row and the maximum coding unit of the 1st row, determine that the adjacent maximum coding unit L in the left side of current maximum coding unit maximum coding unit T adjacent with top is the maximum coding unit of the prediction of current maximum coding unit;
If present frame is P frame in HD video or B frame, then when current maximum coding unit is the 1st maximum coding unit in present frame, determine that maximum coding unit COL identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame is the maximum coding unit of the prediction of current maximum coding unit; When current maximum coding unit is all the other the maximum coding units in the maximum coding unit of the 1st row of present frame except the 1st maximum coding unit, determine that the adjacent maximum coding unit T in the top of current maximum coding unit and maximum coding unit COL identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame are the maximum coding unit of the prediction of current maximum coding unit; When current maximum coding unit is all the other the maximum coding units in the maximum coding unit of the 1st row of present frame except the 1st maximum coding unit, determine that the adjacent maximum coding unit L in the left side of current maximum coding unit and maximum coding unit COL identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame are the maximum coding unit of the prediction of current maximum coding unit; When current maximum coding unit is all the other the maximum coding units in present frame except the 1st maximum coding unit of row and the maximum coding unit of the 1st row, determine that in the forward reference frame of the adjacent maximum coding unit L in the left side of current maximum coding unit maximum coding unit T adjacent with top and present frame, the maximum coding unit COL identical with the coordinate position of current maximum coding unit is the maximum coding unit of the prediction of current maximum coding unit.
Described step is middle D 4.
predvalue and the one-to-one relationship in extreme saturation interval of current maximum coding unit be: work as D
predwhen=0, the extreme saturation interval of current maximum coding unit is [0,0]; Work as 0<D
predwhen≤0.5, the extreme saturation interval of current maximum coding unit is [0,1]; Work as 0.5<D
predwhen≤1.5, the extreme saturation interval of current maximum coding unit is [0,2]; Work as 1.5<D
predwhen≤2.5, the extreme saturation interval of current maximum coding unit is [1,3]; Work as 2.5<D
predwhen≤3, the extreme saturation interval of current maximum coding unit is [2,3]; Work as D
predvalue when not existing, the extreme saturation interval of current maximum coding unit is [0,3].
Described step detailed process is 6.:
6. the mean depth between the adjacent maximum coding unit L-COL in the left side-1, calculating maximum coding unit identical with the coordinate position of current maximum coding unit in the adjacent maximum coding unit L in the left side of current maximum coding unit and the forward reference frame of present frame is poor, be designated as ADD1
and mean depth between the adjacent maximum coding unit T-COL in top of maximum coding unit identical with the coordinate position of current maximum coding unit in the forward reference frame of the adjacent maximum coding unit T in the top calculating current maximum coding unit and present frame is poor, be designated as ADD2
then calculate the mean value of ADD1 and ADD2, be designated as ADD, ADD=(ADD1+ADD2)/2; Wherein, 1≤i≤256, and be integer,
i-th size in expression L is the depth value of the basic unit of storage of 4 × 4,
i-th size in expression L-COL is the depth value of the basic unit of storage of 4 × 4,
i-th size in expression T is the depth value of the basic unit of storage of 4 × 4,
i-th size in expression T-COL is the depth value of the basic unit of storage of 4 × 4,
span be [0,3], and be integer, symbol " || " is the symbol that takes absolute value;
-2 6., calculate the spatial domain similarity of the adjacent maximum coding unit T in top of current maximum coding unit and current maximum coding unit, be designated as TAS, TAS=0.05 × ADD+0.25; And the spatial domain similarity of the adjacent maximum coding unit L in the left side calculating current maximum coding unit and current maximum coding unit, be designated as LAS, LAS=0.05 × ADD+0.25; Meanwhile, calculate current maximum coding unit and the time domain similarity of maximum coding unit COL identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame, be designated as TS, TS=-0.1 × ADD+0.5;
6.-3, D is calculated
predvalue,
wherein, 1≤m≤3, and be integer, ω
mrepresent the individual weight shared by maximum coding unit of m in Ω, the ω as m=1
m=LAS, the ω as m=2
m=TAS, the ω as m=3
m=TS,
i-th size in m maximum coding unit in expression Ω is the depth value of the basic unit of storage of 4 × 4.
Described step 7. according to the extreme saturation interval of current maximum coding unit to the detailed process that each coding unit in current maximum coding unit and current maximum coding unit is encoded be:
-1 7., pending coding unit current in the extreme saturation interval of current maximum coding unit is defined as current coded unit, the layer at current coded unit place is defined as current layer;
7.-2, JND is used
tsrepresent the proper discernable distortion value of mean time spatial domain human eye of current coded unit, if present frame is the I frame in HD video, then determine JND
tsvalue do not exist, then perform step 7.-3; If present frame is P frame in HD video or B frame, then calculate JND
tsvalue,
then step 7.-3 is performed, wherein, (x, y) represents the coordinate position of the pixel in current coded unit, 0≤x≤K-1,0≤y≤G-1, and be all integer, K represents total number of one-row pixels point in current coded unit, G represents total number of a row pixel in current coded unit, JND (x, y) represents that in current coded unit, coordinate position is the proper discernable distortion value of time-space domain human eye of the pixel of (x, y);
7.-3, JND is worked as
tsvalue when not existing, use intra2N × 2N and intraN × N predictive mode to encode respectively to current coded unit, choose rate distortion costs and be worth the optimal prediction modes of minimum predictive mode as current coded unit, then perform step 7.-4; Work as JND
tsvalue when existing, judge JND
tsvalue whether be less than the Low threshold T of setting
1or be greater than the high threshold T of setting
2if, then judge that current coded unit carries out the selection of fast prediction pattern, skip, merge, inter2N × 2N and intra2N × 2N predictive mode is used to carry out traversal coding respectively to current coded unit, choose rate distortion costs and be worth the optimal prediction modes of minimum predictive mode as current coded unit, then perform step 7.-4; Otherwise, judge that current coded unit does not carry out the selection of fast prediction pattern, skip, merge, inter2N × 2N, inter2N × N, interN × 2N, AMP, intra2N × 2N and intraN × N predictive mode is used entirely to travel through coding respectively to current coded unit, choose rate distortion costs and be worth the optimal prediction modes of minimum predictive mode as current coded unit, then perform step 7.-4; Wherein, the value of the N in inter2N × 2N, inter2N × N, interN × 2N, intra2N × 2N and intraN × N is the half of total number of one-row pixels point or a row pixel in current coded unit;
7.-4, judge whether the depth value of current coded unit is less than the maximum in the extreme saturation interval of current maximum coding unit, if, then current coded unit is divided into further lower one deck coding unit that four sizes are identical, then using current pending coding unit in this lower one deck coding unit as current coded unit, using the layer at current coded unit place as current layer, then return step 7.-2 continuation execution; Otherwise, determine that current coded unit cataloged procedure terminates, then perform step 7.-5;
-5 7., judge whether all coding units in the extreme saturation interval of current maximum coding unit are all disposed, if so, then determine that current maximum encoding unit encodes process terminates, then perform step 8., otherwise, judge whether four coding units in current layer are all disposed, if four coding units in current layer are all disposed, then using pending coding unit next in the last layer coding unit of current layer as current coded unit, and using the layer at current coded unit place as current layer, then step 7.-2 continuation execution are returned, if four coding units in current layer are untreated complete, then using pending coding unit next in current layer as current coded unit, and using the layer at current coded unit place as current layer, then step 7.-2 continuation execution are returned.
7. described step gets T in-3
1=3.5, get T
2=10.
Compared with prior art, the invention has the advantages that:
1) the inventive method takes full advantage of the spatial domain similarity of the time domain similarity of the maximum coding unit identical with coordinate position in the forward reference frame of the frame at this maximum coding unit place of the maximum coding unit in HD video cataloged procedure and the adjacent maximum coding unit in the left side of maximum coding unit and this maximum coding unit, the spatial domain similarity of the adjacent maximum coding unit in top of maximum coding unit and this maximum coding unit, calculate the depth prediction value of the P frame in HD video or the maximum coding unit in B frame, then the extreme saturation of maximum coding unit is interval to utilize the depth prediction value of maximum coding unit and the one-to-one relationship in extreme saturation interval to determine, in extreme saturation interval, each coding unit in maximum coding unit and maximum coding unit is encoded, in an encoding process fast prediction model selection is carried out to each coding unit satisfied condition in the maximum coding unit satisfied condition in P frame or B frame and maximum coding unit, effectively reduce the unnecessary extreme saturation in cutting procedure and the unnecessary predictive mode traversal in forecasting process, thus under the prerequisite ensureing video quality, reduce the computation complexity of Video coding.
2) the inventive method carries out traveling through in the process of coding in extreme saturation interval range, the proper discernable distortion value of mean time spatial domain human eye of coding unit is utilized to instruct the quick selection of predictive mode, decrease unnecessary predictive mode traversal, thus reduce the computation complexity of Video coding.
Embodiment
Below in conjunction with accompanying drawing embodiment, the present invention is described in further detail.
The fast encoding method of a kind of HEVC that the present invention proposes, it totally realizes block diagram as shown in Figure 2, and it comprises the following steps:
1. be present frame by pending frame definition current in HD video.
Have I frame, P frame and B frame in HD video coding, wherein, I frame belongs to the key frame of Video coding, belongs to I group of picture, unfavorable time-domain information, adopts intraframe coding; P frame adopts the mode of forward direction reference to carry out in frame and interframe encode, belongs to non-I group of picture; B frame adopts the mode of the two-way reference of forward and backward to carry out in frame and interframe encode, also belongs to non-I group of picture.
2. maximum coding unit to be encoded current in present frame is defined as current maximum coding unit.
Adopt the mode from small size coding unit to the recurrence of large scale coding unit to encode in HEVC test model HM, the size of coding unit has 8 × 8,16 × 16,32 × 32 and 64 × 64.Wherein, the coding unit of 64 × 64 is called the maximum coding unit in cataloged procedure.
3. according to frame type and the current maximum coding unit position in the current frame of present frame, the maximum coding unit of all predictions of current maximum coding unit is determined, then be the prediction sets of current maximum coding unit by the sets definition that the maximum coding unit of all predictions by current maximum coding unit is formed, and be designated as Ω, wherein, Ω for the maximum coding unit comprised in empty set or Ω be L, at least one in T and COL is Ω={ T} or Ω={ L} or Ω={ COL} or Ω={ L, T} or Ω={ T, COL} or Ω={ L, COL} or Ω={ L, T, COL}, L represents the adjacent maximum coding unit in the left side of current maximum coding unit, T represents the adjacent maximum coding unit in the top of current maximum coding unit, COL represents maximum coding unit identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame.Fig. 3 gives the position relationship of maximum coding unit COL identical with the coordinate position of this maximum coding unit C in the forward reference frame of a maximum coding unit C maximum coding unit L adjacent with the left side of this maximum coding unit C, the adjacent maximum coding unit T in top of this maximum coding unit C, the frame at this maximum coding unit C place.
In this particular embodiment, step 3. in the deterministic process of maximum coding unit of all predictions of current maximum coding unit be:
If present frame is the I frame in HD video, then, when current maximum coding unit is the 1st maximum coding unit in present frame, determine the maximum coding unit that current maximum coding unit is not predicted, namely Ω is empty set; When current maximum coding unit is all the other the maximum coding units in the maximum coding unit of the 1st row of present frame except the 1st maximum coding unit, determine that the adjacent maximum coding unit T in the top of current maximum coding unit is the maximum coding unit of the prediction of current maximum coding unit, i.e. Ω={ T}; When current maximum coding unit is all the other the maximum coding units in the maximum coding unit of the 1st row of present frame except the 1st maximum coding unit, determine that the adjacent maximum coding unit L in the left side of current maximum coding unit is the maximum coding unit of the prediction of current maximum coding unit, i.e. Ω={ L}; When current maximum coding unit is all the other the maximum coding units in present frame except the 1st maximum coding unit of row and the maximum coding unit of the 1st row, determine that the adjacent maximum coding unit L in the left side of current maximum coding unit maximum coding unit T adjacent with top is the maximum coding unit of the prediction of current maximum coding unit, i.e. Ω={ L, T}.
If present frame is P frame in HD video or B frame, then when current maximum coding unit is the 1st maximum coding unit in present frame, determine that maximum coding unit COL identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame is the maximum coding unit of the prediction of current maximum coding unit, i.e. Ω={ COL}; When current maximum coding unit is all the other the maximum coding units in the maximum coding unit of the 1st row of present frame except the 1st maximum coding unit, determine that the adjacent maximum coding unit T in the top of current maximum coding unit and maximum coding unit COL identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame are the maximum coding unit of the prediction of current maximum coding unit, i.e. Ω={ T, COL}; When current maximum coding unit is all the other the maximum coding units in the maximum coding unit of the 1st row of present frame except the 1st maximum coding unit, determine that the adjacent maximum coding unit L in the left side of current maximum coding unit and maximum coding unit COL identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame are the maximum coding unit of the prediction of current maximum coding unit, i.e. Ω={ L, COL}; When current maximum coding unit is all the other the maximum coding units in present frame except the 1st maximum coding unit of row and the maximum coding unit of the 1st row, determine that in the forward reference frame of the adjacent maximum coding unit L in the left side of current maximum coding unit maximum coding unit T adjacent with top and present frame, the maximum coding unit COL identical with the coordinate position of current maximum coding unit is the maximum coding unit of the prediction of current maximum coding unit, i.e. Ω={ L, T, COL}.
4. D is made
predrepresent the depth prediction value of current maximum coding unit, then establish D
predvalue and the one-to-one relationship in extreme saturation interval of current maximum coding unit, wherein, D
predvalue do not exist or D
predvalue be real number, and 0≤D
pred≤ 3.
In this particular embodiment, step 4. middle D
predvalue and the one-to-one relationship in extreme saturation interval of current maximum coding unit be: work as D
predwhen=0, the extreme saturation interval of current maximum coding unit is [0,0]; Work as 0<D
predwhen≤0.5, the extreme saturation interval of current maximum coding unit is [0,1]; Work as 0.5<D
predwhen≤1.5, the extreme saturation interval of current maximum coding unit is [0,2]; Work as 1.5<D
predwhen≤2.5, the extreme saturation interval of current maximum coding unit is [1,3]; Work as 2.5<D
predwhen≤3, the extreme saturation interval of current maximum coding unit is [2,3]; Work as D
predvalue when not existing, the extreme saturation interval of current maximum coding unit is [0,3].
At this, D
predthe value mean value weighted calculation that to need by the maximum coding unit inside dimension size of L, T and COL tri-be the depth value of 4 × 4 pieces obtain, therefore, if do not comprise three maximum coding units in Ω, even Ω is empty set or comprises a maximum coding unit or comprise two maximum coding units, then think D
predvalue do not exist, thus definition work as D
predwhen not existing, the extreme saturation interval of current maximum coding unit is [0,3]; And if comprise three maximum coding units in Ω, then D
predfor real number, and 0≤D
pred≤ 3.
If 5. Ω is in L, T and COL two for the maximum coding unit that comprises in empty set or Ω for the maximum coding unit comprised in L, T and COL or Ω, then determine D
predvalue do not exist, then perform step 7.; If the maximum coding unit comprised in Ω is L, T and COL, then determine D
predvalue be real number, and 0≤D
pred≤ 3, then perform step 6..
6. by obtaining the time domain similarity TS of current maximum coding unit and the spatial domain similarity LAS of the spatial domain similarity TAS of T, current maximum coding unit and L, current maximum coding unit and COL, D is calculated
predvalue,
wherein, 1≤m≤3,1≤i≤256, and m and i is integer, ω
mrepresent the individual weight shared by maximum coding unit of m in Ω, the ω as m=1
m=LAS, the ω as m=2
m=TAS, the ω as m=3
m=TS,
i-th size in m maximum coding unit in expression Ω is the depth value of the basic unit of storage of 4 × 4.
In this particular embodiment, step detailed process is 6.:
6. the mean depth between the adjacent maximum coding unit L-COL in the left side-1, calculating maximum coding unit identical with the coordinate position of current maximum coding unit in the adjacent maximum coding unit L in the left side of current maximum coding unit and the forward reference frame of present frame is poor, be designated as ADD1
and mean depth between the adjacent maximum coding unit T-COL in top of maximum coding unit identical with the coordinate position of current maximum coding unit in the forward reference frame of the adjacent maximum coding unit T in the top calculating current maximum coding unit and present frame is poor, be designated as ADD2
then calculate the mean value of ADD1 and ADD2, be designated as ADD, ADD=(ADD1+ADD2)/2; Wherein, 1≤i≤256, and be integer,
i-th size in expression L is the depth value of the basic unit of storage of 4 × 4,
i-th size in expression L-COL is the depth value of the basic unit of storage of 4 × 4,
i-th size in expression T is the depth value of the basic unit of storage of 4 × 4,
i-th size in expression T-COL is the depth value of the basic unit of storage of 4 × 4,
span be [0,3], and be integer, symbol " || " is the symbol that takes absolute value.
-2 6., calculate the spatial domain similarity of the adjacent maximum coding unit T in top of current maximum coding unit and current maximum coding unit, be designated as TAS, TAS=0.05 × ADD+0.25; And the spatial domain similarity of the adjacent maximum coding unit L in the left side calculating current maximum coding unit and current maximum coding unit, be designated as LAS, LAS=0.05 × ADD+0.25; Meanwhile, calculate current maximum coding unit and the time domain similarity of maximum coding unit COL identical with the coordinate position of current maximum coding unit in the forward reference frame of present frame, be designated as TS, TS=-0.1 × ADD+0.5.
6.-3, D is calculated
predvalue,
wherein, 1≤m≤3, and be integer, ω
mrepresent the individual weight shared by maximum coding unit of m in Ω, the ω as m=1
m=LAS, the ω as m=2
m=TAS, the ω as m=3
m=TS,
i-th size in m maximum coding unit in expression Ω is the depth value of the basic unit of storage of 4 × 4.
7. according to D
predvalue and the one-to-one relationship in extreme saturation interval of current maximum coding unit, determine that the extreme saturation of current maximum coding unit is interval; Then according to the extreme saturation interval of current maximum coding unit, each coding unit in current maximum coding unit and current maximum coding unit is encoded, in an encoding process, if the frame at current maximum coding unit place is P frame in HD video or B frame, then when the proper discernable distortion value of mean time spatial domain human eye of each coding unit in current maximum coding unit or current maximum coding unit is less than the Low threshold T of setting
1or be greater than the high threshold T of setting
2then each coding unit in current maximum coding unit or current maximum coding unit is carried out to the selection of fast prediction pattern, use skip, merge, inter2N × 2N and intra2N × 2N predictive mode to carry out traversal coding respectively to each coding unit in current maximum coding unit or current maximum coding unit, choose rate distortion costs and be worth minimum predictive mode as optimal prediction modes.
In this particular embodiment, step 7. according to the extreme saturation interval of current maximum coding unit to the detailed process that each coding unit in current maximum coding unit and current maximum coding unit is encoded be:
-1 7., pending coding unit current in the extreme saturation interval of current maximum coding unit is defined as current coded unit, the layer at current coded unit place is defined as current layer.
7.-2, JND is used
tsrepresent the proper discernable distortion value of mean time spatial domain human eye of current coded unit, if present frame is the I frame in HD video, then determine JND
tsvalue do not exist, then perform step 7.-3; If present frame is P frame in HD video or B frame, then calculate JND
tsvalue,
then step 7.-3 is performed, wherein, (x, y) coordinate position of the pixel in current coded unit is represented, 0≤x≤K-1,0≤y≤G-1, and be all integer, K represents total number of one-row pixels point in current coded unit, and G represents total number of a row pixel in current coded unit, JND (x, y) represent that in current coded unit, coordinate position is (x, the proper discernable distortion value of time-space domain human eye of pixel y), the value of JND (x, y) adopts prior art to obtain.
7.-3, JND is worked as
tsvalue when not existing, use intra2N × 2N and intraN × N predictive mode to encode respectively to current coded unit, choose rate distortion costs and be worth the optimal prediction modes of minimum predictive mode as current coded unit, then perform step 7.-4; Work as JND
tsvalue when existing, judge JND
tsvalue whether be less than the Low threshold T of setting
1or be greater than the high threshold T of setting
2if, then judge that current coded unit carries out the selection of fast prediction pattern, skip, merge, inter2N × 2N and intra2N × 2N predictive mode is used to carry out traversal coding respectively to current coded unit, choose rate distortion costs and be worth the optimal prediction modes of minimum predictive mode as current coded unit, then perform step 7.-4; Otherwise, judge that current coded unit does not carry out the selection of fast prediction pattern, skip, merge, inter2N × 2N, inter2N × N, interN × 2N, AMP (Asymmetric Motion Partitioning is used respectively to current coded unit, asymmetrical movement is split), intra2N × 2N and intraN × N predictive mode travel through coding entirely, choose rate distortion costs and be worth the optimal prediction modes of minimum predictive mode as current coded unit, then perform step 7.-4; Wherein, the value of the N in inter2N × 2N, inter2N × N, interN × 2N, intra2N × 2N and intraN × N is the half of total number of one-row pixels point or a row pixel in current coded unit.
At this, get T
1=3.5, get T
2=10, T
1occurrence and T
2occurrence be the proper discernable distortion value of mean time spatial domain human eye and current coded unit by setting up current coded unit optimal prediction modes (namely rate distortion costs is worth minimum predictive mode) between statistical relationship, utilize statistical relationship to determine.
Due to Video coding predictive mode along with region and present frame different with the difference degree of reference frame and different, and the proper discernable distortion model of human eye shows the maximum distortion of vision invisible, comprise the proper discernable distortion model of spatial domain human eye and the proper discernable distortion model of time domain human eye, human eye proper discernable distortion model in spatial domain shows that human eye is more responsive than absolute brightness to relative brightness, and texture mask then shows that texture region can hide more distortions than flat site; The proper discernable distortion model of time domain human eye then shows that front and back two frame difference is larger, and suppressible distortion is larger.Therefore the selection of inter-frame forecast mode can be instructed by the proper discernable distortion model of human eye.Statistical relationship schematic diagram when Fig. 4 a gives that BasketballDrive sequence equals 32 at quantization parameter, coding frame number is 50 frame between the proper discernable distortion value of mean time spatial domain human eye of coding unit and the optimum prediction mode of coding unit; Statistical relationship schematic diagram when Fig. 4 b gives that BlowingBubbles sequence equals 32 at quantization parameter, coding frame number is 50 frame between the proper discernable distortion value of mean time spatial domain human eye of coding unit and the optimum prediction mode of coding unit; Statistical relationship schematic diagram when Fig. 4 c gives that Traffic sequence equals 32 at quantization parameter, coding frame number is 50 frame between the proper discernable distortion value of mean time spatial domain human eye of coding unit and the optimum prediction mode of coding unit; Statistical relationship schematic diagram when Fig. 4 d gives that RaceHorses sequence equals 32 at quantization parameter, coding frame number is 50 frame between the proper discernable distortion value of mean time spatial domain human eye of coding unit and the optimum prediction mode of coding unit.According to the statistical analysis of Fig. 4 a to Fig. 4 d, when the proper discernable distortion value of time-space domain human eye less or larger time, fractional prediction pattern proportion is very little, can get rid of these predictive modes.Therefore, JND is worked as in the present invention
tsvalue be less than the Low threshold T of setting
1or be greater than the high threshold T of setting
2time, current coded unit carries out the selection of fast prediction pattern, carries out traversal coding, select the predictive mode that is optimum to skip, merge, inter2N × 2N and intra2N × 2N predictive mode.
7.-4, judge whether the depth value of current coded unit is less than the maximum in the extreme saturation interval of current maximum coding unit, if, then current coded unit is divided into further lower one deck coding unit that four sizes are identical, then using current pending coding unit in this lower one deck coding unit as current coded unit, using the layer at current coded unit place as current layer, then return step 7.-2 continuation execution; Otherwise, determine that current coded unit cataloged procedure terminates, then perform step 7.-5.
-5 7., judge whether all coding units in the extreme saturation interval of current maximum coding unit are all disposed, if so, then determine that current maximum encoding unit encodes process terminates, then perform step 8., otherwise, judge whether four coding units in current layer are all disposed, if four coding units in current layer are all disposed, then using pending coding unit next in the last layer coding unit of current layer as current coded unit, and using the layer at current coded unit place as current layer, then step 7.-2 continuation execution are returned, if four coding units in current layer are untreated complete, then using pending coding unit next in current layer as current coded unit, and using the layer at current coded unit place as current layer, then step 7.-2 continuation execution are returned.
8. using maximum coding unit to be encoded next in present frame as current maximum coding unit, then return step and 3. continue to perform, until all maximum coding unit in present frame is all encoded complete.
9. using frame pending for next frame in HD video as present frame, then return step 2. continue perform, until all frames in HD video are all disposed, so far complete the fast coding of HD video.
Below for test the inventive method, to further illustrate validity and the feasibility of the inventive method.
The inventive method chooses the HM9.0 of HEVC as test model; Hardware configuration is CPU intel core i5-2500, the PC of dominant frequency 3.30GHz, internal memory 8G, and operating system is Windows7, and developing instrument is Microsoft Visual Studio2008.Adopt low delay and random access coding structure, choose all cycle testss quantization parameter QP be 22,27,32 and 37 4 kind of situation under test, test frame number is 100 frames, and non-I group of picture comprises the non-I frame of 8 frame, and the I frame period is 32.Employing BD-PSNR (
delta peak signal-to-noise rate), BDBR (
delta bit rate) and Δ T as the evaluation index of the inventive method.BD-PSNR represents the variable quantity of PSNR under same code rate condition, and BDBR represents the change percentage of code check under identical PSNR condition, and Δ T (%) is used for the percentage of presentation code time variations,
wherein, T
pand T
hMthe corresponding scramble time representing employing the inventive method and HM9.0 algorithm.
Table 1 gives the cycle tests that the inventive method is selected.Table 2 gives the coding efficiency situation that the cycle tests adopting the inventive method his-and-hers watches 1 to list carries out coding 100 frame, the i.e. numerical value of BD-PSNR, BDBR and Δ T, as can be seen from Table 2, the inventive method is under low delay coding structure, BDBR only increases by 1.71%, BD-PSNR only reduces 0.058dB, and the time saves 41.35%; Under random access coding structure, BDBR only increases by 1.06%, BD-PSNR and only to decline 0.037dB, and the time saves 41.43%; Compared with HM9.0, the inventive method no matter at low delay coding structure or under random access coding structure, video quality remains unchanged substantially, but greatly reduces the computation complexity of Video coding.
Fig. 5 gives the saving of time percentage situation map utilizing the inventive method to carry out coding 100 frame respectively compared to the cycle tests utilized listed by HM9.0 original coding method his-and-hers watches 1 under low delay coding structure and random access coding structure.As can be seen from Figure 5, it is close that the average time under two kinds of coding structures saves proportion, all reaches more than 40%.Therefore, the inventive method reduces the computation complexity of coding clearly.
Fig. 6 a gives and utilizes the inventive method and utilize HM9.0 original coding method PeopleOnStreet cycle tests (2560 × 1600) to be carried out to the distortion performance curve comparison figure of coding 100 frame under low delay coding structure; Fig. 6 b gives and utilizes the inventive method and utilize HM9.0 original coding method Kimono cycle tests (1920 × 1080) to be carried out to the distortion performance curve comparison figure of coding 100 frame under low delay coding structure; Fig. 6 c gives and utilizes the inventive method and utilize HM9.0 original coding method PartyScene cycle tests (832 × 480) to be carried out to the distortion performance curve comparison figure of coding 100 frame under low delay coding structure; Fig. 6 d gives and utilizes the inventive method and utilize HM9.0 original coding method BlowingBubbles cycle tests (416 × 240) to be carried out to the distortion performance curve comparison figure of coding 100 frame under low delay coding structure.As can be seen from Fig. 6 a to Fig. 6 d, utilize the inventive method compared to HM9.0 original coding method, distortion performance curve overlaps substantially, illustrates that the video quality after utilizing the inventive method and HM9.0 original coding method to encode remains unchanged substantially.
Fig. 7 a gives the Quadtree Partition result schematic diagram after utilizing HM9.0 original coding method to encode to the 6th frame (1280 × 720) in Johnny cycle tests under the condition of quantization parameter QP=32 under low delay coding structure; Fig. 7 b gives the Quadtree Partition result schematic diagram after utilizing the inventive method to encode to the 6th frame (1280 × 720) in Johnny cycle tests under the condition of quantization parameter QP=32 under low delay coding structure.The difference of both the black box representatives coding unit segmentation in Fig. 7 a and Fig. 7 b, the difference of predictive mode both black vertical line or horizontal line represent.As can be seen from Fig. 7 a and Fig. 7 b, the inventive method is HM9.0 original coding method comparatively, the segmentation degree of depth of coding unit and the predictive mode of predicting unit basically identical, though there is minority not mate, the predictive mode not mating the segmentation degree of depth of part coding unit and predicting unit is close.Therefore, it is possible to absolutely prove that the overall distortion performance utilizing the inventive method to carry out encoding keeps stable.
The cycle tests that table 1 the inventive method is selected
Sequence names |
Resolution |
Frame number |
Frame per second |
Bit-depth |
Traffic |
2560×1600 |
150 |
30fps |
8 |
PeopleOnStreet |
2560×1600 |
150 |
30fps |
8 |
Kimono |
1920×1080 |
240 |
24fps |
8 |
Cactus |
1920×1080 |
500 |
50fps |
8 |
ParkScene |
1920×1080 |
240 |
24fps |
8 |
BasketballDrive |
1920×1080 |
500 |
50fps |
8 |
BQTerrace |
1920×1080 |
600 |
60fps |
8 |
PartyScene |
832×480 |
500 |
50fps |
8 |
RaceHorsesC |
832×480 |
300 |
30fps |
8 |
BasketballDrill |
832×480 |
500 |
50fps |
8 |
BQMall |
832×480 |
600 |
60fps |
8 |
RaceHorses |
416×240 |
300 |
30fps |
8 |
BlowingBubbles |
416×240 |
500 |
50fps |
8 |
BasketballPass |
416×240 |
500 |
50fps |
8 |
Vidyo1 |
1280×720 |
600 |
60fps |
8 |
Vidyo3 |
1280×720 |
600 |
60fps |
8 |
Vidyo4 |
1280×720 |
600 |
60fps |
8 |
Johnny |
1280×720 |
600 |
60fps |
8 |
FourPeople |
1280×720 |
600 |
60fps |
8 |
KristenAndSara |
1280×720 |
600 |
60fps |
8 |
The cycle tests that table 2 adopts the inventive method his-and-hers watches 1 to list carries out the coding efficiency situation of coding 100 frame