CN113542737A - Encoding mode determining method and device, electronic equipment and storage medium - Google Patents

Encoding mode determining method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113542737A
CN113542737A CN202010318251.XA CN202010318251A CN113542737A CN 113542737 A CN113542737 A CN 113542737A CN 202010318251 A CN202010318251 A CN 202010318251A CN 113542737 A CN113542737 A CN 113542737A
Authority
CN
China
Prior art keywords
coding
unit
frame
intra
cost
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010318251.XA
Other languages
Chinese (zh)
Inventor
张涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010318251.XA priority Critical patent/CN113542737A/en
Publication of CN113542737A publication Critical patent/CN113542737A/en
Pending legal-status Critical Current

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/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
    • 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
    • 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/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Abstract

The application relates to the technical field of video coding, and discloses a method and a device for determining a coding mode, electronic equipment and a storage medium, wherein the method for determining the coding mode based on pre-analysis information comprises the following steps: acquiring a pre-analysis unit corresponding to a unit to be coded and a plurality of coding modes to be selected corresponding to the unit to be coded; sampling the unit to be coded to obtain a corresponding pre-analysis unit; calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit, and filtering the multiple coding modes to be selected based on the intra-frame coding cost and the inter-frame coding cost; and acquiring the selectable coding modes after the filtering processing of the multiple coding modes to be selected, and determining the coding mode of the unit to be coded from the selectable coding modes. The scheme provided by the application can improve the efficiency of determining the coding mode.

Description

Encoding mode determining method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of video coding technologies, and in particular, to a method and an apparatus for determining a coding mode, an electronic device, and a storage medium.
Background
The video is a video sequence composed of a plurality of video frames in sequence, and the video can be compressed in an encoding mode before transmission and processing of the video data due to the large data volume of the video, and the purpose of video encoding is to compress the video data.
Existing video coding standards, such as: in HEVC and VVC, each coding unit corresponds to multiple coding modes, but coding efficiency of different coding modes is different, in the prior art, all coding modes of a coding unit need to be traversed to obtain an optimal coding mode, and then video coding is performed by using the optimal coding mode obtained by traversal.
Disclosure of Invention
The purpose of the present application is to solve at least one of the above technical drawbacks, and to provide the following solutions:
in a first aspect, a method for determining an encoding mode based on pre-analysis information is provided, including:
acquiring a pre-analysis unit corresponding to a unit to be coded and a plurality of coding modes to be selected corresponding to the unit to be coded; sampling the unit to be coded to obtain a corresponding pre-analysis unit;
Calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit, and filtering the multiple coding modes to be selected based on the intra-frame coding cost and the inter-frame coding cost;
and acquiring selectable coding modes after the filtering processing of the multiple coding modes to be selected, and determining the coding mode of the unit to be coded from the selectable coding modes.
In an optional embodiment of the first aspect, the filtering the multiple candidate coding modes based on the intra-frame coding cost and the inter-frame coding cost includes:
when the ratio of the intra-frame coding cost to the inter-frame coding cost is larger than a first threshold value, filtering out intra-frame coding modes in the coding modes to be selected;
when the ratio of the interframe coding cost to the intraframe coding cost is greater than a second threshold value, filtering out interframe coding modes in the coding modes to be selected; wherein the first threshold and the second threshold are real numbers not less than 1 and not more than 10.
In an optional embodiment of the first aspect, the step of obtaining a pre-analysis unit corresponding to a unit to be encoded includes:
acquiring the size of a coding sub-block corresponding to a pre-analysis sub-unit with a preset specification; the system comprises a pre-analysis unit, a data processing unit and a data processing unit, wherein the pre-analysis unit consists of at least one pre-analysis subunit with a preset specification;
When the unit to be coded comprises a plurality of coding sub-blocks, the unit to be coded is divided into a plurality of coding sub-blocks, and a pre-analysis sub-unit corresponding to each coding sub-block is obtained.
In an optional embodiment of the first aspect, the filtering the multiple candidate coding modes based on the intra-frame coding cost and the inter-frame coding cost includes:
calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis subunit corresponding to each coding sub-block;
and filtering the plurality of coding modes to be selected based on the sum of the intra-frame coding costs and the sum of the inter-frame coding costs corresponding to the pre-analysis subunits.
In an optional embodiment of the first aspect, the filtering the multiple coding modes to be selected based on the sum of intra-frame coding costs and the sum of inter-frame coding costs corresponding to each pre-analysis unit includes:
when the ratio of the sum of the intra-frame coding costs to the sum of the inter-frame coding costs is greater than a third threshold value, filtering out the intra-frame coding mode in the coding mode to be selected;
when the ratio of the sum of the interframe coding costs to the sum of the intraframe coding costs is greater than a fourth threshold value, filtering out interframe coding modes in the coding modes to be selected; wherein the third threshold and the fourth threshold are real numbers not less than 1 and not more than 10.
In an optional embodiment of the first aspect, the determining the coding mode of the unit to be coded from the optional coding modes comprises:
and traversing the selectable coding modes to obtain the interframe coding cost of the unit to be coded in the selectable coding modes, and determining the selectable coding mode corresponding to the minimum interframe coding cost as the optimal coding mode.
In an optional embodiment of the first aspect, when the unit to be encoded includes a plurality of encoded sub-blocks, the determining, as the optimal encoding mode, the optional encoding mode corresponding to the minimum inter-coding cost includes:
when the minimum inter-frame coding cost is larger than a preset threshold value, calculating a plurality of intra-frame coding costs of the coding sub-blocks in different prediction directions;
comparing the plurality of intra-coding costs to the minimum inter-coding cost;
and when any intra-frame coding cost is less than the minimum inter-frame coding cost, taking any intra-frame coding as the optimal coding mode of the unit to be coded.
In a second aspect, there is provided an encoding mode determining apparatus based on pre-analysis information, including:
the device comprises a module for acquiring coding modes to be selected, a module for acquiring pre-analysis units corresponding to the coding units to be selected and a plurality of coding modes to be selected corresponding to the coding units to be selected; sampling the unit to be coded to obtain a corresponding pre-analysis unit;
The filtering and coding mode module is used for calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit and filtering the multiple coding modes to be selected based on the intra-frame coding cost and the inter-frame coding cost;
and the coding mode determining module is used for acquiring the selectable coding modes after the filtering processing of the multiple coding modes to be selected, and determining the coding mode of the unit to be coded from the selectable coding modes.
In an alternative embodiment of the second aspect, the filtering encoding mode module further comprises:
the first filtering intra-frame coding mode unit is used for filtering out the intra-frame coding mode in the coding mode to be selected when the ratio of the intra-frame coding cost to the inter-frame coding cost is greater than a first threshold value;
the first filtering interframe coding mode unit is used for filtering out interframe coding modes in the coding modes to be selected when the ratio of the interframe coding cost to the intraframe coding cost is greater than a second threshold value; wherein the first threshold and the second threshold are real numbers not less than 1 and not more than 10.
In an optional embodiment of the second aspect, the obtaining a candidate encoding mode module further includes:
the coding sub-block size obtaining unit is used for obtaining the coding sub-block size corresponding to the pre-analysis sub-unit with the preset specification; the system comprises a pre-analysis unit, a data processing unit and a data processing unit, wherein the pre-analysis unit consists of at least one pre-analysis subunit with a preset specification;
And the partitioning unit is used for partitioning the unit to be coded into a plurality of coding sub-blocks and obtaining a pre-analysis sub-unit corresponding to each coding sub-block when the unit to be coded comprises the plurality of coding sub-blocks.
In an alternative embodiment of the second aspect, the filtering encoding mode module further comprises:
the coding cost calculating unit is used for calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis subunit corresponding to each coding sub-block;
and the filtering to-be-selected coding mode unit is used for filtering the plurality of to-be-selected coding modes based on the intra-frame coding cost sum and the inter-frame coding cost sum corresponding to each pre-analysis subunit.
In an optional embodiment of the second aspect, the filtering the candidate coding mode unit further includes:
a second filtering intra-frame coding mode subunit, configured to filter, when a ratio of the sum of the intra-frame coding costs to the sum of the inter-frame coding costs is greater than a third threshold, an intra-frame coding mode in the to-be-selected coding mode;
the second filtering interframe coding mode subunit is used for filtering the interframe coding modes in the coding modes to be selected when the ratio of the sum of the interframe coding costs to the sum of the intraframe coding costs is greater than a fourth threshold value; wherein the third threshold and the fourth threshold are real numbers not less than 1 and not more than 10.
In an alternative embodiment of the second aspect, the determining the encoding mode module includes:
and the traversal optional coding mode unit is used for traversing the optional coding modes, sequentially obtaining the interframe coding cost of the unit to be coded in the optional coding modes, and determining the optional coding mode corresponding to the minimum interframe coding cost as the optimal coding mode.
In an optional embodiment of the second aspect, when the unit to be encoded includes a plurality of encoded sub-blocks, the traversing the optional encoding mode unit further includes:
the intra-frame coding cost calculating subunit is used for calculating intra-frame coding costs of the coding sub-blocks in different prediction directions when the minimum inter-frame coding cost is greater than a preset threshold value;
a comparing subunit, configured to compare the intra-frame coding costs with the minimum inter-frame coding cost;
and determining an optimal coding mode subunit, which is used for taking any intra-frame coding as the optimal coding mode of the unit to be coded when any intra-frame coding cost is less than the minimum inter-frame coding cost.
In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the method for determining an encoding mode based on pre-analysis information as shown in the first aspect of the present application is implemented.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the method for determining an encoding mode based on pre-analysis information as shown in the first aspect of the present application.
The beneficial effect that technical scheme that this application provided brought is:
according to the coding mode determining method based on the pre-analysis information, the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit in the coding analysis process are utilized to filter the coding mode to be selected, the selectable coding modes after filtering processing of the coding mode to be selected are obtained, the final coding mode is determined from the selectable coding modes, the number of the selectable coding modes is partially reduced compared with the number of the coding modes to be selected, therefore, the coding mode is further determined from the selectable coding modes, and compared with the mode which is directly determined from the coding mode to be selected, the efficiency of determining the final coding mode is improved.
Moreover, the selectable coding modes are filtered through the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit, high-complexity calculation such as absolute errors is not needed, the filtering and determining processes of the coding modes are simplified, and the video coding speed can be improved by utilizing the finally determined coding mode.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic diagram of an encoding process according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for determining an encoding mode based on pre-analysis information according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a coding unit with a size of 16 × 16 and its corresponding pre-analysis unit according to an embodiment of the present application;
FIG. 4 shows an example of a 32x32 coding unit and its corresponding pre-analysis unit structure;
FIG. 5 shows an embodiment of the present application, which provides a structure of a coding unit with a size of 64x64 and its corresponding pre-analysis unit;
fig. 6 is a flowchart illustrating a filtering process performed on a plurality of candidate encoding modes based on the intra-coding cost and the inter-coding cost when a unit to be encoded includes a plurality of encoded sub-blocks according to an embodiment of the present application;
Fig. 7 is a schematic structural diagram of an encoding mode determining device based on pre-analysis information according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
I frame: and an intra-frame prediction frame for performing prediction using the intra-frame information.
P frame: inter-predicted frames, which may employ both intra-prediction and inter-prediction, may be forward reference predicted.
B frame: the frame is predicted between frames, and the frame can be predicted by adopting intra-frame prediction and inter-frame prediction, and can be predicted by forward, backward and bidirectional reference.
The group of pictures GOP includes I frames (intra-coded frames) and the remaining frames are inter-coded frames (P/B frames). The I frame is the first frame of a sequence GOP, the I frame is used as a basic frame, the I frame is used for predicting a P frame, and then the I frame and the P frame are used for predicting a B frame.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The application provides a method for determining a coding mode based on pre-analysis information, a device for determining a coding mode based on pre-analysis information, an electronic device and a storage medium, which aim to solve the above technical problems in the prior art, and can be applied to the following steps: online video, video chat and conferencing, telemedicine, video education, video surveillance, video games, virtual reality, and the like.
The coding mode determining method based on the pre-analysis information can be applied to video coding standards such as: in HEVC, VVC, and the like, the encoding mode is determined for inter-frame prediction frames such as P frames and B frames of video frames.
The following describes the technical solution of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The encoding process provided by the present application is shown in fig. 1, and includes: the method comprises the steps of pre-analysis, coding decision and coding, namely, in the video coding process, the video segment to be coded is pre-analyzed, the subsequent coding decision is carried out based on the pre-analyzed information, and after the optimal coding mode is obtained, the video segment to be coded is coded. The resolution of the encoded frame used in the analysis process of the present application is 1/4 of the resolution of the original encoded frame, that is, pixels of the encoded frame in the horizontal direction and the vertical direction in the analysis process are both 1/2 of the original encoded frame.
Based on the characteristics, the coding mode of the unit to be coded is rapidly selected according to the pre-analysis coding cost distribution condition corresponding to the intra-frame coding unit in the pre-analysis process, so that the determining speed of the coding mode of the unit to be coded is improved.
A possible implementation manner is provided in the embodiment of the present application, and as shown in fig. 2, a method for determining an encoding mode based on pre-analysis information is provided, where the scheme may be executed at a client that uploads a video or at a server that issues a video, and includes the following steps:
step S201, acquiring a pre-analysis unit corresponding to a unit to be coded and a plurality of coding modes to be selected corresponding to the unit to be coded; sampling the unit to be coded to obtain a corresponding pre-analysis unit;
step S202, calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit, and filtering the multiple coding modes to be selected based on the intra-frame coding cost and the inter-frame coding cost;
step S203, obtaining the selectable coding modes after filtering the multiple to-be-selected codes, and determining the coding mode of the to-be-coded unit from the selectable coding modes.
After the unit to be coded is obtained, the unit to be coded is downsampled according to a preset sampling rate, and a pre-analysis unit corresponding to the unit to be coded is obtained.
The pre-analysis unit representing the current unit to be coded is obtained by sampling the unit to be coded, the sampling rate of the down-sampling can be 1/2, two pixels are averaged to obtain a corresponding pre-analysis pixel unit, for example, the size of the unit to be coded is 16x16, and the corresponding size after sampling according to the sampling rate of 1/2 is 8x 8.
The pre-analysis unit is obtained by sampling the unit to be coded, and the information capable of representing the unit to be coded is reserved in the pre-analysis unit, so that the coding mode of the unit to be coded can be determined through the analysis of the pre-analysis unit.
Video coding includes intra-frame coding, which uses pixel values in the same frame for coding, and inter-frame coding, which uses pixel values in adjacent frames for coding. The larger the coding cost, the higher the code rate (the number of data bits transmitted per unit time in data transmission) required to achieve the same video quality.
The method includes the steps that different coding modes to be selected corresponding to different types of coding frames have differences, a pre-analysis unit to be coded and a corresponding coding mode to be selected are obtained, the coding modes to be selected can be all coding modes to be selected corresponding to the coding units to be coded, and the coding modes to be selected provided by the application at least comprise the following steps: intra coding mode, inter coding mode. The unit to be encoded provided by the present application may be an intra-frame encoding unit, and when the intra-frame encoding unit is a P-frame encoding frame, the corresponding encoding mode to be selected includes: SKIP mode, MERGE mode, intra coding mode, inter coding mode, wherein the intra coding mode includes: INTRA 2NX2N, INTRA NXN, etc., the inter coding modes include: INTER 2NX2N, INTER 2NXN, INTER NX2N, and the like.
The preset specification of the pre-analysis unit provided by the application is NxN, and the size of the corresponding coding sub-block is 2Nx2N based on the relationship between the resolution of the coding frame and the resolution of the original frame in the pre-analysis process. Since the resolution of the encoded frame during the pre-analysis process is generally 1/4 of the original frame, for an intra-coding unit with a size of 16x16, the size of the corresponding pre-analysis unit is 8x8, as shown in fig. 3.
The intra-frame coding cost and the inter-frame coding cost can be calculated by adopting the existing cost calculation method, such as: calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit, wherein the formula of the pre-coding cost can be as follows: cost ═ D + λ R; accordingly, the intra-coding cost can be calculated as follows: cost (intra) is calculated as follows: the cost is coding cost, D represents the distortion degree of the image coding block corresponding to the coding unit, D is obtained by using absolute difference and SAD (sum of absolute error), λ is lagrangian constant, and R represents the number of bits occupied by the image coding block corresponding to the coding unit. In other embodiments, the coding cost may be represented by D alone, i.e., cost ═ D. In other embodiments, the coding cost may also be estimated from the prediction residual, and the intra-frame coding cost and the inter-frame coding cost are different in that the intra-frame cost is a cost predicted by an intra-frame prediction mode (i.e., angle prediction) and the inter-frame cost is a cost predicted by an inter-frame prediction mode (i.e., motion search).
The method comprises the steps of filtering a plurality of coding modes to be selected by utilizing intra-frame coding cost and inter-frame coding cost, specifically, filtering partial coding modes in the coding modes to be selected when the ratio of the intra-frame coding cost to the inter-frame coding cost meets a preset condition, and reducing the number of the coding modes to be selected.
The method comprises the steps of obtaining selectable coding modes after filtering processing of the coding modes to be selected, determining a final coding mode from the selectable coding modes, wherein the determined coding mode can be an optimal coding mode, and performing primary filtering on the coding modes to be selected, so that the number of the selectable coding modes is partially reduced compared with the number of the coding modes to be selected, and therefore, the coding modes are further determined from the selectable coding modes, and compared with the mode of directly determining the coding modes from the coding modes to be selected, the efficiency of determining the final coding mode is improved.
Moreover, because a large amount of absolute errors and transformed absolute errors and high-complexity calculation are involved in motion estimation and coding cost calculation, the filtering process provided by the application does not involve complex calculation of code rate or absolute errors and the like, and the complexity of data calculation for determining a final coding mode is reduced.
According to the coding mode determining method based on the pre-analysis information, the intra-frame coding cost and the inter-frame coding cost in the coding analysis process are utilized to filter the coding modes to be selected for the unit to be coded, the number of the coding modes determined by the unit to be coded is reduced, the unit to be coded is prevented from traversing all the coding modes to be selected to determine the final coding mode, the determining process of the coding modes is simplified, if the finally determined coding mode is the optimal coding mode, the determining efficiency of the optimal coding mode can be improved, and the video coding speed is improved by utilizing the optimal coding mode.
Because the resolution of the coding frame in the analysis process is about one fourth of the resolution of the original coding frame, the coding cost of the pre-analysis unit is adopted to filter the coding mode to be selected, compared with a mode of filtering by using the original coding unit, the method greatly reduces the data processing amount, and is beneficial to improving the speed of obtaining the coding cost and determining the coding mode.
In order to make clearer the filtering scheme of the coding mode provided by the present application and the technical effect thereof, the following detailed description will be made on specific embodiments thereof with a plurality of examples.
A possible implementation manner is provided in the embodiment of the present application, and the step of obtaining the pre-analysis unit corresponding to the unit to be encoded, disclosed in step S201, includes:
a1, acquiring the size of a coding sub-block corresponding to a pre-analysis sub-unit with a preset specification; the system comprises a pre-analysis unit, a data processing unit and a data processing unit, wherein the pre-analysis unit consists of at least one pre-analysis subunit with a preset specification;
a2, when the unit to be coded comprises a plurality of coding sub-blocks, dividing the unit to be coded into a plurality of coding sub-blocks and obtaining a pre-analysis sub-unit corresponding to each coding sub-block.
Wherein the predetermined specification is the size of the pre-analysis subunit, assuming that the predetermined specification of the pre-analysis subunit is NxN, such as: 8x8, the corresponding coded sub-block size is 2Nx2N based on the relationship between the resolution of the coded frame and the resolution of the original frame in the pre-analysis process. When the unit to be coded comprises a plurality of coding sub-blocks, the unit to be coded is divided into a plurality of coding sub-blocks, each coding sub-block corresponds to one pre-analysis unit, each pre-analysis unit is composed of at least one pre-analysis sub-unit with a preset specification, namely, the pre-analysis unit corresponding to the unit to be coded can be divided into at least one pre-analysis sub-unit, so that the coding mode of the unit to be coded can be determined based on the intra-frame coding cost and the inter-frame coding cost of each pre-analysis unit.
When the predetermined size of the pre-analysis sub-unit is 8x8, the corresponding coding sub-block size is 16x16, and if the size of the unit to be coded is 32x32, the unit to be coded can be divided into 4 coding sub-blocks of 16x16, where the corresponding coding sub-blocks are: coding sub-block 1, coding sub-block 2, coding sub-block 3 and coding sub-block 4. The size of the pre-analysis unit corresponding to the unit to be encoded is 16x16, wherein the pre-analysis unit with the size of 16x16 can be divided into 4 pre-analysis sub-units with preset specifications, and each encoded sub-block corresponds to one pre-analysis sub-unit with preset specifications, as shown in fig. 4.
When the size of the unit to be encoded is 64x64, the unit to be encoded includes 4 coding units of 32x32, including 16 coding sub-blocks of 16x16, and the corresponding size of the pre-analysis unit is 32x32, the pre-analysis unit can be divided into 16 pre-analysis sub-units of 8x8, as shown in fig. 5.
The method divides the large-size unit to be coded into the plurality of coding sub-blocks so as to perform pre-analysis on each coding sub-block in the following process, can accurately obtain the coding cost of the unit to be coded based on the pre-analysis information of each coding sub-block, and can filter and determine the coding mode based on the accurate coding cost, thereby being beneficial to obtaining the optimal coding mode.
The embodiment of the present application further provides a possible implementation manner, where the step of filtering the multiple candidate coding modes based on the intra-frame coding cost and the inter-frame coding cost in step S202 includes:
b1, when the ratio of the intra-frame coding cost to the inter-frame coding cost is larger than a first threshold, filtering out the intra-frame coding mode in the coding mode to be selected;
b2, when the ratio of the interframe coding cost to the intraframe coding cost is greater than a second threshold value, filtering out the interframe coding mode in the coding mode to be selected; wherein the first threshold and the second threshold are real numbers not less than 1 and not more than 10.
The first threshold and the second threshold provided by the present application are real numbers not less than 1 and not more than 10, which may be integers or decimal numbers, and the second threshold and the first threshold may be the same or different, and depending on the training result, the network completed based on the training may be used for selecting the encoding mode.
If the ratio of the intra-frame coding cost corresponding to the pre-analysis unit to the inter-frame coding cost is greater than a first threshold, it indicates that: the intra-frame coding cost is high, and the intra-frame coding mode is selected for coding, so that the coding cost is high, and the coding efficiency is low, so that the intra-frame coding mode in the to-be-selected mode is filtered out for the to-be-coded unit in the situation.
If the ratio of the interframe coding cost and the intraframe coding cost corresponding to the pre-analysis unit is greater than the second threshold, it indicates that: the inter-frame coding cost corresponding to the pre-analysis unit is relatively high, and if the intra-frame coding mode is selected to code the unit to be coded, the coding cost of the unit to be coded is high, and the coding efficiency is low, so that the inter-frame coding mode in the mode to be selected is filtered for the unit to be coded under the condition.
According to the scheme provided by the embodiment of the application, the coding mode to be filtered is determined according to the preset first threshold and second threshold, and the ratio of the interframe coding mode cost and the intraframe coding cost corresponding to the pre-analysis unit, so that the filtering process of the coding mode to be selected is simplified, the coding mode is rapidly filtered, and the coding mode is rapidly determined in the subsequent process.
Further, when the unit to be encoded includes a plurality of encoded sub-blocks, the step of filtering the plurality of encoding modes to be selected based on the intra-frame encoding cost and the inter-frame encoding cost may be performed in the following manner, and a flowchart thereof is shown in fig. 6, and includes:
s610, calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis subunit corresponding to each coding sub-block;
S620, filtering the plurality of coding modes to be selected for filtering based on the sum of the intra-frame coding costs and the sum of the inter-frame coding costs corresponding to each pre-analysis subunit.
Alternatively, step S620 may be implemented by:
s621, obtaining the sum of intra-frame coding costs and the sum of inter-frame coding costs corresponding to each pre-analysis subunit;
s622, judging whether the ratio of the sum of the intra-frame coding costs to the sum of the inter-frame coding costs is larger than a third threshold value, if so, filtering out the intra-frame coding mode in the coding mode to be selected;
s623, judging whether the ratio of the sum of the interframe coding costs to the sum of the intraframe coding costs is larger than a fourth threshold value, if so, filtering out interframe coding modes in the coding modes to be selected.
The third threshold and the fourth threshold may be determined by seeking an optimal index for training of a large number of video sequences, the third threshold and the fourth threshold are real numbers not less than 1 and not more than 10, and may be integers or decimal numbers, the third threshold and the fourth threshold may be the same or different, and depending on a training result, a network completed based on the training may be used for selecting an encoding mode.
Optionally, as shown in fig. 4, when the size of the unit to be encoded is 32x32, the unit to be encoded is divided into 4 encoded sub-blocks of 16x16, where the corresponding encoded sub-blocks are: coding sub-block 1, coding sub-block 2, coding sub-block 3 and coding sub-block 4. The size of the pre-analysis unit corresponding to the unit to be encoded is 16x16, the pre-analysis unit with the size of 16x16 is divided into 4 pre-analysis subunits with a preset specification (8x8), each encoded sub-block corresponds to one pre-analysis subunit with a preset specification, as shown in fig. 4, for example, pre-analysis units 0, 1, 2, and 3, intra-frame encoding costs corresponding to the pre-analysis subunits are respectively: pIntraCost0, pIntraCost1, pIntraCost2 and pIntraCost3, wherein the inter-frame coding costs of each pre-analysis subunit are respectively as follows: pIntrCost 0, pIntrCost 1, pIntrCost 2, pIntrCost 3, sum of intra coding costs of each pre-analysis subunit pIntraCostSum which is pIntraCost0+ pIntraCost1+ pIntraCost2+ pIntraCost 3; the sum of the inter-coding costs of the pre-analysis subunits, pInterCostSum, pInterCost0+ pInterCost1+ pInterCost2+ pInterCost 3.
If pIntraCostSum > a1 pInterCostSum (a1 is the third threshold), then the intra-coding modes in the optional coding modes are filtered out, such as: INTRA 2NX2N, INTRANXN, and the like.
If pintercostum > b1 pintracostum (b1 is the fourth threshold), inter-coding modes among the optional coding modes are filtered out, such as: INTER 2NX2N, INTER 2NXN, INTER NX2N, etc.
Optionally, as shown in fig. 5, when the size of the unit to be encoded is 64x64, the unit to be encoded includes 4 coding units of 32x32, including 16 coding sub-blocks of 16x16, the size of the pre-analysis unit corresponding to the unit to be encoded is 32x32, the unit to be encoded can be divided into 16 pre-analysis sub-units of a preset size (8x8), each coding sub-block corresponds to one pre-analysis sub-unit of the preset size, such as the pre-analysis sub-units 0, 1, 2, … …, and 15 shown in fig. 5, the intra coding costs corresponding to the pre-analysis sub-units are: pIntraCost0, pIntraCost1, pIntraCost2, … … and pIntraCost15, wherein the sum of the intra-frame coding costs corresponding to each pre-analysis subunit is as follows: pintracostum ═ pintracostat 0+ pintracostat 1+ … + pintracostat 14+ pintracostat 15; the sum of the interframe coding costs corresponding to each pre-analysis subunit is as follows: pintercostum pInterCost0+ pInterCost1+ … + pInterCost 14+ pInterCost 15.
If pIntraCostSum > a2 pInterCostSum (a2 is the third threshold), then the intra coding modes in the optional coding modes are filtered out, such as: INTRA 2NX2N, INTRANXN, and the like.
If pintercostum > b2 pintracostum (b2 is the fourth threshold), then inter-coding modes in the optional coding modes are filtered out, such as: INTER 2NX2N, INTER 2NXN, INTER NX2N, etc.
Because the sizes of the corresponding third thresholds are different due to different specifications of the units to be coded, the third threshold is characterized by using two parameters, namely a1 and a2, under the two specifications, and the fourth threshold is the same.
According to the scheme provided by the embodiment of the application, the unit to be coded with a large specification is divided into the plurality of coding sub-blocks with a small specification, the pre-analysis information corresponding to the coding sub-blocks is used, namely the ratio of the intra-frame coding cost and the inter-frame coding cost of the pre-analysis sub-units corresponding to the coding sub-blocks is compared with the preset threshold value, the coding mode to be filtered is determined according to the comparison result, the coding mode with a large coding cost is filtered, the number of the coding modes is reduced, and meanwhile, the obtained coding cost sum can accurately represent the coding cost of the unit to be coded.
The present application further provides a possible implementation manner, and the step of determining the coding mode of the unit to be coded from the selectable coding modes provided in step S203 includes:
and traversing the selectable coding modes to obtain the interframe coding cost of the unit to be coded in the selectable coding modes, and determining the selectable coding mode corresponding to the minimum interframe coding cost as the optimal coding mode.
According to the embodiment, aiming at the condition that the unit to be coded corresponds to a single pre-analysis unit, all the selectable coding modes are traversed by the unit to be coded, the interframe coding cost of the unit to be coded is obtained, the coding mode with the minimum interframe coding cost is determined to be the optimal coding mode, the interframe coding cost is minimum, the code rate consumed when video frames with the same quality are obtained is small, and the reduction of the bandwidth of transmitted videos is facilitated.
The present application further provides a feasible implementation manner, where when a unit to be encoded includes a plurality of encoded sub-blocks, the step of determining an optional encoding mode corresponding to a minimum inter-frame encoding cost as an optimal encoding mode includes:
c1, when the minimum inter-frame coding cost is larger than a preset threshold value, calculating a plurality of intra-frame coding costs of the coding sub-blocks in different prediction directions;
C2, comparing the multiple intra-frame coding costs with the minimum inter-frame coding cost;
and C3, when any intra-frame coding cost is less than the minimum inter-frame coding cost, taking the any intra-frame coding cost as the optimal coding mode of the unit to be coded.
The scheme provided by the embodiment of the application is suitable for the situation that a unit to be coded comprises a plurality of coding sub-blocks, intra-frame coding costs in different prediction directions are calculated for any coding sub-block, a plurality of intra-frame coding costs are obtained, the intra-frame coding costs are respectively compared with the minimum inter-frame coding cost, if any intra-frame coding cost is detected to be smaller than the minimum inter-frame coding cost, a coding mode corresponding to the intra-frame coding cost smaller than the minimum inter-frame coding cost is obtained, and the coding mode is used as the optimal coding mode.
Optionally, if a plurality of intra-frame coding costs are less than the minimum inter-frame coding cost, selecting intra-frame coding with the minimum cost from the plurality of intra-frame coding costs as optimal intra-frame coding, comparing the minimum inter-frame coding cost with the optimal intra-frame coding cost, if the minimum inter-frame coding cost is less than the optimal intra-frame coding cost, taking the inter-frame coding as an optimal coding mode, and if the minimum inter-frame coding cost is greater than the optimal intra-frame coding cost, taking the intra-frame coding as the optimal coding mode.
According to the scheme provided by the embodiment of the application, the optimal coding mode is determined by comparing the intra-frame coding cost in each prediction direction with the minimum inter-frame coding cost, the coding cost corresponding to the optimal coding mode is minimum, and the video frame is coded by using the optimal coding mode, so that the video coding efficiency is improved.
A possible implementation manner is also provided in the embodiment of the present application, and as shown in fig. 7, an encoding mode determining apparatus 700 based on pre-analysis information is provided, which includes: the method comprises the following steps of obtaining a module 701 of a coding mode to be selected, a module 702 of a filtering coding mode and a module 703 of determining a coding mode, wherein the specific steps are as follows:
a module 701 for acquiring a coding mode to be selected, configured to acquire a pre-analysis unit corresponding to a unit to be coded and multiple coding modes to be selected corresponding to the unit to be coded; sampling the unit to be coded to obtain a corresponding pre-analysis unit;
a filtering and coding mode module 702, configured to calculate intra-frame coding cost and inter-frame coding cost of the pre-analysis unit, and perform filtering processing on the multiple coding modes to be selected based on the intra-frame coding cost and the inter-frame coding cost;
a coding mode determining module 703 is configured to obtain selectable coding modes obtained after the filtering processing of the multiple coding modes to be selected, and determine a coding mode of the unit to be coded from the selectable coding modes.
The coding mode determining device based on the pre-analysis information performs filtering of the to-be-selected coding mode on the to-be-coded unit by using the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit in the coding analysis process to obtain the optional coding modes after filtering processing of the to-be-selected coding mode, and determines the final coding mode from the optional coding modes, wherein the number of the optional coding modes is partially reduced compared with the number of the to-be-selected coding modes, so that the coding mode is further determined from the optional coding modes, and compared with the mode which is directly determined from the to-be-selected coding modes, the efficiency of determining the final coding mode is improved.
In an optional embodiment provided in this application, the filtering and encoding mode module 702 further includes:
the first filtering intra-frame coding mode unit is used for filtering out the intra-frame coding mode in the coding mode to be selected when the ratio of the intra-frame coding cost to the inter-frame coding cost is greater than a first threshold value;
the first filtering interframe coding mode unit is used for filtering out interframe coding modes in the coding modes to be selected when the ratio of the interframe coding cost to the intraframe coding cost is greater than a second threshold value; wherein the first threshold and the second threshold are real numbers not less than 1 and not more than 10.
In an optional embodiment of the second aspect, the module 701 for obtaining a candidate encoding mode further includes:
the coding sub-block size obtaining unit is used for obtaining the coding sub-block size corresponding to the pre-analysis sub-unit with the preset specification; the system comprises a pre-analysis unit, a data processing unit and a data processing unit, wherein the pre-analysis unit consists of at least one pre-analysis subunit with a preset specification;
and the partitioning unit is used for partitioning the unit to be coded into a plurality of coding sub-blocks and obtaining a pre-analysis sub-unit corresponding to each coding sub-block when the unit to be coded comprises the plurality of coding sub-blocks.
In an alternative embodiment of the second aspect, the filtering encoding mode module 702 further includes:
the coding cost calculating unit is used for calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis subunit corresponding to each coding sub-block;
and the filtering to-be-selected coding mode unit is used for filtering the plurality of to-be-selected coding modes based on the intra-frame coding cost sum and the inter-frame coding cost sum corresponding to each pre-analysis subunit.
In an optional embodiment of the second aspect, the filtering the candidate coding mode unit further includes:
a second filtering intra-frame coding mode subunit, configured to filter, when a ratio of the sum of the intra-frame coding costs to the sum of the inter-frame coding costs is greater than a third threshold, an intra-frame coding mode in the to-be-selected coding mode;
The second filtering interframe coding mode subunit is used for filtering the interframe coding modes in the coding modes to be selected when the ratio of the sum of the interframe coding costs to the sum of the intraframe coding costs is greater than a fourth threshold value; wherein the third threshold and the fourth threshold are real numbers not less than 1 and not more than 10.
In an alternative embodiment of the second aspect, the determining encoding mode module 703 includes:
and the traversal optional coding mode unit is used for traversing the optional coding modes, sequentially obtaining the interframe coding cost of the unit to be coded in the optional coding modes, and determining the optional coding mode corresponding to the minimum interframe coding cost as the optimal coding mode.
In an optional embodiment of the second aspect, when the unit to be encoded includes a plurality of encoded sub-blocks, the traversing the optional encoding mode unit further includes:
the intra-frame coding cost calculating subunit is used for calculating intra-frame coding costs of the coding sub-blocks in different prediction directions when the minimum inter-frame coding cost is greater than a preset threshold value;
a comparing subunit, configured to compare the intra-frame coding costs with the minimum inter-frame coding cost;
And determining an optimal coding mode subunit, which is used for taking any intra-frame coding as the optimal coding mode of the unit to be coded when any intra-frame coding cost is less than the minimum inter-frame coding cost.
The encoding mode determining apparatus based on pre-analysis information of the embodiment of the present application may execute an encoding mode determining method based on pre-analysis information provided by the embodiment of the present application, and the implementation principle thereof is similar, the actions performed by each module in the encoding mode determining apparatus based on pre-analysis information of the embodiments of the present application correspond to the steps in the encoding mode determining method based on pre-analysis information of the embodiments of the present application, and for the detailed functional description of each module of the encoding mode determining apparatus based on pre-analysis information, reference may be specifically made to the description in the corresponding encoding mode determining method based on pre-analysis information shown in the foregoing, and details are not repeated here.
Based on the same principle as the method shown in the embodiments of the present application, there is also provided in the embodiments of the present application an electronic device, which may include but is not limited to: a processor and a memory; a memory for storing computer operating instructions; and a processor for executing the encoding mode determination method based on the pre-analysis information shown in the embodiment by calling the computer operation instruction. Compared with the prior art, the coding mode determining method based on the pre-analysis information can filter the coding modes to be selected for the coding unit to be coded by utilizing the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit in the coding analysis process, and improves the efficiency of determining the final coding mode.
In an alternative embodiment, an electronic device is provided, as shown in fig. 8, where the electronic device 4000 shown in fig. 8 may be a client or a server, and includes: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further comprise a transceiver 4004. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited to.
The memory 4003 is used for storing application codes for executing the scheme of the present application, and the execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
The present application provides a computer-readable storage medium, which stores a computer program, and when the computer program runs on a computer, the computer can execute the corresponding content in the foregoing method embodiments. Compared with the prior art, the coding mode determining method based on the pre-analysis information can add the tail sub-tree node on the root node, store the difference obtained by the change making operation on the tail sub-tree node, and avoid resource consumption caused by storing the difference currency in the binary tree again according to the preset rule.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or in turns with other steps or at least a portion of the sub-steps or stages of other steps.
It should be noted that the computer readable medium mentioned above in the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The name of a module does not in some cases form a limitation on the module itself, and for example, a filtering encoding mode module may also be described as a "filtering candidate encoding module".
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be understood by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features may be replaced with (but not limited to) technical features having similar functions disclosed in the present application.

Claims (10)

1. A method for determining coding modes based on pre-analyzed information, comprising:
acquiring a pre-analysis unit corresponding to a unit to be coded and a plurality of coding modes to be selected corresponding to the unit to be coded; sampling the unit to be coded to obtain a corresponding pre-analysis unit;
calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit, and filtering the multiple coding modes to be selected based on the intra-frame coding cost and the inter-frame coding cost;
and acquiring the selectable coding modes after the filtering processing of the multiple coding modes to be selected, and determining the coding mode of the unit to be coded from the selectable coding modes.
2. The method according to claim 1, wherein the step of filtering the multiple candidate coding modes based on the intra-frame coding cost and the inter-frame coding cost comprises:
when the ratio of the intra-frame coding cost to the inter-frame coding cost is larger than a first threshold value, filtering out intra-frame coding modes in the coding modes to be selected;
when the ratio of the interframe coding cost to the intraframe coding cost is greater than a second threshold value, filtering out interframe coding modes in the coding modes to be selected; wherein the first threshold and the second threshold are real numbers not less than 1 and not more than 10.
3. The method according to claim 1, wherein the step of obtaining the pre-analysis unit corresponding to the unit to be encoded comprises:
acquiring the size of a coding sub-block corresponding to a pre-analysis sub-unit with a preset specification; the system comprises a pre-analysis unit, a data processing unit and a data processing unit, wherein the pre-analysis unit consists of at least one pre-analysis subunit with a preset specification;
when the unit to be coded comprises a plurality of coding sub-blocks, the unit to be coded is divided into a plurality of coding sub-blocks, and a pre-analysis sub-unit corresponding to each coding sub-block is obtained.
4. The method according to claim 3, wherein the step of filtering the plurality of candidate coding modes based on the intra-frame coding cost and the inter-frame coding cost comprises:
calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis subunit corresponding to each coding sub-block;
and filtering the plurality of coding modes to be selected based on the sum of the intra-frame coding costs and the sum of the inter-frame coding costs corresponding to the pre-analysis subunits.
5. The method according to claim 4, wherein the step of filtering the multiple candidate coding modes based on the sum of intra-frame coding costs and the sum of inter-frame coding costs corresponding to each pre-analysis subunit comprises:
when the ratio of the sum of the intra-frame coding costs to the sum of the inter-frame coding costs is greater than a third threshold value, filtering out the intra-frame coding mode in the coding mode to be selected;
when the ratio of the sum of the interframe coding costs to the sum of the intraframe coding costs is greater than a fourth threshold value, filtering out interframe coding modes in the coding modes to be selected; wherein the third threshold and the fourth threshold are real numbers not less than 1 and not more than 10.
6. The method of claim 1, wherein the step of determining the coding mode of the unit to be coded from the selectable coding modes comprises:
and traversing the selectable coding modes to obtain the interframe coding cost of the unit to be coded in the selectable coding modes, and determining the selectable coding mode corresponding to the minimum interframe coding cost as the optimal coding mode.
7. The method of claim 6, wherein when the unit to be encoded includes a plurality of encoded sub-blocks, the step of determining the selectable encoding mode corresponding to the minimum inter-coding cost as the optimal encoding mode comprises:
when the minimum inter-frame coding cost is larger than a preset threshold value, calculating a plurality of intra-frame coding costs of the coding sub-blocks in different prediction directions;
comparing the plurality of intra-coding costs to the minimum inter-coding cost;
and when any intra-frame coding cost is smaller than the minimum inter-frame coding cost, taking the any intra-frame coding cost as the optimal coding mode of the unit to be coded.
8. An encoding mode determining apparatus based on pre-analysis information, comprising:
The device comprises a module for acquiring coding modes to be selected, a module for acquiring pre-analysis units corresponding to the coding units to be selected and a plurality of coding modes to be selected corresponding to the coding units to be selected; sampling the unit to be coded to obtain a corresponding pre-analysis unit;
the filtering and coding mode module is used for calculating the intra-frame coding cost and the inter-frame coding cost of the pre-analysis unit and filtering the multiple coding modes to be selected based on the intra-frame coding cost and the inter-frame coding cost;
and the coding mode determining module is used for acquiring the selectable coding modes after the filtering processing of the multiple coding modes to be selected, and determining the coding mode of the unit to be coded from the selectable coding modes.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for determining an encoding mode based on pre-analyzed information according to any one of claims 1 to 7 when executing the program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, implements the method for determining an encoding mode based on pre-analysis information according to any one of claims 1 to 7.
CN202010318251.XA 2020-04-21 2020-04-21 Encoding mode determining method and device, electronic equipment and storage medium Pending CN113542737A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010318251.XA CN113542737A (en) 2020-04-21 2020-04-21 Encoding mode determining method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010318251.XA CN113542737A (en) 2020-04-21 2020-04-21 Encoding mode determining method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113542737A true CN113542737A (en) 2021-10-22

Family

ID=78123854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010318251.XA Pending CN113542737A (en) 2020-04-21 2020-04-21 Encoding mode determining method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113542737A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023155751A1 (en) * 2022-02-17 2023-08-24 百果园技术(新加坡)有限公司 Video coding control method, apparatus, device, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023155751A1 (en) * 2022-02-17 2023-08-24 百果园技术(新加坡)有限公司 Video coding control method, apparatus, device, and storage medium

Similar Documents

Publication Publication Date Title
RU2699258C2 (en) Image prediction method and an image prediction device
US10455229B2 (en) Prediction mode selection method, apparatus and device
CN110248189B (en) Video quality prediction method, device, medium and electronic equipment
CN114501010B (en) Image encoding method, image decoding method and related devices
CN109905702B (en) Method, device and storage medium for determining reference information in video coding
KR20190061073A (en) Code rate allocation method for intra frame coded frames, computer equipment, and storage medium
CN112203085B (en) Image processing method, device, terminal and storage medium
WO2020143585A1 (en) Video encoder, video decoder, and corresponding method
CN117280691A (en) Enhanced motion vector prediction
CN112203086B (en) Image processing method, device, terminal and storage medium
CN113573066A (en) Video coding method and device
CN113542737A (en) Encoding mode determining method and device, electronic equipment and storage medium
CN110149512B (en) Inter-frame prediction acceleration method, device, computer storage medium and equipment
CN105828084B (en) HEVC (high efficiency video coding) inter-frame coding processing method and device
CN112839224B (en) Prediction mode selection method and device, video coding equipment and storage medium
CN112135149B (en) Entropy encoding/decoding method and device of syntax element and codec
CN112218086A (en) Encoding method, decoding method, transmission method, encoding device, decoding device, and system
CN117376551B (en) Video coding acceleration method and electronic equipment
CN110868601B (en) Inter-frame prediction method, inter-frame prediction device, video encoder and video decoder
CN109803147B (en) Transformation processing method and device based on video texture features
RU2787812C2 (en) Method and equipment for video image prediction
WO2020135368A1 (en) Inter-frame prediction method and apparatus
CN115767103A (en) Data processing method and device, computer equipment and storage medium
WO2020119742A1 (en) Block division method, video encoding and decoding method, and video codec
US9154793B1 (en) Apparatus and method for processing image recorded in black box for vehicle

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40054492

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination