WO2019214373A1 - 视频帧的编码单元划分方法、装置、存储介质及电子装置 - Google Patents

视频帧的编码单元划分方法、装置、存储介质及电子装置 Download PDF

Info

Publication number
WO2019214373A1
WO2019214373A1 PCT/CN2019/081211 CN2019081211W WO2019214373A1 WO 2019214373 A1 WO2019214373 A1 WO 2019214373A1 CN 2019081211 W CN2019081211 W CN 2019081211W WO 2019214373 A1 WO2019214373 A1 WO 2019214373A1
Authority
WO
WIPO (PCT)
Prior art keywords
coding unit
frame
target
type
frame type
Prior art date
Application number
PCT/CN2019/081211
Other languages
English (en)
French (fr)
Inventor
张宏顺
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to EP19799390.0A priority Critical patent/EP3793196B1/en
Priority to JP2020543747A priority patent/JP7171748B2/ja
Publication of WO2019214373A1 publication Critical patent/WO2019214373A1/zh
Priority to US16/933,455 priority patent/US11317089B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Definitions

  • the present application relates to the field of computers, and in particular, to a coding unit division method, apparatus, storage medium, and electronic device for a video frame.
  • the future development trend of video is high definition, high frame rate and high compression ratio.
  • high compression rate video coding 4 sub-block divisions are performed on the current coding unit (CU) from top to bottom. Until the CU size is 8 cutoff, then bottom-up, and then layer by layer, select the optimal mode of CU partitioning, which will result in lower encoding speed.
  • the embodiment of the present application provides a coding unit division method, device, storage medium, and electronic device for a video frame, so as to at least solve the technical problem that a coding speed of a frame in the related art is low.
  • a coding unit division method for a video frame including:
  • the target coding unit type corresponding to the target frame type to which the target frame belongs, where the target coding unit type is used to indicate the depth of division when the target frame is divided.
  • a coding unit dividing apparatus for a video frame including:
  • a first determining module configured to determine, according to a frame type and a coding unit type that have a corresponding relationship, a target coding unit type corresponding to a target frame type to which the target frame belongs, where the target coding unit type is used to indicate the target frame Depth of depth when dividing
  • a second determining module configured to determine, according to the coding unit information of the target coding unit, whether the target coding unit satisfies a target condition, when performing coding on a target coding unit that belongs to the target coding unit type in the target frame, Get the target result;
  • a processing module performing, for the target coding unit, a division operation corresponding to the target result.
  • a storage medium having stored therein a computer program, wherein the computer program is configured to execute the method described in any of the above.
  • an electronic device comprising a memory and a processor, wherein the memory stores a computer program, the processor being configured to execute any of the above by the computer program The method described in the above.
  • a computer program product comprising instructions which, when run on a computer, cause the computer to perform a coding unit partitioning method of a video frame as described herein.
  • the error accumulation considering the CU depth mainly comes from two aspects.
  • the frame type of the current frame the weights of different types of frames used as reference frames are different, and the degree of diffusion of errors accumulated in different types.
  • the size of the coding unit is different, and the range affected by the coding unit of different sizes is different. Therefore, the processing is performed separately for different frame types and different sizes, specifically, according to the frame type having the corresponding relationship.
  • the coding unit type Determining, by the coding unit type, a target coding unit type corresponding to the target frame type to which the target frame belongs, the target coding unit type being used to indicate a division depth when the target frame is divided, and a target belonging to the target coding unit type in the target frame
  • the coding unit is divided, determining whether the target coding unit satisfies the target condition according to the coding unit information of the target coding unit, obtaining a target result, and then performing a division operation corresponding to the target structure on the target coding unit, thereby being able to adopt different divisions for different frame types.
  • the video frames are all divided into low operations, thereby realizing the technical effect of increasing the encoding speed of the frames, thereby solving the technical problem that the encoding speed of the frames in the related art is low. Further, the different situations of the frames of different frame types when dividing the coding unit are fully considered, and the depth of the division is determined for the frames of different frame types to avoid the cumulative accumulation of errors, thereby reducing the generation of coding errors.
  • FIG. 1 is a schematic diagram of a coding unit division method of an optional video frame according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of an application environment of an optional coding unit division method of a video frame according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a coding unit division method of an optional video frame according to an alternative embodiment of the present application.
  • FIG. 4 is a schematic diagram of another optional coding unit division method of a video frame according to an alternative embodiment of the present application.
  • FIG. 5 is a schematic diagram of an optional coding unit dividing apparatus for a video frame according to an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an application scenario of an optional coding unit division method of a video frame according to an embodiment of the present application
  • FIG. 7 is a schematic diagram of an alternative electronic device in accordance with an embodiment of the present application.
  • a coding unit division method for a video frame is provided. As shown in FIG. 1, the method includes:
  • S102 Determine, according to a frame type and a coding unit type that have a corresponding relationship, a target coding unit type corresponding to a target frame type to which the target frame belongs, where the target coding unit type is used to indicate a division depth when the target frame is divided.
  • the coding unit division method of the video frame may be applied to a hardware environment formed by the target device 202 as shown in FIG. 2 .
  • the target device 202 is configured to determine, according to a frame type and a coding unit type having a corresponding relationship, a target coding unit type corresponding to a target frame type to which the target frame to be divided belongs, where the target coding unit type is used to indicate Demarcation depth when dividing the target frame; when dividing the target coding unit belonging to the target coding unit type in the target frame, determining whether the target coding unit satisfies the target condition according to the coding unit information of the target coding unit, and obtaining the target result; The target coding unit performs a division operation corresponding to the target result.
  • the coding unit division method of the video frame may be, but is not limited to, applied to a scenario in which a coding unit is divided into frames.
  • the coding unit division method of the foregoing video frame may be, but is not limited to being applied to, various types of clients capable of video coding.
  • the client may include, but is not limited to, an online education application, an instant messaging client, and a community. Space client, game client, shopping client, browser client, financial client, multimedia client, video live client, etc.
  • a coding unit may be, but is not limited to, being applied to a scenario in which a coding unit is divided into frames in a video resource when performing video coding in the foregoing multimedia client, or may be, but not limited to, being applied to video coding in the game client.
  • the coding speed of the frame is increased. The above is only an example, and is not limited in this embodiment.
  • the coding unit division method of the video frame may be applied to the client side, or the server side, or performed by interaction between the client side and the server side.
  • the frame type may be, but is not limited to, divided according to a reference relationship between frames in the encoding process of the frame.
  • the frame type includes: an I frame, a P frame, a B frame, and a b frame, wherein the I frame is an intra coded frame, which can be understood as a complete reservation of the frame picture, and only needs to be decoded during decoding.
  • the frame data can be completed.
  • the P frame is a forward predictive coded frame, which identifies the difference between the frame and the previous key frame.
  • the frame has no complete picture data, specifically the data different from the picture of the previous key frame.
  • the B frame is a bidirectionally predicted interpolated coded frame, which records the difference between the frame and the previous frame, and the compression ratio is high, and the decoding needs not only in the present
  • the buffered picture before the frame also decodes the picture after the frame, and the final picture is obtained by superimposing the front and rear pictures with the current frame data
  • the P frame refers to the I frame
  • the B frame refers to the P frame or the I frame
  • the b frame refers to the I frame or the P frame.
  • a B frame, and the b frame is not used as a reference frame
  • the frame indicated by the arrow in FIG. 3 is a reference frame.
  • the partition depth may be determined according to the size of the coding unit. For example, when performing intra-frame inter-frame prediction in the video encoding process, as shown in FIG. 4, starting from a maximum coding unit (LCU, Largest Code Unit), each layer is divided into layers according to a 4-fork tree, and recursively. Calculation. For each Coding Tree Unit (CTU), there are three levels of recursive processes from CU64x64 to CU32x32, CU32x32 to CU16x16, and CU16x16 to CU8x8.
  • CTU Coding Tree Unit
  • the size of the coding unit is represented by 2Nx2N.
  • the above 64x64, 32x32, 16x16, and 8x8 indicate the size of the coding unit
  • the coding unit of the size 64x64 has a division depth of 0
  • the CU division depth of the coding unit of size 32x32 is 1.
  • the coding unit of size 16x16 has a CU division depth of 2
  • a coding unit of size 8x8 has a CU division depth of 3.
  • the division of the coding unit may also adopt an expression form of the division layer number, for example, the coding unit of 64x64 to the coding unit of 32x32 is the 0th layer, the coding unit of 32x32 to the coding unit of 16x16 is the first layer, and the coding unit of 16x16 is to The 8x8 coding unit is layer 2.
  • the hierarchical arrangement of the depth of the partition may be determined based on the value of the partitioned depth. The smaller the value of the partitioned depth is, the higher the level is. For example, the partitioning depth of the coding unit having a size of 64 ⁇ 64 is lower than the division depth of the coding unit having a size of 32 ⁇ 32. Therefore, the division depth level of the coding unit of size 64x64 is greater than the division depth level of the coding unit of size 32x32, and similarly, the division depth level of the coding unit of size 32x32 is larger than the division depth level of the coding unit of size 16x16, size The division depth level of the coding unit of 16x16 is larger than the division depth level of the coding unit of size 8x8.
  • a corresponding coding unit type may be configured for each frame type.
  • error accumulation is spread in one I frame period
  • P frame refers to I frame
  • B frame refers to P frame or I frame
  • b frame refers to I frame or P frame or B frame
  • b frame is not used as reference frame.
  • the weights are sorted from large to small, I frame>P frame>B frame>b frame; in addition, the CU is divided into the maximum CU64 to CU32.
  • the influence weight of the CU size is sorted from large to small as CU64>CU32>CU16.
  • the division depth indicated by the coding unit type corresponding to the P frame is set to 2; for the B frame: the influence range is only within one P frame period, and the division depth indicated by the coding unit type corresponding to the B frame is 1 and 2 For b frames: the error does not affect other frames, so the division depth indicated by the coding unit type corresponding to the b frame is set to 0, 1, and 2.
  • the division manner in the prior art may be used.
  • the division of the coding units of the I frame adopts the prior art division manner, that is, the division of the three levels from CU64x64 to CU32x32, CU32x32 to CU16x16, and CU16x16 to CU8x8 is performed by the prior art.
  • the coding unit with the depth of 2 is deeply divided in depth, and the coding unit with the depths of 0 and 1 adopts the prior art division manner, that is, the CU64x64 to the CU32x32 and the CU32x32 are adopted by the prior art.
  • To the division of CU16x16 then judge whether CU16x16 satisfies the condition of fast division, and if it is satisfied, stop dividing it. If it is not satisfied, continue to divide CU16x16 into CU8x8.
  • the coding units with the depths of 1 and 2 are rapidly and deeply divided.
  • the prior art division manner is adopted, that is, the prior art division manner is adopted by the CU64x64 to The division of CU32x32, and then judge whether CU32x32 satisfies the condition of fast division. If it is satisfied, it stops dividing it. If it is not satisfied, it continues to divide CU32x32 into CU16x16, and then judges whether CU16x16 satisfies the condition of fast division. If it is satisfied, it stops. It is divided, and if it is not satisfied, the CU16x16 continues to be divided into CU8x8. For the coding unit division process of the b frame, the coding units with depths of 0, 1, and 2 are rapidly and deeply divided.
  • the coding unit information of the target coding unit may include, but is not limited to, an optimal mode of the target coding unit, a rate distortion cost of the optimal mode of the target coding unit, and the like.
  • the target condition may include, but is not limited to, including: the optimal mode of the target coding unit is a skip mode, and the rate distortion cost of the optimal mode of the target coding unit falls within a target threshold range.
  • the coding unit of the coding unit type determines whether to stop the coding unit according to the coding unit information of the coding unit at the time of division, and performs a subsequent division operation according to the obtained target result, so that it can be paired for different frame types.
  • Different partitioning modes are adopted when different partition depths are used, which avoids the operation of dividing each video frame into a low operation, thereby realizing the technical effect of improving the encoding speed of the frame, thereby solving the encoding speed of the frame in the related art.
  • the different situations of the frames of different frame types when dividing the coding unit are fully considered, and whether the division depth of the division is continued is determined for the frames of different frame types, thereby reducing the generation of coding errors.
  • performing the dividing operation corresponding to the target result to the target coding unit includes:
  • the target result is used to indicate that the target coding unit satisfies the target condition, stop dividing the target coding unit; and/or,
  • the target coding unit is divided if the target result is used to indicate that the target coding unit does not satisfy the target condition.
  • the division operation corresponding to the target result may include, but is not limited to, including stopping the division of the target coding unit.
  • the division operation corresponding to the target result may be, but is not limited to, including continuing to divide the target coding unit.
  • the corresponding manner may be established in the following manner.
  • the frame type and coding unit type of the relationship which specifically includes the following steps:
  • S1 acquiring a frame type, where the frame type is divided according to a reference relationship between frames in a frame encoding process
  • the coding unit type is used to indicate that the frame belonging to the frame type is divided into a first depth value when the frame is divided, or the coding unit type is used to indicate the second depth value and the target depth value when the frame belonging to the frame type is divided. Depth relationship between
  • the coding unit type may be used to indicate one or more specific depth values (such as: 3, 2, 1, 0, etc.), or may also be used to indicate a depth relationship (for example, : Below the highest depth value, between the highest depth value and the lowest depth value, only below the highest depth value, etc.).
  • the depth value includes four types, which are respectively 3, 2, and 1, and 0.
  • the coding unit type is used to indicate that the frame belonging to the frame type is divided, the depth is the first depth.
  • the frame type and coding unit type having the corresponding relationship can be as shown in Table 1.
  • the target coding unit belonging to the target coding unit type in the target frame is divided, whether the target coding unit satisfies the target condition, and the target coding is determined according to the coding unit information of the target coding unit.
  • the division of the target coding unit is stopped, and in the case that the target coding unit does not satisfy the target condition, the process of dividing the target coding unit is referred to as a coding unit depth fast determination process.
  • obtaining frame types includes:
  • S1 Determine a frame type, where the frame type includes: a first frame type, a second frame type, a third frame type, and a fourth frame type, where the first frame type is a frame type that does not refer to other frames in the process of encoding,
  • the second frame type refers to a frame type of a frame belonging to the first frame type in the process of encoding
  • the third frame type refers to a frame belonging to the first frame type and a frame belonging to the second frame type in the process of encoding.
  • the fourth frame type refers to a frame belonging to the first frame type and a frame belonging to the third frame type in the process of encoding, or, referring to a frame belonging to the second frame type and a frame type of the frame belonging to the third frame type .
  • the frames of the first frame type, the second frame type, the third frame type, and the fourth frame type may be, but are not limited to, the following reference relationship
  • the frame reference of the second frame type is a frame of one frame type
  • a frame of the third frame type refers to a frame of a first frame type and a frame of a second frame type
  • a frame of a fourth frame type refers to a frame of a first frame type and a frame of a third frame type
  • the frame of the fourth frame type refers to the frame of the second frame type and the frame of the third frame type.
  • the frame of the first frame type may be an I frame
  • the frame of the second frame type may be a P frame
  • the frame of the third frame type may be a B frame
  • the frame of the fourth frame type may be a b frame.
  • obtaining the coding unit type corresponding to the frame type includes:
  • the first frame type may be an I frame
  • the fast decoding of the coding unit may not be performed for the I frame, that is, the coding unit of each layer of the I frame is directly divided. , divide it into the smallest coding unit.
  • the second frame type may be a P frame, and for the P frame, only the 16 ⁇ 16 coding unit may be quickly divided, that is, for the P frame, it is 64 ⁇
  • the coding unit of 64 is divided into 32 ⁇ 32 coding units, and then divided into 16 ⁇ 16 coding units from 32 ⁇ 32 coding units, and then determined according to the coding unit information of the 16 ⁇ 16 coding units whether the target condition is met, if If it is satisfied, the division is stopped, and if it is not satisfied, the 16 ⁇ 16 coding unit is further divided into 8 ⁇ 8 coding units.
  • the third frame type may be a B frame, and for the B frame, the 32 ⁇ 32 coding unit and the 16 ⁇ 16 coding unit may be quickly divided, that is, for the B frame. And dividing it from a 64 ⁇ 64 coding unit into a 32 ⁇ 32 coding unit, and determining whether the target condition is met according to the coding unit information of the 32 ⁇ 32 coding unit, and if so, stopping the division, if not, then The 32 ⁇ 32 coding unit is further divided into 16 ⁇ 16 coding units.
  • the coding unit divided into 16 ⁇ 16 it is determined whether the target condition is satisfied according to the coding unit information of the coding unit of 16 ⁇ 16, if it is satisfied, the division is stopped, and if not, the 16 ⁇ 16 coding unit is further divided into 8 ⁇ 8 coding unit.
  • the fourth frame type may be a b frame, and for the b frame, a 64 ⁇ 64 coding unit, a 32 ⁇ 32 coding unit, and a 16 ⁇ 16 coding unit may be quickly divided, that is, It is said that for the b frame, it is determined whether the target condition is satisfied according to the coding unit information of the coding unit of 64 ⁇ 64, and if it is satisfied, the division is stopped, and if it is not satisfied, it is divided into 64 ⁇ 32 from the coding unit of 64 ⁇ 64. Coding unit.
  • the coding unit divided into 32 ⁇ 32 it is determined whether the target condition is satisfied according to the coding unit information of the coding unit of 32 ⁇ 32, if it is satisfied, the division is stopped, and if not, the 32 ⁇ 32 coding unit is further divided into 16 ⁇ 16 coding unit.
  • the coding unit divided into 16 ⁇ 16 it is determined whether the target condition is satisfied according to the coding unit information of the coding unit of 16 ⁇ 16, if it is satisfied, the division is stopped, and if not, the 16 ⁇ 16 coding unit is further divided into 8 ⁇ 8 coding unit.
  • the coding unit type may also be used to indicate that the frame belonging to the frame type is divided into a first depth value when the frame is divided.
  • the coding unit type corresponding to the acquired frame type includes:
  • the coding unit type corresponding to the second frame type is the second coding unit type, where the first depth value indicated by the second coding unit type is the second target value, and the second target value is only lower than the highest depth value.
  • the depth value, the highest depth value is the depth value of the smallest coding unit into which the frame can be divided;
  • the coding unit type corresponding to the third frame type is a third coding unit type, where the first depth value indicated by the third coding unit type is a third target value, and the third target value is lower than the highest depth value.
  • a depth value higher than a lowest depth value where the highest depth value is a depth value of a minimum coding unit into which the frame can be divided, and the lowest depth value is a depth value of a maximum coding unit into which the frame can be divided;
  • the coding unit type corresponding to the fourth frame type is the fourth coding unit type, where the first depth value indicated by the fourth coding unit type is a fourth target value, and the fourth target value is lower than the highest depth value.
  • the depth value, the highest depth value is the depth value of the smallest coding unit into which the frame can be divided.
  • the corresponding coding unit type may not be set or its corresponding coding unit type may be set to indicate the division depth not included in the preset division depth, so that the type of frame is encoded.
  • the unit division does not perform the process of quickly determining the depth of the coding unit, but directly divides from the lowest depth to the highest depth.
  • the frame of the second frame type is only the reference frame of the frame of the first frame type
  • the frame of the third frame type and the frame of the fourth frame type may be the second frame type.
  • the frame is a reference frame
  • the key of the second frame type is only second to the frame of the first frame type. Therefore, for the frame of the second frame type, the coding unit depth can be quickly determined only on the upper layer of the highest division depth. the process of. It is possible to set the depth value only below the highest depth value to the depth value indicated by the second frame type. Only depth values below the highest depth value are one depth value.
  • the frame of the third frame type is the reference frame of the frame of the first frame type and the frame of the second frame type
  • the frame of the third frame type is the reference of the frame of the fourth frame type.
  • a frame, for a frame of the third frame type a process of quickly determining the depth of the coding unit at each layer between the highest division depth and the lowest division depth.
  • a depth value below the highest depth value and above the lowest depth value may be set to a depth value indicated by the third frame type.
  • the depth value below the highest depth value and above the lowest depth value may be multiple depth values.
  • the frame of the fourth frame type is referenced by the frame of the first frame type and the frame of the third frame type or by the frame of the second frame type and the frame of the third frame type.
  • the frame, and the frame of the fourth frame type does not serve as a reference frame of the frame of the other frame type, and the process of quickly determining the depth of the coding unit can be performed layer by layer from the highest division depth for the frame of the fourth frame type.
  • a depth value lower than the highest depth value may be set to a depth value indicated by the third frame type.
  • a depth value below the highest depth value may be a plurality of depth values.
  • determining whether the target coding unit meets the target condition according to the coding unit information of the target coding unit includes:
  • the target coding unit belonging to the target coding unit type in the target frame may be obtained according to the determined target coding unit type corresponding to the target frame, when the dividing process is performed.
  • the coding unit depth fast determining process is performed on the target coding unit, so that whether to continue the division of the target coding unit is determined according to the obtained coding unit information.
  • the obtained coding unit information of the target coding unit may include, but is not limited to, an optimal mode of the target coding unit and a rate distortion cost of the optimal mode.
  • the target condition may include, but is not limited to, including: the optimal mode of the target coding unit is a skip mode, the rate distortion cost of the optimal mode of the target coding unit falls within a target threshold range, and the like.
  • the two target conditions that meet the foregoing conditions may be determined to satisfy the target condition, and if one of the two is not satisfied, that is, the optimal mode is not the skip mode, or the rate distortion cost If it does not fall within the target threshold range, it is determined that the target coding unit does not satisfy the target condition.
  • the foregoing target threshold range may be preset or may be determined according to information acquired during the encoding process.
  • the number of available CTUs in the current CTU neighboring positions (left, upper, upper left, and upper right corners), and the number of the same CU depth in the adjacent CTU and the same CU depth, and the average of the rate distortion cost, respectively.
  • ctu_validnum_skip_adjacent samecudepth_num_skip_adjacent, samecudepth_avgcost_skip_adjacent.
  • the current number of CUs in the current CTU is skip mode and the CU depth is the same, and the average value of the rate distortion cost is recorded as samecudepth_num_skip_curr, samecudepth_avgcost_skip_curr.
  • the rate distortion cost of the current CU optimal mode is recorded as bestcost, and the initial check is set to false. If the check is true after the following comparison, it is determined that the rate distortion cost of the current CU optimal mode satisfies the target condition:
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present application.
  • a coding unit dividing apparatus for a video frame for implementing the coding unit division method of the video frame is further provided.
  • the apparatus includes:
  • a first determining module 52 configured to determine, according to a frame type and a coding unit type having a corresponding relationship, a target coding unit type corresponding to a target frame type to which the target frame belongs, where the target coding unit type is used to indicate that the target frame is performed. Depth of division when dividing;
  • the second determining module 54 is configured to determine, according to the coding unit information of the target coding unit, whether the target coding unit satisfies the target condition, and obtain a target result, when the target coding unit belonging to the target coding unit type is divided in the target frame;
  • the processing module 56 is configured to perform a division operation corresponding to the target result to the target coding unit.
  • the processing module includes:
  • a first processing unit configured to stop dividing the target coding unit if the target result is used to indicate that the target coding unit satisfies the target condition;
  • a second processing unit configured to divide the target coding unit if the target result is used to indicate that the target coding unit does not satisfy the target condition.
  • the division operation corresponding to the target result may include, but is not limited to, including stopping the division of the target coding unit.
  • the division operation corresponding to the target result may be, but is not limited to, including continuing to divide the target coding unit.
  • the above device further includes:
  • a first obtaining module configured to acquire a frame type, where the frame type is divided according to a reference relationship between frames in a frame encoding process
  • a second obtaining module configured to acquire a coding unit type corresponding to the frame type
  • the coding unit type is used to indicate that the frame belonging to the frame type is divided into a first depth value when the frame is divided, or the coding unit type is used to indicate the second depth value and the target depth value when the frame belonging to the frame type is divided. Depth relationship between
  • a storage module for storing a frame type and a coding unit type having a corresponding relationship.
  • the coding unit type may be used to indicate one or more specific depth values (such as: 3, 2, 1, 0, etc.), or may also be used to indicate a depth relationship (for example, : Below the highest depth value, between the highest depth value and the lowest depth value, only below the highest depth value, etc.).
  • the depth value includes four types, which are respectively 3, 2, and 1, and 0.
  • the coding unit type is used to indicate that the frame belonging to the frame type is divided, the depth is the first depth.
  • the frame type and coding unit type having the corresponding relationship can be as shown in Table 1.
  • the first acquisition module is used to:
  • the frame type includes: a first frame type, a second frame type, a third frame type, and a fourth frame type, and the frame of the first frame type does not refer to the frame type of other frames in the frame encoding process
  • the frame of the second frame type refers to the frame type of the frame belonging to the first frame type in the frame encoding process
  • the frame of the third frame type refers to the frame belonging to the first frame type and the frame belonging to the second frame type in the frame encoding process.
  • the frame type, the frame of the fourth frame type refers to the frame belonging to the first frame type and the frame belonging to the third frame type in the frame encoding process, or refers to the frame belonging to the second frame type and the frame belonging to the third frame type.
  • the frames of the first frame type, the second frame type, the third frame type, and the fourth frame type may be, but are not limited to, the following reference relationship
  • the frame reference of the second frame type is a frame of one frame type
  • a frame of the third frame type refers to a frame of a first frame type and a frame of a second frame type
  • a frame of a fourth frame type refers to a frame of a first frame type and a frame of a third frame type
  • the frame of the fourth frame type refers to the frame of the second frame type and the frame of the third frame type.
  • the frame of the first frame type may be an I frame
  • the frame of the second frame type may be a P frame
  • the frame of the third frame type may be a B frame
  • the frame of the fourth frame type may be a b frame.
  • the second obtaining module includes:
  • a first determining unit configured to determine that the first frame type does not have the coding unit type
  • a second determining unit configured to determine that the coding unit type corresponding to the second frame type is a first coding unit type, where the coding unit of the first coding unit type includes: a 16 ⁇ 16 coding unit;
  • a third determining unit configured to determine that the coding unit type corresponding to the third frame type is a second coding unit type, where the coding unit of the second coding unit type comprises: a 16 ⁇ 16 coding unit and 32 ⁇ 32 coding unit;
  • a fourth determining unit configured to determine that the coding unit type corresponding to the fourth frame type is a third coding unit type, where the coding unit of the third coding unit type includes: a 16 ⁇ 16 coding unit, 32 ⁇ 32 coding unit and 64 ⁇ 64 coding unit.
  • the coding unit type may also be used to indicate that the frame belonging to the frame type is divided into a first depth value when the frame is divided.
  • the second obtaining module includes:
  • a fifth determining unit configured to determine that the coding unit type corresponding to the first frame type is the first coding unit type, where the first depth value indicated by the first coding unit type is the first target value, and the first target value For a depth value lower than a lowest depth value or higher than a highest depth value, the highest depth value is a depth value of a minimum coding unit into which a frame can be divided, and the lowest depth value is a depth value of the frame;
  • a sixth determining unit configured to determine that the coding unit type corresponding to the second frame type is the second coding unit type, where the first depth value indicated by the second coding unit type is the second target value, and the second target value a depth value that is only lower than the highest depth value, the highest depth value being a depth value of a minimum coding unit into which the frame can be divided;
  • a third determining unit configured to determine that the coding unit type corresponding to the third frame type is a third coding unit type, where the first depth value indicated by the third coding unit type is a third target value, and the third target value a depth value lower than a highest depth value and higher than a lowest depth value, the highest depth value being a depth value of a minimum coding unit into which the frame can be divided, and the lowest depth value being a depth value of the frame;
  • an eighth determining unit configured to determine that the coding unit type corresponding to the fourth frame type is a fourth coding unit type, where the first depth value indicated by the fourth coding unit type is a fourth target value, and the fourth target value For depth values below the highest depth value, the highest depth value is the depth value of the smallest coding unit into which the frame can be divided.
  • the second determining module includes:
  • a ninth determining unit configured to determine, as the target coding unit, a coding unit that matches a depth of division indicated by the target coding unit type in the target frame;
  • an obtaining unit configured to acquire coding unit information of the target coding unit when dividing the target coding unit
  • the tenth determining unit is configured to determine, according to the coding unit information, whether the target coding unit satisfies the target condition.
  • the acquiring unit is configured to: obtain an optimal mode of the target coding unit and a rate distortion cost of the optimal mode;
  • the tenth determining unit is configured to: when the optimal mode is the skip mode and the rate distortion penalty falls within the target threshold range, determine that the target coding unit satisfies the target condition; and/or, in the optimal mode, not the skip mode, or, In the case where the rate distortion penalty does not fall within the target threshold range, it is determined that the target coding unit does not satisfy the target condition.
  • the application environment of the embodiment of the present application may be, but is not limited to, the reference to the application environment in the foregoing embodiments.
  • An embodiment of the present application provides an optional specific application example of a connection method for implementing the foregoing real-time communication.
  • the coding unit division method of the video frame may be, but is not limited to, applied to a scenario of encoding a frame as shown in FIG. 6. It is impossible to completely correct the prediction process in video coding. Once the prediction error occurs, it will lead to compression ratio loss, and will gradually expand because the error is accumulated.
  • the error accumulation of CU depth is mainly related to two aspects. One is the frame type of the current frame, the error accumulation is spread in one I frame period, the P frame refers to the I frame, the B frame refers to the P frame or the I frame, and the b frame refers to I. A frame or a P frame or a B frame, and a b frame is not used as a reference frame.
  • the weights of the four frame types are I frame>P frame>B frame>b frame.
  • the CU is divided into the maximum CU64 to CU32. If the error occurs, the corresponding CU will not be generated. Then do the following 4 CU32 to CU16, and 16 CU16 to CU8 partition; also CU32 to CU16 partition, once the error, the corresponding CU will not do the next 4 CU16 to CU8 partition, and CU16 to CU8 In the division, once the error occurs, it only affects itself. Therefore, the influence weight of the CU size is sorted from large to small as CU64>CU32>CU16. In this scenario, for the coding unit partitioning process of a video frame, combined with the above two characteristics, the frame types of different CU sizes and current frames are separately processed.
  • I frame Since the I frame will affect all subsequent frames once an error occurs, all CU blocks of the I frame are not quickly determined by the CU depth.
  • P-frames P-frame weights are second only to I-frames, and the impact is also large. Therefore, P-frames are only deeply determined in depth from CU16 to CU8.
  • B-frames the range of influence is only within one P-frame period, and can be quickly determined at the 2nd level from CU32 to CU16, CU16 to CU8.
  • b-frames the error does not affect other frames, so make a quick determination at all layers.
  • the depth fast determining process is based on whether the CU has a residual, and the number of residual blocks in the same depth of the peripheral CTU, and the average rate distortion cost and the rate distortion cost in the current CU optimal mode. To determine whether to continue the partition according to whether the current CU is the skip mode, and the number of the same depth skip mode of the peripheral CTU, and the average rate distortion cost and the rate distortion cost in the current CU optimal mode.
  • a frame is sent to the encoder. After intra or inter prediction, the predicted value is obtained. The predicted value is subtracted from the input data to obtain a residual, and then Discrete Cosine Transform (DCT) and quantization are obtained. The residual coefficient is then sent to the output code stream of the entropy coding module. At the same time, after the inverse coefficient is inversely quantized, the residual value of the reconstructed image is obtained, and then added with the predicted value in the frame or the frame, thereby obtaining After reconstructing the image, the reconstructed image is subjected to intra-loop filtering, and then enters the reference frame queue as a reference image of the next frame, so that one frame is backward encoded.
  • DCT Discrete Cosine Transform
  • each layer is divided into layers according to a 4-tree tree, and recursively calculated. For each CTU, a total of three levels of recursive processes from CU64x64 to CU32x32, CU32x32 to CU16x16, and CU16x16 to CU8x8, and then layer by layer comparison, select the optimal mode CU partitioning.
  • LCU Largest Code Unit
  • the strategy is to predict the division of the current coding unit, thereby achieving a fast selection of the coding unit depth, thereby reducing the complexity of the coding and improving the coding speed.
  • the sub-block SubCU when encoding a frame, the sub-block SubCU is sometimes recursively advanced and placed after the Predict Unit (PU) 2Nx2N.
  • the coding unit depth fast determination process is performed in the step of determining whether the current CU performs 4 sub-block divisions. That is, when judging whether the current CU depth continues to be divided, PU merge and skip calculations, and PU 2Nx2N prediction have been made.
  • the optimal mode referred to below is the optimal mode after PU 2Nx2N inter prediction and optimization.
  • the judging process includes the following steps:
  • Step 1 Count the number of available CTUs in the left, upper, upper left, and upper right corners of the current CTU neighboring position, and the number of the same CU depth in the adjacent CTU and the average CU depth, and the average value of the rate distortion cost. Ctu_validnum_skip_adjacent, samecudepth_num_skip_adjacent, samecudepth_avgcost_skip_adjacent;
  • Step 2 counting the number of CUs in the current CTU that are in the skip mode and having the same CU depth, and the average value of the rate distortion cost, respectively, as samecudepth_num_skip_curr, samecudepth_avgcost_skip_curr;
  • Step 3 If all the following conditions are met, the current CU does not perform 4 sub-block partitions, otherwise it performs 4 sub-block partitions.
  • Condition 1 The current CU optimal mode is skip mode
  • the impact range is within one P frame period, and the judgment can be made when CU32 to CU16 and CU16 to CU8 are divided into depths.
  • the method is the same as the P frame except that the coefficient is 3.5, which is not described here.
  • the method is similar to the judgment when CTU32 to CU16 divide the depth.
  • the difference is that the statistical information must satisfy the quantized residual coefficient to be 0.
  • the judgment process includes the following steps:
  • Step 1 Count the number of available CTUs in the left, upper, upper left, and upper right corners of the current CTU neighboring position, and the number of remaining residual coefficients in the adjacent CTUs is 0 and the same CU depth, and the average of the rate distortion cost Values, respectively, are recorded as ctu_validnum_cbf_adjacent, samecudepth_num_cbf_adjacent, samecudepth_avgcost cbf_adjacent;
  • Step 2 Count the number of the CU depths in the current CTU that are in the skip mode and the same CU depth, and the average value of the rate distortion cost, respectively, as the samecudepth_num_cbf_curr, samecudepth_avgcost_cbf_curr;
  • Step 3 If all the following conditions are met, the current CU does not perform 4 sub-block partitions, otherwise 4 sub-block partitions are performed.
  • Condition 1 The current CU optimal mode is skip mode
  • the residual coefficient after quantization must be zero, but the residual coefficient after quantization is not necessarily the skip mode.
  • b frames are not used as reference frames, and their loss does not affect other frames. Therefore, the process of coding unit depth is quickly determined for all layers.
  • the judgment process includes the following steps:
  • Step 1 Count the number of available CTUs in the left, upper, upper left, and upper right corners of the current CTU neighboring position, and the skip mode in the adjacent CTU, and the number of the same CU depth, and the average value of the rate distortion cost, respectively Recorded as ctu_validnum_skip_adjacent, samecudepth_num_skip_adjacent, samecudepth_avgcost_skip_adjacent;
  • Step 2 If all the following conditions are met, the current CU does not perform 4 sub-block partitions, otherwise it performs 4 sub-block partitions.
  • Condition 1 The current CU optimal mode is skip mode
  • the judgment process includes the following steps:
  • Step 1 Count the number of available CTUs in the left, upper, upper left, and upper right corners of the current CTU neighboring position, and the skip mode in the adjacent CTU, and the number of the same CU depth, and the average value of the rate distortion cost, respectively Recorded as ctu_validnum_skip_adjacent, samecudepth_num_skip_adjacent, samecudepth_avgcost_skip_adjacent;
  • Step 2 Count the number of the CUs in the current CTU that are in the skip mode and the same CU depth, and the average value of the rate distortion cost, respectively, as the samecudepth_num_skip_curr, samecudepth_avgcost_skip_curr;
  • Step 3 If all the following conditions are met, the current CU does not perform 4 sub-block partitions, otherwise it performs 4 sub-block partitions.
  • Condition 1 The current CU optimal mode is skip mode
  • the judgment process includes the following steps:
  • Step 1 Count the number of available CTUs in the left, upper, upper left, and upper right corners of the current CTU neighboring position, and the residual residual coefficient of 0 in the adjacent CTU, and the number of the same CU depth, and the rate distortion cost.
  • the average value is denoted as ctu_validnum_cbf_adjacent, samecudepth_num_cbf_adjacent, samecudepth_avgcost cbf_adjacent;
  • Step 2 counting the residual coefficient of the current CTU after the CU quantization is 0, and the number of the same CU depth, and the average of the rate distortion cost, respectively, are recorded as samecudepth_num_cbf_curr, samecudepth_avgcost_cbf_curr;
  • Step 3 If all the following conditions are met, the current CU does not perform 4 sub-block partitions, otherwise 4 sub-block partitions are performed.
  • Condition 1 The current CU optimal mode is skip mode
  • the coding speed is greatly improved. If the CU depth is 32, the four sub-blocks are not divided, and the corresponding sub-CUs of the CU (the CU size is 16), and each CU16. The four sub-CUs included (the CU size is 8) do not need to do various calculations of the PU, which can greatly reduce the amount of calculation.
  • an electronic device for implementing the coding unit division method of the video frame is further provided.
  • the electronic device includes: one or more (only shown in the figure) The processor 702, the memory 704, the sensor 706, the encoder 708, and the transmission device 710, in which the computer program is stored, the processor being arranged to perform the steps in any of the above method embodiments by a computer program.
  • the foregoing electronic device may be located in at least one network device of the plurality of network devices of the computer network.
  • the foregoing processor may be configured to perform the following steps by using a computer program:
  • the structure shown in FIG. 7 is merely illustrative, and the electronic device may also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palm computer, and a mobile Internet device (Mobile). Terminal devices such as Internet Devices, MID) and PAD.
  • FIG. 7 does not limit the structure of the above electronic device.
  • the electronic device may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 7, or have a different configuration than that shown in FIG.
  • the memory 702 can be used to store the software program and the module, such as the coding unit division method of the video frame and the program instruction/module corresponding to the device in the embodiment of the present application, and the processor 704 runs the software program and the module stored in the memory 702. , thereby performing various functional applications and data processing, that is, implementing the above-described control method of the target component.
  • Memory 702 can include high speed random access memory, and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • memory 702 can further include memory remotely located relative to processor 704, which can be connected to the terminal over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the transmission device 710 described above is for receiving or transmitting data via a network.
  • Specific examples of the above network may include a wired network and a wireless network.
  • the transmission device 710 includes a Network Interface Controller (NIC) that can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network.
  • the transmission device 710 is a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • NIC Network Interface Controller
  • RF Radio Frequency
  • the memory 702 is used to store an application.
  • Embodiments of the present application also provide a storage medium having stored therein a computer program, wherein the computer program is configured to execute the steps of any one of the method embodiments described above.
  • the above storage medium may be configured to store a computer program for performing the following steps:
  • the storage medium is further configured to store a computer program for performing the steps included in the method in the above embodiments, which will not be described in detail in this embodiment.
  • Embodiments of the present application also provide a computer program product comprising instructions that, when executed on a computer, cause the computer to perform a coding unit partitioning method for a video frame as described herein.
  • the storage medium may include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.
  • the integrated unit in the above embodiment if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in the above-described computer readable storage medium.
  • the technical solution of the present application in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product, which is stored in a storage medium.
  • a number of instructions are included to cause one or more computer devices (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the disclosed client may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请公开了一种视频帧的编码单元划分方法、装置、存储介质及电子装置。其中,该方法包括:根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,目标编码单元类型用于指示对目标帧进行划分时的划分深度;在对目标帧中属于目标编码单元类型的目标编码单元进行划分时,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件,得到目标结果;对目标编码单元执行目标结果对应的划分操作。本申请解决了相关技术中帧的编码速度较低的技术问题。

Description

视频帧的编码单元划分方法、装置、存储介质及电子装置
本申请要求于2018年05月10日提交中国专利局、申请号为201810444914.5、申请名称为“视频帧的编码单元划分方法、装置、存储介质及电子装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机领域,具体而言,涉及一种视频帧的编码单元划分方法、装置、存储介质及电子装置。
背景技术
未来视频的发展趋势是高清晰度,高帧率,高压缩率,在高压缩率视频编码时,目前均采用逐层自上而下对当前编码单元(Coding Unit,CU)做4个子块划分,直到CU大小为8截止,然后自下而上,再逐层比较,选出最优模式的CU划分情况,这种方式会导致编码速度较低。
针对上述的问题,目前尚未提出有效的解决方案。
发明内容
本申请实施例提供了一种视频帧的编码单元划分方法、装置、存储介质及电子装置,以至少解决相关技术中帧的编码速度较低的技术问题。
根据本申请实施例的一个方面,提供了一种视频帧的编码单元划分方法,包括:
根据具有对应关系的帧类型和预定编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,所述目标编码单元类型用于指示对所述目标帧进行划分时的划分深度;
在对所述目标帧中属于所述目标编码单元类型的目标编码单元进行划分时,根据所述目标编码单元的编码单元信息确定所述目标编码单元是否满足目标条件,得到目标结果;
对所述目标编码单元执行所述目标结果对应的划分操作。
根据本申请实施例的另一方面,还提供了一种视频帧的编码单元划分装置,包括:
第一确定模块,用于根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,所述目标编码单元类型用于指示对所述目标帧进行划分时的划分深度
第二确定模块,用于在对所述目标帧中属于所述目标编码单元类型的目标编码单元进行划分时,根据所述目标编码单元的编码单元信息确定所述目标编码单元是否满足目标条件,得到目标结果;
处理模块,对所述目标编码单元执行所述目标结果对应的划分操作。
根据本申请实施例的另一方面,还提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项中所述的方法。
根据本申请实施例的另一方面,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行上述任一项中所述的方法。
根据本申请实施例的另一方面,还提供了一种包括指令的计算机程序产品,当其在计算机上运行时,使得所述计算机执行本申请所述的视频帧的编码单元划分方法。
在本申请实施例中,考虑到CU深度的误差累计主要来源于两方面,一方面在于当前帧的帧类型,不同类型帧被用作参考帧的权重不同,误差累计在不同类型中的扩散程度也不同,另一方面在于编码单元的大小,不同大小的编码单元划分错误时影响的范围也是不同的,因此,针对不同帧类型以及不同大小CU分开处理,具体地,根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,该目标编码单元类型用于指示对目标帧进行划分时的划分深度,在对目标帧中属于目标编码单元类型的目标编码单元划分时,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件,得到目标结果,然后对目标编码单元执行目标结构对应的划分操作,从而能够针对不同帧类型,采取不同的划分方式,也就避免了将每个视 频帧均划分到低的操作,从而实现了提高帧的编码速度的技术效果,进而解决了相关技术中帧的编码速度较低的技术问题。进一步,充分考虑了不同帧类型的帧在划分编码单元时的不同情况,为不同帧类型的帧确定划分深度,避免误差累计扩散,从而减少编码误差的产生。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1是根据本申请实施例的一种可选的视频帧的编码单元划分方法的示意图;
图2是根据本申请实施例的一种可选的视频帧的编码单元划分方法的应用环境示意图;
图3是根据本申请可选的实施方式的一种可选的视频帧的编码单元划分方法的示意图;
图4是根据本申请可选的实施方式的另一种可选的视频帧的编码单元划分方法的示意图;
图5是根据本申请实施例的一种可选的视频帧的编码单元划分装置的示意图;
图6是根据本申请实施例的一种可选的视频帧的编码单元划分方法的应用场景示意图;以及
图7是根据本申请实施例的一种可选的电子装置的示意图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所 描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
根据本申请实施例的一个方面,提供了一种视频帧的编码单元划分方法,如图1所示,该方法包括:
S102,根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,目标编码单元类型用于指示对目标帧进行划分时的划分深度;
S104,在对目标帧中属于目标编码单元类型的目标编码单元进行划分时,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件,得到目标结果;
S106,对目标编码单元执行目标结果对应的划分操作。
可选地,在本实施例中,上述视频帧的编码单元划分方法可以应用于如图2所示的目标设备202所构成的硬件环境中。如图2所示,目标设备202用于根据具有对应关系的帧类型和编码单元类型,确定待划分的目标帧所属的目标帧类型对应的目标编码单元类型,其中,目标编码单元类型用于指示对目标帧进行划分时的划分深度;在对目标帧中属于目标编码单元类型的目标编码单元进行划分时,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件,得到目标结果;对目标编码单元执行目标结果对应的划分操作。
可选地,在本实施例中,上述视频帧的编码单元划分方法可以但不限于应用于对帧进行编码单元划分的场景中。其中,上述视频帧的编码单元划分方法 可以但不限于应用于各种类型的能够进行视频编码的客户端中,例如,上述客户端可以但不限于包括:在线教育应用、即时通讯客户端、社区空间客户端、游戏客户端、购物客户端、浏览器客户端、金融客户端、多媒体客户端、视频直播客户端等。具体的,可以但不限于应用于在上述多媒体客户端中进行视频编码时对视频资源中的帧进行编码单元划分的场景中,或还可以但不限于应用于在上述游戏客户端中进行视频编码时对视频资源中的帧进行编码单元划分的场景中,以提高帧的编码速度。上述仅是一种示例,本实施例中对此不做任何限定。
可选地,在本实施例中,上述视频帧的编码单元划分方法可以应用于客户端侧,或者,服务器侧,或者通过客户端侧与服务器侧的交互来执行。
可选地,在本实施例中,帧类型可以但不限于按照在帧的编码过程中帧之间的参考关系进行划分。例如:如图3所示,帧类型包括:I帧、P帧、B帧和b帧,其中,I帧是帧内编码帧,可以理解为这一帧画面的完整保留,解码时仅需本帧数据即可完成,P帧为前向预测编码帧,其标识该帧与上一关键帧的差别,解码时需要用之前缓存的画面叠加上本帧定义的差别,生成最终画面,换言之,P帧没有完整画面数据,具体是与上一关键帧的画面差别的数据,B帧是双向预测内插编码帧,其记录本帧与前后帧的差别,压缩率较高,解码时不仅需要在本帧之前的缓存画面,还要解码本帧之后的画面,通过前后画面与本帧数据叠加得到最终画面,P帧参考I帧,B帧参考P帧或者I帧,b帧参考I帧或者P帧或者B帧,而b帧不被用做参考帧,图3中箭头所指的帧为参考帧。
可选地,在本实施例中,划分深度可以按照编码单元的大小来确定。例如:在视频编码过程中进行帧内帧间预测时,如图4所示,从最大编码单元(LCU,Largest Code Unit)开始,每层按照4叉树,一层层向下划分,做递归计算。对于每一个编码树单元(Coding Tree Unit,CTU),由CU64x64到CU32x32,CU32x32到CU16x16,和CU16x16到CU8x8总共三个层次的递归过程。
其中,编码单元的大小用2Nx2N来表示,比如:上述64x64、32x32、16x16、8x8表示编码单元的大小,大小为64x64的编码单元的划分深度为0,大小为32x32的编码单元的CU划分深度为1,大小为16x16的编码单元的CU划分 深度为2,大小为8x8的编码单元的CU划分深度为3。
对编码单元的划分还可以采用划分层数的表达形式,比如:64x64的编码单元到32x32的编码单元为第0层,32x32的编码单元到16x16的编码单元为第1层,16x16的编码单元到8x8的编码单元为第2层。
对于划分深度的等级排列可以是基于划分深度的值而确定的,划分深度的值越小等级越高,比如:大小为64x64的编码单元的划分深度低于大小为32x32的编码单元的划分深度,因此,大小为64x64的编码单元的划分深度等级大于大小为32x32的编码单元的划分深度等级,类似的,大小为32x32的编码单元的划分深度等级大于大小为16x16的编码单元的划分深度等级,大小为16x16的编码单元的划分深度等级大于大小为8x8的编码单元的划分深度等级。
可选地,在本实施例中,可以为每种帧类型配置对应的编码单元类型。例如:误差累计在一个I帧周期内扩散,P帧参考I帧,B帧参考P帧或者I帧,b帧参考I帧或者P帧或者B帧,而b帧不被用做参考帧。上述4种帧类型中权重由大到小排序是I帧>P帧>B帧>b帧;此外,CU由最大CU64到CU32划分中,一旦错误,会导致所对应的CU不再做后面4个CU32到CU16,及16个CU16到CU8的划分;同样CU32到CU16划分中,一旦错误,会导致所对应的CU不再做后面4个CU16到CU8的划分;而CU16到CU8划分中,一旦错误,只影响其自身,因此,CU大小的影响权重按由大到小排序为CU64>CU32>CU16。
结合上面两个特性,可以采用以下方式为不同权重的帧类型分配不同权重的划分深度:针对I帧:因为I帧一旦错误将影响后面所有帧,因此I帧所有CU块均进行由CU64到CU8的划分,设置I帧不对应编码单元类型,或者设置I帧对应的编码单元类型所指示的划分深度低于0或者高于3;针对P帧:P帧权重仅次于I帧,影响也很多,故设置P帧对应的编码单元类型所指示的划分深度为2;针对B帧:其影响范围只在一个P帧周期内,设置B帧对应的编码单元类型所指示的划分深度为1和2;针对b帧:误差不会影响到其他帧,故设置b帧对应的编码单元类型所指示的划分深度为0、1和2。
可选地,在本实施例中,在对目标帧中不属于目标编码单元类型的编码单元进行划分时,可以但不限于采用现有技术中的划分方式。例如:对于I帧的 编码单元的划分均采用现有技术的划分方式,即进行的由CU64x64到CU32x32,CU32x32到CU16x16,和CU16x16到CU8x8总共三个层次的划分均采用现有技术的划分方式。对于P帧的编码单元划分过程,对深度为2的编码单元进行深度快速划分,对于深度为0和1的编码单元采用现有技术的划分方式,即采用现有技术进行由CU64x64到CU32x32,CU32x32到CU16x16的划分,然后判断CU16x16是否满足快速划分的条件,如果满足则停止对其进行划分,如果不满足,则继续将CU16x16划分为CU8x8。对于B帧的编码单元划分过程,对深度为1和2的编码单元进行深度快速划分,对于深度为0的编码单元采用现有技术的划分方式,即采用现有技术的划分方式进行由CU64x64到CU32x32的划分,然后判断CU32x32是否满足快速划分的条件,如果满足则停止对其进行划分,如果不满足,则继续将CU32x32划分为CU16x16,然后判断CU16x16是否满足快速划分的条件,如果满足则停止对其进行划分,如果不满足,则继续将CU16x16划分为CU8x8。对于b帧的编码单元划分过程,对深度为0,1和2的编码单元进行深度快速划分,也就是说,全部划分过程均进行深度快速划分,判断CU64x64是否满足快速划分的条件,如果满足则停止对其进行划分,如果不满足,则将CU64x64划分为CU32x32,然后判断CU32x32是否满足快速划分的条件,如果满足则停止对其进行划分,如果不满足,则继续将CU32x32划分为CU16x16,然后判断CU16x16是否满足快速划分的条件,如果满足则停止对其进行划分,如果不满足,则继续将CU16x16划分为CU8x8。
可选地,在本实施例中,目标编码单元的编码单元信息可以但不限于包括:目标编码单元的最优模式、目标编码单元的最优模式的率失真代价等等。
可选地,在本实施例中,目标条件可以但不限于包括:目标编码单元的最优模式为skip模式,目标编码单元的最优模式的率失真代价落入目标阈值范围。
可见,通过上述步骤,在对帧进行编码单元划分的过程中,根据帧的帧类型与编码单元类型的对应关系,确定是否对编码单元进行快速的划分深度的确定,对于属于上述对应关系中记载的编码单元类型的编码单元,在划分时根据该编码单元的编码单元信息确定是否停止对该编码单元进行划分,并根据得到 的目标结果执行后续的划分操作,从而能够针对不同帧类型,在对不同划分深度进行划分时采取不同的划分方式,也就避免了将每个视频帧均划分到低的操作,从而实现了提高帧的编码速度的技术效果,进而解决了相关技术中帧的编码速度较低的技术问题。进一步,充分考虑了不同帧类型的帧在划分编码单元时的不同情况,为不同帧类型的帧确定是否继续划分的划分深度,从而减少编码误差的产生。
作为一种可选的方案,对所述目标编码单元执行所述目标结果对应的划分操作包括:
S1,在目标结果用于指示目标编码单元满足目标条件的情况下,停止对目标编码单元进行划分;和/或,
S2,在目标结果用于指示目标编码单元不满足目标条件的情况下,对目标编码单元进行划分。
可选地,在本实施例中,当目标编码单元满足目标条件时,该目标结果对应的划分操作可以但不限于包括停止对目标编码单元进行划分。
可选地,在本实施例中,当目标编码单元满足目标条件时,该目标结果对应的划分操作可以但不限于包括继续对目标编码单元进行划分。
作为一种可选的方案,在根据具有对应关系的帧类型和编码单元类型,确定待划分的目标帧所属的目标帧类型对应的目标编码单元类型之前,还可以通过以下方式建立所述具有对应关系的帧类型和编码单元类型,其具体包括如下步骤:
S1,获取帧类型,其中,帧类型是根据帧编码过程中帧之间的参考关系而划分得到的;
S2,获取帧类型对应的编码单元类型;
其中,编码单元类型用于指示属于帧类型的帧进行划分时划分深度为第一深度值,或者,编码单元类型用于指示属于帧类型的帧进行划分时的第二深度值与目标深度值之间的深度关系;
S3,存储具有对应关系的帧类型和编码单元类型。
可选地,在本实施例中,编码单元类型可以用于指示一个或者多个具体的深度值(比如:3、2、1、0等等),或者,还可以用于指示深度关系(例如: 低于最高深度值、在最高深度值与最低深度值之间、仅低于最高深度值等等)。
在一个可选的实施方式中,以深度值包括4种类型,分别为3、2、1、0为例,当编码单元类型用于指示属于帧类型的帧进行划分时划分深度为第一深度值时,具有对应关系的帧类型和编码单元类型可以如表1所示。
表1
帧类型 编码单元类型
I帧
P帧 2
B帧 1、2
b帧 0、1、2
可选地,在本实施例中,可以将在对目标帧中属于目标编码单元类型的目标编码单元进行划分时,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件,在目标编码单元满足目标条件的情况下,停止对目标编码单元进行划分,在目标编码单元不满足目标条件的情况下,对目标编码单元进行划分的过程称为编码单元深度快速确定过程。通过为不同的帧类型配置不同的编码单元类型,在对目标编码单元深度进行快速确定的过程中按照帧之间的参考关系为不同类型的帧分配进入快速确定过程的划分深度,使得在确保编码准确率的同时能够大幅度地提升编码速度。
作为一种可选的方案,获取帧类型包括:
S1,确定帧类型,其中,帧类型包括:第一帧类型、第二帧类型、第三帧类型和第四帧类型,第一帧类型为进行编码的过程中不参考其他帧的帧类型,第二帧类型为进行编码的过程中参考属于第一帧类型的帧的帧类型,第三帧类型为进行编码的过程中参考属于第一帧类型的帧和属于第二帧类型的帧的帧类型,第四帧类型为进行编码的过程中参考属于第一帧类型的帧和属于第三帧类型的帧,或者,参考属于第二帧类型的帧和属于第三帧类型的帧的帧类型。
可选地,在本实施例中,第一帧类型、第二帧类型、第三帧类型和第四帧类型的帧之间可以但不限于为以下参考关系,第二帧类型的帧参考第一帧类型的帧,第三帧类型的帧参考第一帧类型的帧和第二帧类型的帧,第四帧类型的帧参考第一帧类型的帧和第三帧类型的帧,或者,第四帧类型的帧参考第二帧 类型的帧和第三帧类型的帧。
例如:上述第一帧类型的帧可以为I帧,第二帧类型的帧可以为P帧,第三帧类型的帧可以为B帧,第四帧类型的帧可以为b帧。
作为一种可选的方案,获取所述帧类型对应的编码单元类型包括:
S1,确定所述第一帧类型不具有所述编码单元类型;
S2,确定所述第二帧类型对应的编码单元类型为第一编码单元类型,属于所述第一编码单元类型的编码单元包括:16×16的编码单元;
S3,确定所述第三帧类型对应的编码单元类型为第二编码单元类型,属于所述第二编码单元类型的编码单元包括:16×16的编码单元和32×32的编码单元;
S4,确定所述第四帧类型对应的编码单元类型为第三编码单元类型,属于所述第三编码单元类型的编码单元包括:16×16的编码单元、32×32的编码单元和64×64的编码单元。
可选地,在本实施例中,第一帧类型可以为I帧,对于I帧可以不进行编码单元的快速划分的判断,也就是说,对于I帧的每一层编码单元均直接进行划分,将其划分到最小的编码单元。
可选地,在本实施例中,第二帧类型可以为P帧,对于P帧可以仅对16×16的编码单元进行快速划分的判断,也就是说,对于P帧,将其从64×64的编码单元划分为32×32的编码单元,再从32×32的编码单元划分为16×16的编码单元,再根据16×16的编码单元的编码单元信息确定其是否满足目标条件,如果满足,则停止划分,如果不满足,则继续将16×16的编码单元划分为8×8的编码单元。
可选地,在本实施例中,第三帧类型可以为B帧,对于B帧可以对32×32的编码单元和16×16的编码单元进行快速划分的判断,也就是说,对于B帧,将其从64×64的编码单元划分为32×32的编码单元,再根据32×32的编码单元的编码单元信息确定其是否满足目标条件,如果满足,则停止划分,如果不满足,则继续将32×32的编码单元划分为16×16的编码单元。对于划分到16×16的编码单元,根据16×16的编码单元的编码单元信息确定其是否满足目标条件,如果满足,则停止划分,如果不满足,则继续将16×16的编 码单元划分为8×8的编码单元。
可选地,在本实施例中,第四帧类型可以为b帧,对于b帧可以对64x64的编码单元、32×32的编码单元和16×16的编码单元进行快速划分的判断,也就是说,对于b帧,根据64×64的编码单元的编码单元信息确定其是否满足目标条件,如果满足,则停止划分,如果不满足,则将其从64×64的编码单元划分为32×32的编码单元。对于划分到32×32的编码单元,根据32×32的编码单元的编码单元信息确定其是否满足目标条件,如果满足,则停止划分,如果不满足,则继续将32×32的编码单元划分为16×16的编码单元。对于划分到16×16的编码单元,根据16×16的编码单元的编码单元信息确定其是否满足目标条件,如果满足,则停止划分,如果不满足,则继续将16×16的编码单元划分为8×8的编码单元。
作为一种可选的方案,编码单元类型还可以用于指示属于帧类型的帧进行划分时划分深度为第一深度值,在这种的情况下,获取帧类型对应的编码单元类型包括:
S1,确定第一帧类型对应的编码单元类型为第一编码单元类型,其中,第一编码单元类型所指示的第一深度值为第一目标值,第一目标值可以设置为空;
S2,确定第二帧类型对应的编码单元类型为第二编码单元类型,其中,第二编码单元类型所指示的第一深度值为第二目标值,第二目标值为仅低于最高深度值的深度值,最高深度值为帧可划分成的最小编码单元的深度值;
S3,确定第三帧类型对应的编码单元类型为第三编码单元类型,其中,第三编码单元类型所指示的第一深度值为第三目标值,第三目标值为低于最高深度值且高于最低深度值的深度值,最高深度值为帧可划分成的最小编码单元的深度值,最低深度值为帧可划分成的最大编码单元的深度值;
S4,确定第四帧类型对应的编码单元类型为第四编码单元类型,其中,第四编码单元类型所指示的第一深度值为第四目标值,第四目标值为低于最高深度值的深度值,最高深度值为帧可划分成的最小编码单元的深度值。
可选地,在本实施例中,对于不以其他帧为参考帧的第一帧类型的帧,由于该类型的帧是其他类型的帧的参考帧,该类型的帧的关键程度更高一些,因 此对于第一帧类型的帧可以不设置对应的编码单元类型或者将其对应的编码单元类型设置为用于指示预设的划分深度中不包括的划分深度,以使得该类型的帧在编码单元划分时不进行编码单元深度快速确定的过程,而是直接从最低深度划分到最高深度。
可选地,在本实施例中,由于第二帧类型的帧仅以第一帧类型的帧为参考帧,而第三帧类型的帧和第四帧类型的帧均可能以第二帧类型的帧为参考帧,第二帧类型的帧的关键程度仅次于第一帧类型的帧,因此,对于第二帧类型的帧可以仅在最高划分深度的上一层进行编码单元深度快速确定的过程。可以设置仅低于最高深度值的深度值为第二帧类型指示的深度值。仅低于最高深度值的深度值为一个深度值。
可选地,在本实施例中,第三帧类型的帧以第一帧类型的帧和第二帧类型的帧为参考帧,而第三帧类型的帧是第四帧类型的帧的参考帧,对于第三帧类型的帧可以在最高划分深度和最低划分深度之间的各层进行编码单元深度快速确定的过程。可以设置低于最高深度值且高于最低深度值的深度值为第三帧类型指示的深度值。低于最高深度值且高于最低深度值的深度值可以为多个深度值。
可选地,在本实施例中,第四帧类型的帧以第一帧类型的帧和第三帧类型的帧为参考帧或者以第二帧类型的帧和第三帧类型的帧为参考帧,而第四帧类型的帧不会作为其他帧类型的帧的参考帧,对于第四帧类型的帧可以从最高划分深度开始逐层进行编码单元深度快速确定的过程。可以设置低于最高深度值的深度值为第三帧类型指示的深度值。低于最高深度值的深度值可以为多个深度值。
作为一种可选的方案,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件包括:
S1,将目标帧中符合目标编码单元类型所指示的划分深度的编码单元确定为目标编码单元;
S2,在对目标编码单元进行划分时,获取目标编码单元的编码单元信息;
S3,根据编码单元信息确定目标编码单元是否满足目标条件。
可选地,在本实施例中,在对目标帧进行划分时,可以根据确定出的目标 帧对应的目标编码单元类型来获取该目标帧中属于目标编码单元类型的目标编码单元,当划分过程进行到目标编码单元时,对该目标编码单元进行编码单元深度快速确定过程,从而根据获取到的编码单元信息决定是否对该目标编码单元继续划分。
可选地,在本实施例中,获取的目标编码单元的编码单元信息可以但不限于包括:目标编码单元的最优模式以及最优模式的率失真代价。
可选地,在本实施例中,目标条件可以但不限于包括:目标编码单元的最优模式为skip模式、目标编码单元的最优模式的率失真代价落入目标阈值范围等等。
可选地,在本实施例中,可以将同时满足上述两个目标条件确定为满足目标条件,若两者有一项不满足,即所述最优模式不为skip模式,或者所述率失真代价未落入所述目标阈值范围的情况下,则确定所述目标编码单元不满足所述目标条件。
可选地,在本实施例中,上述目标阈值范围可以是预先设置的,也可以是根据编码过程中获取的信息来确定的。
例如:统计当前CTU相邻位置(左边、上边、左上角及右上角)CTU可用的个数,及相邻CTU内为skip模式且相同CU深度的个数,及率失真代价的平均值,分别记作ctu_validnum_skip_adjacent,samecudepth_num_skip_adjacent,samecudepth_avgcost_skip_adjacent。并统计当前CTU内已做CU中为skip模式且CU深度相同的个数,及率失真代价的平均值,分别记作samecudepth_num_skip_curr,samecudepth_avgcost_skip_curr。
将当前CU最优模式的率失真代价记作bestcost,初始check设为false,如果经过下列比较后check为true,则确定当前CU最优模式的率失真代价满足目标条件:
Figure PCTCN2019081211-appb-000001
Figure PCTCN2019081211-appb-000002
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
根据本申请实施例的另一个方面,还提供了一种用于实施上述视频帧的编码单元划分方法的视频帧的编码单元划分装置,如图5所示,该装置包括:
1)第一确定模块52,用于根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,目标编码单元类型用于指示对目标帧进行划分时的划分深度;
2)第二确定模块54,用于在对目标帧中属于目标编码单元类型的目标编码单元进行划分时,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件,得到目标结果;
3)处理模块56,用于对所述目标编码单元执行目标结果对应的划分操作。
作为一种可选的方案,处理模块包括:
第一处理单元,用于在目标结果用于指示目标编码单元满足目标条件的情况下,停止对目标编码单元进行划分;和/或,
第二处理单元,用于在目标结果用于指示目标编码单元不满足目标条件的情况下,对目标编码单元进行划分。
可选地,在本实施例中,当目标编码单元满足目标条件时,该目标结果对应的划分操作可以但不限于包括停止对目标编码单元进行划分。
可选地,在本实施例中,当目标编码单元满足目标条件时,该目标结果对应的划分操作可以但不限于包括继续对目标编码单元进行划分。
作为一种可选的方案,上述装置还包括:
1)第一获取模块,用于获取帧类型,其中,帧类型是根据帧编码过程中帧间的参考关系而划分得到的;
2)第二获取模块,用于获取帧类型对应的编码单元类型;
其中,编码单元类型用于指示属于帧类型的帧进行划分时划分深度为第一深度值,或者,编码单元类型用于指示属于帧类型的帧进行划分时的第二深度值与目标深度值之间的深度关系;
3)存储模块,用于存储具有对应关系的帧类型和编码单元类型。
可选地,在本实施例中,编码单元类型可以用于指示一个或者多个具体的深度值(比如:3、2、1、0等等),或者,还可以用于指示深度关系(例如:低于最高深度值、在最高深度值与最低深度值之间、仅低于最高深度值等等)。
在一个可选的实施方式中,以深度值包括4种类型,分别为3、2、1、0为例,当编码单元类型用于指示属于帧类型的帧进行划分时划分深度为第一深度值时,具有对应关系的帧类型和编码单元类型可以如表1所示。
作为一种可选的方案,第一获取模块用于:
1)确定帧类型,帧类型包括:第一帧类型、第二帧类型、第三帧类型和第四帧类型,第一帧类型的帧在帧编码过程中不参考其他帧的帧类型,第二帧类型的帧在帧编码过程中参考属于第一帧类型的帧的帧类型,第三帧类型的帧在帧编码过程中参考属于第一帧类型的帧和属于第二帧类型的帧的帧类型,第四帧类型的帧在帧编码过程中参考属于第一帧类型的帧和属于第三帧类型的帧,或者,参考属于第二帧类型的帧和属于第三帧类型的帧的帧类型。
可选地,在本实施例中,第一帧类型、第二帧类型、第三帧类型和第四帧类型的帧之间可以但不限于为以下参考关系,第二帧类型的帧参考第一帧类型的帧,第三帧类型的帧参考第一帧类型的帧和第二帧类型的帧,第四帧类型的帧参考第一帧类型的帧和第三帧类型的帧,或者,第四帧类型的帧参考第二帧类型的帧和第三帧类型的帧。
例如:上述第一帧类型的帧可以为I帧,第二帧类型的帧可以为P帧,第三帧类型的帧可以为B帧,第四帧类型的帧可以为b帧。
作为一种可选的方案,第二获取模块包括:
第一确定单元,用于确定所述第一帧类型不具有所述编码单元类型;
第二确定单元,用于确定所述第二帧类型对应的所述编码单元类型为第一编码单元类型,其中,所述第一编码单元类型的编码单元包括:16×16的编码单元;
第三确定单元,用于确定所述第三帧类型对应的所述编码单元类型为第二编码单元类型,其中,所述第二编码单元类型的编码单元包括:16×16的编码单元和32×32的编码单元;
第四确定单元,用于确定所述第四帧类型对应的所述编码单元类型为第三编码单元类型,其中,所述第三编码单元类型的编码单元包括:16×16的编码单元、32×32的编码单元和64×64的编码单元。
作为一种可选的方案,编码单元类型还可以用于指示属于帧类型的帧进行划分时划分深度为第一深度值在这种的情况下,第二获取模块包括:
1)第五确定单元,用于确定第一帧类型对应的编码单元类型为第一编码单元类型,其中,第一编码单元类型所指示的第一深度值为第一目标值,第一目标值为低于最低深度值或者高于最高深度值的深度值,最高深度值为帧可划分成的最小编码单元的深度值,最低深度值为帧的深度值;
2)第六确定单元,用于确定第二帧类型对应的编码单元类型为第二编码单元类型,其中,第二编码单元类型所指示的第一深度值为第二目标值,第二目标值为仅低于最高深度值的深度值,最高深度值为帧可划分成的最小编码单元的深度值;
3)第七确定单元,用于确定第三帧类型对应的编码单元类型为第三编码单元类型,其中,第三编码单元类型所指示的第一深度值为第三目标值,第三目标值为低于最高深度值且高于最低深度值的深度值,最高深度值为帧可划分成的最小编码单元的深度值,最低深度值为帧的深度值;
4)第八确定单元,用于确定第四帧类型对应的编码单元类型为第四编码单元类型,其中,第四编码单元类型所指示的第一深度值为第四目标值,第四目标值为低于最高深度值的深度值,最高深度值为帧可划分成的最小编码单元的深度值。
作为一种可选的方案,第二确定模块包括:
1)第九确定单元,用于将目标帧中符合目标编码单元类型所指示的划分深度的编码单元,确定为目标编码单元;
2)获取单元,用于在对目标编码单元进行划分时,获取目标编码单元的编码单元信息;
3)第十确定单元,用于根据编码单元信息确定目标编码单元是否满足目标条件。
作为一种可选的方案,获取单元用于:获取目标编码单元的最优模式以及最优模式的率失真代价;
第十确定单元用于:在最优模式为skip模式且率失真代价落入目标阈值范围的情况下,确定目标编码单元满足目标条件;和/或,在最优模式不为skip模式,或者,率失真代价未落入目标阈值范围的情况下,确定目标编码单元不满足目标条件。
本申请实施例的应用环境可以但不限于参照上述实施例中的应用环境,本实施例中对此不再赘述。本申请实施例提供了用于实施上述实时通信的连接方法的一种可选的具体应用示例。
作为一种可选的实施例,上述视频帧的编码单元划分方法可以但不限于应用于如图6所示的对帧进行编码的场景中。对于视频编码中的预测过程要做到完全准确是不可能,一旦预测错误,必将会导致压缩比损失,且因为误差累计,会逐步被扩大。而CU深度的误差累计主要与两个方面有关,一是当前帧的帧类型,误差累计在一个I帧周期内扩散,P帧参考I帧,B帧参考P帧或者I帧,b帧参考I帧或者P帧或者B帧,而b帧不被用做参考帧。4种帧类型中权重由大到小排序是I帧>P帧>B帧>b帧;另外,与CU大小有关,CU由最大CU64到CU32划分中,一旦错误,会导致所对应的CU不再做后面4个CU32到CU16,及16个CU16到CU8的划分;同样CU32到CU16划分中,一旦错误,会导致所对应的CU不再做后面4个CU16到CU8的划分,而CU16到CU8划分中,一旦错误,只影响其自身,因此,CU大小的影响权重按由大到小排序为CU64>CU32>CU16。在本场景中,对于视频帧的编码单元划分过程,结合上面两个特性,对不同CU大小及当前帧的帧类型分开处理。
针对I帧:因为I帧一旦错误将影响后面所有帧,因此I帧所有CU块均不做CU深度快速确定。针对P帧:P帧权重仅次于I帧,影响也很多,故P帧只在CU16到CU8那层做深度快速确定。针对B帧:其影响范围只在一个P帧周期内,可在CU32到CU16、CU16到CU8那2层做快速确定。针对b帧:误差不会影响到其他帧,因此在所有层均做快速确定。
可选地,在本场景中,深度快速确定过程是根据CU是否有残差,及周边CTU相同深度没有残差块的个数,及平均率失真代价与当前CU最优模式下的率失真代价来判断;另外根据当前CU是否为skip模式,及周边CTU相同深度skip模式的个数,及平均率失真代价与当前CU最优模式下的率失真代价来判断是否继续划分。
一帧送入到编码器,先经过帧内或帧间预测之后,得到预测值,预测值与输入数据相减,得到残差,然后进行离散余弦变化(Discrete Cosine Transform,DCT)和量化,得到残差系数,然后送入熵编码模块输出码流,同时,残差系数经反量化反变换之后,得到重构图像的残差值,再和帧内或者帧间的预测值相加,从而得到了重构图像,重构图像再经环内滤波之后,进入参考帧队列,作为下一帧的参考图像,从而一帧帧向后编码。其中,在帧内帧间预测时,从最大编码单元(LCU,Largest Code Unit)开始,每层按照4叉树,一层层向下划分,做递归计算。对于每一个CTU,由CU64x64到CU32x32,CU32x32到CU16x16,和CU16x16到CU8x8总共三个层次的递归过程,然后再逐层比较,选出最优模式的CU划分情况。
在本场景中,利用当前CU周边CTU的信息,当前帧是否被用于参考帧,或者被用作参考帧的权重,已经计算过的当前CU最优信息,针对不同大小的CU,采取不同的策略,来预测当前编码单元的划分情况,从而实现编码单元深度的快速选择,进而降低编码的复杂度,提高编码速度。
在本场景中,如图6所示,在对帧进行编码时,有时将子块SubCU递归提前,放在预测单元(Predict Unit,PU)2Nx2N之后。编码单元深度快速确定过程在判断当前CU是否做4个子块划分的步骤中执行。即在判断当前CU深度是否继续划分时,已经做了PU merge和skip计算,及PU 2Nx2N的预测。以下涉及到的最优模式为PU 2Nx2N帧间预测并择优后的最优模式。
在编码单元深度快速确定的过程中,针对I帧,不进行判断,采用原始CU64到CU32,CU32到CU16,CU16到CU8的逐层判断。
针对P帧,只做CU16至CU8划分深度时的判断。判断过程包括如下步骤:
步骤1,统计当前CTU相邻位置左边、上边、左上角及右上角CTU可用 的个数,及相邻CTU内为skip模式且相同CU深度的个数,及率失真代价的平均值,分别记作ctu_validnum_skip_adjacent,samecudepth_num_skip_adjacent,samecudepth_avgcost_skip_adjacent;
步骤2,统计当前CTU内已做CU中为skip模式且CU深度相同的个数,及率失真代价的平均值,分别记作samecudepth_num_skip_curr,samecudepth_avgcost_skip_curr;
步骤3,如果满足以下所有条件,则当前CU不再做4个子块划分,否则做4个子块划分。
条件1:当前CU最优模式为skip模式;
条件2:当前CU最优模式的率失真代价记作bestcost,初始check为false,经过比较后check为true。比较过程如下:
Figure PCTCN2019081211-appb-000003
Figure PCTCN2019081211-appb-000004
针对B帧,其影响范围在一个P帧周期内,可在CU32到CU16及CU16到CU8划分深度时的判断。对于CTU32到CU16划分深度时的判断,采用方法除系数3.5为1.5外,其余与P帧方式相同,在此不再赘述。
对应CTU16到CTU8划分深度时的判断,方法与CTU32到CU16划分深度时的判断类似,不同的地方为统计信息必须满足量化后残差系数为0,判断过程包括如下步骤:
步骤1,统计当前CTU相邻位置左边、上边、左上角及右上角CTU可用的个数,及相邻CTU内量化后残差系数为0且相同CU深度的个数,及率失真代价的平均值,分别记作ctu_validnum_cbf_adjacent,samecudepth_num_cbf_adjacent,samecudepth_avgcost cbf_adjacent;
步骤2,统计当前CTU内已做CU中为skip模式且相同CU深度的个数,及率失真代价的平均值,分别记作samecudepth_num_cbf_curr,samecudepth_avgcost_cbf_curr;
步骤3,如果满足以下所有条件,则当前CU不再做4个子块划分,否则做4个子块划分
条件1:当前CU最优模式为skip模式;
条件2:当前CU最优模式的率失真代价记作bestcost,初始check为false,经过比较后check为true。比较过程如下:
Figure PCTCN2019081211-appb-000005
需要说明的是,如果为skip模式,一定满足量化后残差系数为零,但量 化后残差系数为零并不一定是skip模式。
针对b帧,b帧不用做参考帧,自身损失不会影响到其他帧,因此对所有层均进行编码单元深度快速确定的过程。
对于CU64到CU32快速确定(根据skip决定,且受限于个数)判断过程包括如下步骤:
步骤1,统计当前CTU相邻位置左边、上边、左上角及右上角CTU可用的个数,及相邻CTU内为skip模式,且相同CU深度的个数,及率失真代价的平均值,分别记作ctu_validnum_skip_adjacent,samecudepth_num_skip_adjacent,samecudepth_avgcost_skip_adjacent;
步骤2,如果满足以下所有条件,则当前CU不再做4个子块划分,否则做4个子块划分。
条件1:当前CU最优模式为skip模式;
条件2:当前CU最优模式的率失真代价记作bestcost,初始check为false,经过比较后check为true。比较过程如下:
Figure PCTCN2019081211-appb-000006
对于CU32到CU16快速确定(根据skip模式决定,但不受限于个数)判断过程包括如下步骤:
步骤1,统计当前CTU相邻位置左边、上边、左上角及右上角CTU可用的个数,及相邻CTU内为skip模式,且相同CU深度的个数,及率失真代价的平均值,分别记作ctu_validnum_skip_adjacent,samecudepth_num_skip_adjacent,samecudepth_avgcost_skip_adjacent;
步骤2,统计当前CTU内已做CU中为skip模式且相同CU深度的个数, 及率失真代价的平均值,分别记作samecudepth_num_skip_curr,samecudepth_avgcost_skip_curr;
步骤3,如果满足以下所有条件,则当前CU不再做4个子块划分,否则做4个子块划分。
条件1:当前CU最优模式为skip模式;
条件2:当前CU最优模式的率失真代价记作bestcost,初始check为false,经过比较后check为true。比较过程如下:
Figure PCTCN2019081211-appb-000007
Figure PCTCN2019081211-appb-000008
对于CU16到CU8快速确定(根据量化后残差系数决定,但不受限于个数)判断过程包括如下步骤:
跟B帧中CU16到CU8类似,但不在受个数限制,即
步骤1,统计当前CTU相邻位置左边、上边、左上角及右上角CTU可用的个数,及相邻CTU内量化后残差系数为0,且相同CU深度的个数,及率失真代价的平均值,分别记作ctu_validnum_cbf_adjacent,samecudepth_num_cbf_adjacent,samecudepth_avgcost cbf_adjacent;
步骤2,统计当前CTU内已做CU量化后残差系数为0,且相同CU深度的个数,及率失真代价的平均值,分别记作samecudepth_num_cbf_curr,samecudepth_avgcost_cbf_curr;
步骤3,如果满足以下所有条件,则当前CU不再做4个子块划分,否则做4个子块划分
条件1:当前CU最优模式为skip模式;
条件2:当前CU最优模式的率失真代价记作bestcost,初始check为false,经过比较后check为true。比较过程如下:
Figure PCTCN2019081211-appb-000009
Figure PCTCN2019081211-appb-000010
通过本场景中提供的方式,大幅度提升了编码速度,如知道CU深度为32时就不做4个子块划分,则所对应的CU的4个子CU(CU大小为16),及每个CU16包含的4个子CU(CU大小为8)均不需要再做PU的各种计算,可以大大减少计算量。
根据本申请实施例的又一个方面,还提供了一种用于实施上述视频帧的编码单元划分方法的电子装置,如图7所示,该电子装置包括:一个或多个(图中仅示出一个)处理器702、存储器704、传感器706、编码器708以及传输装置710,该存储器中存储有计算机程序,该处理器被设置为通过计算机程序执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述电子装置可以位于计算机网络的多个网络设备中的至少一个网络设备。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,目标编码单元类型用于指示对目标帧进行划分时的划分深度;
S2,在对目标帧中属于目标编码单元类型的目标编码单元进行划分时,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件;
S3,对目标编码单元执行目标结果对应的划分操作。
可选地,本领域普通技术人员可以理解,图7所示的结构仅为示意,电子装置也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图7其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图7中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图7所示不同的配置。
其中,存储器702可用于存储软件程序以及模块,如本申请实施例中的视频帧的编码单元划分方法和装置对应的程序指令/模块,处理器704通过运行存储在存储器702内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的目标组件的控制方法。存储器702可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器702可进一步包括相对于处理器704远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
上述的传输装置710用于经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置710包括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置710为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
其中,具体地,存储器702用于存储应用程序。
本申请的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,目标编码单元类型用于指示对目标帧进行划分时的划分深度;
S2,在对目标帧中属于目标编码单元类型的目标编码单元进行划分时,根据目标编码单元的编码单元信息确定目标编码单元是否满足目标条件,得到目标结果;
S3,对目标编码单元执行目标结果对应的划分操作。
可选地,存储介质还被设置为存储用于执行上述实施例中的方法中所包括的步骤的计算机程序,本实施例中对此不再赘述。
本申请的实施例还提供了一种包括指令的计算机程序产品,当其在计算机上运行时,使得所述计算机执行本申请所述的视频帧的编码单元划分方法。
可选地,在本实施例中,本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
上述实施例中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在上述计算机可读取的存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在存储介质中,包括若干指令用以使得一台或多台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的客户端,可通过 其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (16)

  1. 一种视频帧的编码单元划分方法,应用于电子装置,包括:
    根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,所述目标编码单元类型用于指示对所述目标帧进行划分时的划分深度;
    在对所述目标帧中属于所述目标编码单元类型的目标编码单元进行划分时,根据所述目标编码单元的编码单元信息确定所述目标编码单元是否满足目标条件,得到目标结果;
    对所述目标编码单元执行所述目标结果对应的划分操作。
  2. 根据权利要求1所述的方法,对所述目标编码单元执行所述目标结果对应的划分操作包括:
    在所述目标结果用于指示所述目标编码单元满足所述目标条件的情况下,停止对所述目标编码单元进行划分;和/或,
    在所述目标结果用于指示所述目标编码单元不满足所述目标条件的情况下,对所述目标编码单元进行划分。
  3. 根据权利要求1所述的方法,通过以下方式建立所述具有对应关系的帧类型和编码单元类型:获取帧类型,其中,所述帧类型是根据帧编码过程中帧间的参考关系而划分得到的;
    获取所述帧类型对应的编码单元类型;
    存储具有对应关系的帧类型和编码单元类型。
  4. 根据权利要求3所述的方法,获取所述帧类型包括:
    确定所述帧类型,所述帧类型包括:第一帧类型、第二帧类型、第三帧类型和第四帧类型;其中,
    所述第一帧类型的帧在帧编码过程中不参考其他帧;
    所述第二帧类型的帧在编码过程中参考所述第一帧类型的帧;
    所述第三帧类型的帧在编码过程中参考所述第一帧类型的帧和所述第二帧类型的帧;
    所述第四帧类型的帧在编码过程中参考所述第一帧类型的帧和所述第三帧类型的帧,或者,参考所述第二帧类型的帧和所述第三帧类型的帧。
  5. 根据权利要求4所述的方法,获取所述帧类型对应的编码单元类型包括:
    确定所述第二帧类型对应的编码单元类型为第一编码单元类型,属于所述第一编码单元类型的编码单元包括:16×16的编码单元;
    确定所述第三帧类型对应的编码单元类型为第二编码单元类型,属于所述第二编码单元类型的编码单元包括:16×16的编码单元和32×32的编码单元;
    确定所述第四帧类型对应的编码单元类型为第三编码单元类型,属于所述第三编码单元类型的编码单元包括:16×16的编码单元、32×32的编码单元和64×64的编码单元。
  6. 根据权利要求1至5中任一项所述的方法,根据所述目标编码单元的编码单元信息确定所述目标编码单元是否满足目标条件包括:
    将所述目标帧中符合所述目标编码单元类型指示的划分深度的编码单元,确定为所述目标编码单元;
    在对所述目标编码单元进行划分时,获取所述目标编码单元的编码单元信息;
    根据所述编码单元信息确定所述目标编码单元是否满足目标条件。
  7. 根据权利要求6所述的方法,获取所述目标编码单元的编码单元信息包括:获取所述目标编码单元的最优模式以及所述最优模式的率失真代价;
    则根据所述编码单元信息确定所述目标编码单元是否满足目标条件包括:
    在所述最优模式为skip模式且所述率失真代价落入目标阈值范围的情况下,确定所述目标编码单元满足所述目标条件;和/或,
    在所述最优模式不为skip模式,或者,所述率失真代价未落入所述目标阈值范围的情况下,确定所述目标编码单元不满足所述目标条件。
  8. 一种视频帧的编码单元划分装置,包括:
    第一确定模块,用于根据具有对应关系的帧类型和编码单元类型,确定目标帧所属的目标帧类型对应的目标编码单元类型,其中,所述目标编码单元类型用于指示对所述目标帧进行划分时的划分深度;
    第二确定模块,用于在对所述目标帧中属于所述目标编码单元类型的目标编码单元进行划分时,根据所述目标编码单元的编码单元信息确定所述目标编 码单元是否满足目标条件,得到目标结果;
    处理模块,用于对所述目标编码单元执行所述目标结果对应的划分操作。
  9. 根据权利要求8所述的装置,所述处理模块包括:
    第一处理单元,用于在所述目标结果用于指示所述目标编码单元满足所述目标条件的情况下,停止对所述目标编码单元进行划分;和/或,
    第二处理单元,用于在所述目标结果用于指示所述目标编码单元不满足所述目标条件的情况下,对所述目标编码单元进行划分。
  10. 根据权利要求8所述的装置,所述装置还包括:
    第一获取模块,用于获取帧类型,其中,所述帧类型是根据帧编码过程中帧间的参考关系而划分得到的;
    第二获取模块,用于获取所述帧类型对应的编码单元类型;
    存储模块,用于存储具有对应关系的帧类型和编码单元类型。
  11. 根据权利要求10所述的装置,所述第一获取模块用于:
    确定所述帧类型,所述帧类型包括:第一帧类型、第二帧类型、第三帧类型和第四帧类型;其中,
    所述第一帧类型的帧在编码过程中不参考其他帧;
    所述第二帧类型的帧编码过程中参考所述第一帧类型的帧;
    所述第三帧类型的帧在编码过程中参考所述第一帧类型的帧和所述第二帧类型的帧;
    所述第四帧类型的帧在编码过程中参考所述第一帧类型的帧和所述第三帧类型的帧,或者,参考所述第二帧类型的帧和所述第三帧类型的帧。
  12. 根据权利要求11所述的装置,所述第二获取模块包括:
    第二确定单元,用于确定所述第二帧类型对应的编码单元类型为第一编码单元类型,属于所述第一编码单元类型的编码单元包括:16×16的编码单元;
    第三确定单元,用于确定所述第三帧类型对应的编码单元类型为第二编码单元类型,属于所述第二编码单元类型的编码单元包括:16×16的编码单元和32×32的编码单元;
    第四确定单元,用于确定所述第四帧类型对应的编码单元类型为第三编码单元类型,属于所述第三编码单元类型的编码单元包括:16×16的编码单元、 32×32的编码单元和64×64的编码单元。
  13. 根据权利要求8至12中任一项所述的装置,所述第二确定模块包括:
    第九确定单元,用于将所述目标帧中符合所述目标编码单元类型指示的划分深度的编码单元,确定为所述目标编码单元;
    获取单元,用于在对所述目标编码单元进行划分时,获取所述目标编码单元的编码单元信息;
    第十确定单元,用于根据所述编码单元信息确定所述目标编码单元是否满足目标条件。
  14. 一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至7任一项中所述的方法。
  15. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行所述权利要求1至7任一项中所述的方法。
  16. 一种包括指令的计算机程序产品,当其在计算机上运行时,使得所述计算机执行权利要求1至7任一项所述的视频帧的编码单元划分方法。
PCT/CN2019/081211 2018-05-10 2019-04-03 视频帧的编码单元划分方法、装置、存储介质及电子装置 WO2019214373A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP19799390.0A EP3793196B1 (en) 2018-05-10 2019-04-03 Video frame encoding unit division method and apparatus, and storage medium and electronic apparatus
JP2020543747A JP7171748B2 (ja) 2018-05-10 2019-04-03 ビデオフレームの符号化単位の分割方法、装置、記憶媒体及び電子装置
US16/933,455 US11317089B2 (en) 2018-05-10 2020-07-20 Method, apparatus, and storage medium for dividing coding unit of video frame

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810444914.5A CN110198443B (zh) 2018-05-10 2018-05-10 视频帧的编码单元划分方法、装置、存储介质及电子装置
CN201810444914.5 2018-05-10

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/933,455 Continuation US11317089B2 (en) 2018-05-10 2020-07-20 Method, apparatus, and storage medium for dividing coding unit of video frame

Publications (1)

Publication Number Publication Date
WO2019214373A1 true WO2019214373A1 (zh) 2019-11-14

Family

ID=67751027

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/081211 WO2019214373A1 (zh) 2018-05-10 2019-04-03 视频帧的编码单元划分方法、装置、存储介质及电子装置

Country Status (5)

Country Link
US (1) US11317089B2 (zh)
EP (1) EP3793196B1 (zh)
JP (1) JP7171748B2 (zh)
CN (1) CN110198443B (zh)
WO (1) WO2019214373A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901591A (zh) * 2020-07-28 2020-11-06 有半岛(北京)信息科技有限公司 一种编码模式的确定方法、装置、服务器和存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572679B (zh) * 2019-09-27 2022-04-26 腾讯科技(深圳)有限公司 帧内预测的编码方法、装置、设备及可读存储介质
CN113242429B (zh) * 2021-05-11 2023-12-05 杭州网易智企科技有限公司 视频编码模式决策方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120236944A1 (en) * 2009-12-08 2012-09-20 Samsung Electronics Co., Ltd. Method and apparatus for encoding video by motion prediction using arbitrary partition, and method and apparatus for decoding video by motion prediction using arbitrary partition
CN104023234A (zh) * 2014-06-24 2014-09-03 华侨大学 一种适用于hevc的快速帧间预测方法
CN104243997A (zh) * 2014-09-05 2014-12-24 南京邮电大学 一种质量可分级hevc视频编码方法
CN107295336A (zh) * 2017-06-21 2017-10-24 鄂尔多斯应用技术学院 基于图像相关性的自适应快速编码单元划分方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105103554A (zh) * 2013-03-28 2015-11-25 华为技术有限公司 用于保护视频帧序列防止包丢失的方法
CN103491369B (zh) * 2013-09-18 2016-09-28 华为技术有限公司 一种帧间预测编码方法和编码器
US9924183B2 (en) * 2014-03-20 2018-03-20 Nanjing Yuyan Information Technology Ltd. Fast HEVC transcoding
CN104602017B (zh) * 2014-06-10 2017-12-26 腾讯科技(北京)有限公司 视频编码器、方法和装置及其帧间模式选择方法和装置
CN107396121B (zh) * 2017-08-22 2019-11-01 中南大学 一种基于分层b帧结构的编码单元深度预测方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120236944A1 (en) * 2009-12-08 2012-09-20 Samsung Electronics Co., Ltd. Method and apparatus for encoding video by motion prediction using arbitrary partition, and method and apparatus for decoding video by motion prediction using arbitrary partition
CN104023234A (zh) * 2014-06-24 2014-09-03 华侨大学 一种适用于hevc的快速帧间预测方法
CN104243997A (zh) * 2014-09-05 2014-12-24 南京邮电大学 一种质量可分级hevc视频编码方法
CN107295336A (zh) * 2017-06-21 2017-10-24 鄂尔多斯应用技术学院 基于图像相关性的自适应快速编码单元划分方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3793196A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901591A (zh) * 2020-07-28 2020-11-06 有半岛(北京)信息科技有限公司 一种编码模式的确定方法、装置、服务器和存储介质
CN111901591B (zh) * 2020-07-28 2023-07-18 有半岛(北京)信息科技有限公司 一种编码模式的确定方法、装置、服务器和存储介质

Also Published As

Publication number Publication date
US11317089B2 (en) 2022-04-26
US20200351498A1 (en) 2020-11-05
EP3793196A4 (en) 2021-06-09
CN110198443B (zh) 2022-09-13
CN110198443A (zh) 2019-09-03
EP3793196B1 (en) 2024-01-10
JP7171748B2 (ja) 2022-11-15
EP3793196A1 (en) 2021-03-17
JP2021514158A (ja) 2021-06-03

Similar Documents

Publication Publication Date Title
KR102429449B1 (ko) 양방향 광 흐름을 위한 비트-폭 제어를 위한 방법 및 디바이스
WO2021114846A1 (zh) 一种视频降噪处理方法、装置及存储介质
JP7012747B2 (ja) ビデオフレーム符号化方法、端末、および記憶媒体
WO2019214373A1 (zh) 视频帧的编码单元划分方法、装置、存储介质及电子装置
KR101808327B1 (ko) 영상 코덱에서 패딩을 이용한 영상 부/복호화 방법 및 장치
KR102214937B1 (ko) 디블로킹 필터 방법 및 장치
CN111316642B (zh) 信令图像编码和解码划分信息的方法和装置
CN109688407B (zh) 编码单元的参考块选择方法、装置、电子设备及存储介质
KR20150036161A (ko) 비디오 코딩을 위한 제한된 인트라 디블록킹 필터링
EP4024872A1 (en) Video coding method and apparatus, video decoding method and apparatus, electronic device, and storage medium
CN109963151B (zh) 编码单元划分确定方法及装置、终端设备及可读存储介质
JP2015103970A (ja) 動画像符号化装置、動画像符号化方法、動画像符号化プログラム、及び動画像撮影装置
CN108777794B (zh) 图像的编码方法和装置、存储介质、电子装置
CN110381312B (zh) 一种基于hevc的预测深度划分范围的方法和装置
WO2020248715A1 (zh) 基于高效率视频编码的编码管理方法及装置
CN109218722B (zh) 一种视频编码方法、装置及设备
CN115118976A (zh) 一种图像编码方法、可读介质及其电子设备
KR102094247B1 (ko) 디블로킹 필터링 방법 및 디블로킹 필터
CN110213595B (zh) 基于帧内预测的编码方法、图像处理设备和存储装置
EP2890124A1 (en) Coding method and device applied to hevc-based 3dvc
CN109618152B (zh) 深度划分编码方法、装置和电子设备
CN105357494A (zh) 视频编解码方法、装置和计算机程序产品
CN110740323B (zh) 用于确定lcu划分方式的方法、装置、服务器以及存储介质
EP4044600A1 (en) Video encoding method and apparatus, video decoding method and apparatus, electronic device, and storage medium
CN112383774B (zh) 编码方法、编码器以及服务器

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19799390

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020543747

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2019799390

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2019799390

Country of ref document: EP

Effective date: 20201210