CN113938690A - Video coding method and device, electronic equipment and storage medium - Google Patents

Video coding method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113938690A
CN113938690A CN202111464487.5A CN202111464487A CN113938690A CN 113938690 A CN113938690 A CN 113938690A CN 202111464487 A CN202111464487 A CN 202111464487A CN 113938690 A CN113938690 A CN 113938690A
Authority
CN
China
Prior art keywords
prediction
current
block
cost
prediction direction
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.)
Granted
Application number
CN202111464487.5A
Other languages
Chinese (zh)
Other versions
CN113938690B (en
Inventor
冯伟伦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202111464487.5A priority Critical patent/CN113938690B/en
Publication of CN113938690A publication Critical patent/CN113938690A/en
Application granted granted Critical
Publication of CN113938690B publication Critical patent/CN113938690B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • 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

Landscapes

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

Abstract

The present disclosure relates to a video encoding method, a video encoding device, an electronic device, and a storage medium, wherein when performing bidirectional prediction, in a case where the current iteration number satisfies a preset iteration number condition, a current prediction cost is obtained, it is determined whether the current prediction cost satisfies the preset cost condition, if the preset cost condition is satisfied, another prediction direction in the bidirectional prediction is updated to the current prediction direction, the current iteration number is updated, the bidirectional prediction iteration operation is continuously performed, otherwise, a bidirectional prediction result of the current block is obtained based on prediction blocks in two prediction directions, thereby avoiding redundant iteration in bidirectional prediction, and saving encoding time.

Description

Video coding method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing, and in particular, to a video encoding method and apparatus, an electronic device, and a storage medium.
Background
When encoding video, it is necessary to adaptively select a predetermined encoding mode according to video content, which is called mode selection for video encoding. Inter bi-prediction is the most time consuming in the mode selection for video coding. Especially in the offline coding scenario, in order to preserve the coding performance as much as possible, a more aggressive pruning or search skipping scheme cannot be used to save the coding time, thereby improving the coding efficiency, so a more reasonable and stable video coding method needs to be designed.
Disclosure of Invention
The present disclosure provides a video encoding method, an apparatus, an electronic device, and a storage medium, so as to at least solve the problem of low encoding efficiency due to time consumption of inter-frame bi-directional prediction in the related art.
According to a first aspect of embodiments of the present disclosure, there is provided a video encoding method, including: the method comprises the following steps: determining a current prediction direction for bidirectional prediction of a current block, and initializing current iteration times; performing bi-predictive iterative operations, wherein the bi-predictive iterative operations comprise: obtaining an inverted block of a prediction block in a current prediction direction, and performing motion search in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block based on the inverted block to obtain a prediction block in the other prediction direction; and under the condition that the current iteration times meet a preset iteration time condition, acquiring current prediction cost, determining whether the current prediction cost meets the preset cost condition, if so, updating the other prediction direction in the bidirectional prediction to be the current prediction direction, updating the current iteration times, and continuously executing the bidirectional prediction iteration operation, otherwise, obtaining a bidirectional prediction result of the current block based on prediction blocks in two prediction directions.
Optionally, the determining a current prediction direction for bi-directional prediction of the current block comprises: and respectively executing unidirectional motion search in two prediction directions for the current block, and determining the direction with lower prediction cost in the two prediction directions as the current prediction direction of bidirectional prediction for the current block.
Optionally, the obtaining an inverted block of a prediction block in a current prediction direction, and performing a motion search in another prediction direction except the current prediction direction among two prediction directions for the current block based on the inverted block to obtain a prediction block in the other prediction direction includes: obtaining an inverse block of a prediction block with the minimum prediction cost in the current prediction direction, and performing motion search based on the inverse block in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block to obtain the prediction block with the minimum prediction cost in the other prediction direction.
Optionally, the performing a motion search based on the inverse block to obtain a prediction block with a minimum prediction cost in the other prediction direction includes: and finding a prediction block with the minimum difference in the time and/or space dimension with the reverse block in the reference frame in the other prediction direction as the prediction block with the minimum prediction cost in the other prediction direction.
Optionally, the obtaining the current predicted cost and determining whether the current predicted cost meets a preset cost condition include: obtaining the current prediction cost of the other prediction direction, and determining the relationship between the current prediction cost of the other prediction direction and a cost threshold, wherein the cost threshold is determined according to the minimum prediction cost in the prediction costs of the two prediction directions during unidirectional motion search; and when the current prediction cost is larger than the cost threshold, determining that the current prediction cost meets a preset cost condition, otherwise, determining that the current prediction cost does not meet the preset cost condition.
Optionally, the cost threshold is determined according to a minimum prediction cost among prediction costs of two prediction directions in a unidirectional motion search and a quantization step size for the current block.
Optionally, the cost threshold is obtained by dividing a minimum prediction cost among prediction costs of two prediction directions in the unidirectional motion search by a value determined based on the quantization step.
Optionally, the value is determined by comparing the quantization step size with a predetermined step size threshold, wherein the value is equal to 1 when the quantization step size is greater than the predetermined step size threshold; otherwise, the value is equal to a value between 0 and 1 determined according to the quantization step.
Optionally, the method further comprises: and under the condition that the current iteration times do not meet the preset iteration time condition, obtaining a bidirectional prediction result of the current block based on the prediction blocks in the two prediction directions.
According to a second aspect of the embodiments of the present disclosure, there is provided a video encoding apparatus including: an initialization unit configured to determine a current prediction direction for bi-directional prediction of a current block and initialize a current iteration number; a bi-directional prediction unit configured to: performing bi-predictive iterative operations, wherein the bi-predictive iterative operations comprise: obtaining an inverted block of a prediction block in a current prediction direction, and performing motion search in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block based on the inverted block to obtain a prediction block in the other prediction direction; and under the condition that the current iteration times meet a preset iteration time condition, acquiring current prediction cost, determining whether the current prediction cost meets the preset cost condition, if so, updating the other prediction direction in the bidirectional prediction to be the current prediction direction, updating the current iteration times, and continuously executing the bidirectional prediction iteration operation, otherwise, obtaining a bidirectional prediction result of the current block based on prediction blocks in two prediction directions.
Optionally, the determining a current prediction direction for bi-directional prediction of the current block comprises: and respectively executing unidirectional motion search in two prediction directions for the current block, and determining the direction with lower prediction cost in the two prediction directions as the current prediction direction of bidirectional prediction for the current block.
Optionally, the obtaining an inverted block of a prediction block in a current prediction direction, and performing a motion search in another prediction direction except the current prediction direction among two prediction directions for the current block based on the inverted block to obtain a prediction block in the other prediction direction includes: and obtaining an inverted block of the prediction block with the minimum prediction cost in the current prediction direction, and performing motion search on the basis of the inverted block in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block to obtain the prediction block with the minimum prediction cost in the other prediction direction.
Optionally, the performing a motion search based on the inverse block to obtain a prediction block with a minimum prediction cost in the other prediction direction includes: and finding a prediction block with the minimum difference in the time and/or space dimension with the reverse block in the reference frame in the other prediction direction as the prediction block with the minimum prediction cost in the other prediction direction.
Optionally, the obtaining the current predicted cost and determining whether the current predicted cost meets a preset cost condition include: obtaining the current prediction cost of the other prediction direction, and determining the relationship between the current prediction cost of the other prediction direction and a cost threshold, wherein the cost threshold is determined according to the minimum prediction cost in the prediction costs of the two prediction directions during unidirectional motion search; and when the current prediction cost is larger than the cost threshold, determining that the current prediction cost meets a preset cost condition, otherwise, determining that the current prediction cost does not meet the preset cost condition.
Optionally, the cost threshold is determined according to a minimum prediction cost among prediction costs of two prediction directions in a unidirectional motion search and a quantization step size for the current block.
Optionally, the cost threshold is obtained by dividing a minimum prediction cost among prediction costs of two prediction directions in the unidirectional motion search by a value determined based on the quantization step.
Optionally, the value is determined by comparing the quantization step size with a predetermined step size threshold, wherein the value is equal to 1 when the quantization step size is greater than the predetermined step size threshold; otherwise, the value is equal to a value between 0 and 1 determined according to the quantization step.
Optionally, the bi-directional prediction unit is further configured to: and under the condition that the current iteration times do not meet the preset iteration time condition, obtaining a bidirectional prediction result of the current block based on the prediction blocks in the two prediction directions.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus, including: at least one processor; at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform a video encoding method as described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium storing instructions that, when executed by at least one processor, cause the at least one processor to perform the video encoding method as described above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising computer instructions, characterized in that the computer instructions, when executed by a processor, implement the video encoding method as described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects: according to the video coding method of the embodiment of the disclosure, under the condition that the current iteration number meets the preset iteration number condition, bidirectional prediction is not directly continuously executed, but the current prediction cost is obtained, whether the current prediction cost meets the preset cost condition or not is determined, and bidirectional prediction iteration operation is continuously executed only when the preset cost condition is met, so that redundant iteration in bidirectional prediction can be avoided as much as possible under the condition that the coding performance is ensured, time consumption is reduced, and the improvement of the coding efficiency is facilitated.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is an exemplary system architecture to which exemplary embodiments of the present disclosure may be applied;
fig. 2 is a flowchart illustrating a video encoding method according to an exemplary embodiment of the present disclosure;
fig. 3 is a diagram illustrating initializing a current prediction direction for bi-directional prediction of a current block according to an exemplary embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating an example of a video encoding method according to an exemplary embodiment of the present disclosure;
fig. 5 is a block diagram illustrating a video encoding apparatus according to an exemplary embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The embodiments described in the following examples do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In this case, the expression "at least one of the items" in the present disclosure means a case where three types of parallel expressions "any one of the items", "a combination of any plural ones of the items", and "the entirety of the items" are included. For example, "include at least one of a and B" includes the following three cases in parallel: (1) comprises A; (2) comprises B; (3) including a and B. For another example, "at least one of the first step and the second step is performed", which means that the following three cases are juxtaposed: (1) executing the step one; (2) executing the step two; (3) and executing the step one and the step two.
Fig. 1 illustrates an exemplary system architecture 100 in which exemplary embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. A user may use the terminal devices 101, 102, 103 to interact with the server 105 over the network 104 to receive or send messages (e.g., video data upload requests, video data download requests), etc. Various communication client applications, such as audio and video communication software, audio and video recording software, instant messaging software, conference software, mailbox clients, social platform software, and the like, may be installed on the terminal devices 101, 102, and 103. The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and capable of playing, recording, editing, etc. audio and video, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, etc. When the terminal device 101, 102, 103 is software, it may be installed in the electronic devices listed above, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or it may be implemented as a single software or software module. And is not particularly limited herein.
The terminal devices 101, 102, 103 may be equipped with an image capturing device (e.g., a camera) to capture video data. In practice, the smallest visual unit that makes up a video is a Frame (Frame). Each frame is a static image. Temporally successive sequences of frames are composited together to form a motion video. Further, the terminal apparatuses 101, 102, 103 may also be mounted with a component (e.g., a speaker) for converting an electric signal into sound to play the sound, and may also be mounted with a device (e.g., a microphone) for converting an analog audio signal into a digital audio signal to pick up the sound. In addition, the terminal apparatuses 101, 102, 103 can perform voice communication or video communication with each other.
The server 105 may be a server providing various services, such as a background server providing support for multimedia applications installed on the terminal devices 101, 102, 103. The background server can analyze, store and the like the received data such as the audio and video data uploading request, can also receive the audio and video data downloading request sent by the terminal equipment 101, 102 and 103, and feeds back the audio and video data indicated by the audio and video data downloading request to the terminal equipment 101, 102 and 103.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the video encoding method provided by the embodiment of the present disclosure may be executed by a terminal device or a server. Accordingly, the video encoding apparatus may be provided in either the terminal device or the server.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation, and the disclosure is not limited thereto.
Hereinafter, a video encoding method of an exemplary embodiment of the present disclosure will be described with reference to fig. 2 to 4.
Fig. 2 is a flowchart illustrating a video encoding method according to an exemplary embodiment of the present disclosure.
Referring to fig. 2, in step S210, a current prediction direction for bi-directional prediction of a current block is determined, and a current iteration number is initialized. In particular, the current iteration number may be initialized to a predetermined number, e.g., 0, which may be marked as loop ═ 0. Further, determining the current prediction direction for the bi-directional prediction of the current block may be arbitrarily selecting one prediction direction from two prediction directions (forward or backward) for the current block as the current prediction direction. Alternatively, the determination of the current prediction direction for the bi-directional prediction of the current block may be a selection of an appropriate direction from two prediction directions as the current prediction direction according to a predetermined criterion. For example, the determining a current prediction direction for bi-directional prediction of the current block may include: and respectively executing unidirectional motion search in two prediction directions for the current block, and determining the direction with lower prediction cost in the two prediction directions as the current prediction direction of bidirectional prediction for the current block. Specifically, unidirectional motion search may be performed on the current block in two prediction directions, respectively, to obtain a prediction block with the minimum prediction cost in each prediction direction, and then, a direction with a smaller prediction cost in the two prediction directions may be determined according to the obtained prediction block as the current prediction direction of the bidirectional prediction on the current block.
Fig. 3 is a diagram illustrating a determination of a current prediction direction for bi-prediction of a current block according to an exemplary embodiment of the present disclosure. The bi-directional prediction for the current block is forward prediction and backward prediction, respectively, assuming that direction 0 represents forward and direction 1 represents backward. As shown in fig. 3, unidirectional motion search may be first performed on the current block in the direction 0 and the direction 1, respectively, to obtain a prediction block with the minimum prediction cost in each prediction direction. Specifically, when performing unidirectional motion search in each prediction direction, a prediction block having the smallest difference in temporal and/or spatial dimensions from the current block may be searched from a reference frame of the current block in the prediction direction as a prediction block having the smallest prediction cost in the prediction direction. Then, a prediction cost in each prediction direction can be determined according to a difference between a prediction block obtained in each prediction direction and a current block in a time dimension and/or a space dimension, and the prediction costs in the two prediction directions are compared to determine a direction with a smaller prediction cost in the two prediction directions. If the direction 0 is less costly than the direction 1 prediction, the direction 0 is determined as the current prediction direction for the bi-prediction of the current block, otherwise, the direction 1 is determined as the current prediction direction for the bi-prediction of the current block. As an example, the difference in the temporal dimension may be a motion vector difference between the current block and the prediction block, and the difference in the spatial dimension may be a difference of two block pixel values.
Next, in step S220, a bidirectional prediction iterative operation is performed. According to an exemplary embodiment, the bi-predictive iterative operation includes: obtaining an inverted block of a prediction block in a current prediction direction, and performing motion search in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block based on the inverted block to obtain the prediction block in the other prediction direction.
According to an exemplary embodiment, obtaining an inverted block of a prediction block in a current prediction direction, and performing a motion search in another prediction direction other than the current prediction direction among two prediction directions for the current block based on the inverted block to obtain a prediction block in the other prediction direction, includes: obtaining an inverse block of a prediction block with the minimum prediction cost in the current prediction direction, and performing motion search based on the inverse block in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block to obtain the prediction block with the minimum prediction cost in the other prediction direction.
Here, obtaining the inverse block of the prediction block having the smallest prediction cost in the current prediction direction may include: first, a prediction block with the smallest prediction cost in the current prediction direction is obtained, and specifically, obtaining the prediction block with the smallest prediction cost may be directly reading the prediction block obtained by performing unidirectional motion search in the current prediction direction for the current block, or may also be obtaining the prediction block with the smallest prediction cost in the current prediction direction by performing unidirectional motion search in the current prediction direction for the current block again. Then, after a prediction block with the minimum prediction cost in the current prediction direction is obtained, each pixel value of the prediction block is subtracted from the maximum pixel value in the color space, and an inverse block of the prediction block is obtained.
Furthermore, according to an exemplary embodiment, performing a motion search based on the inverse block to obtain a prediction block with a minimum prediction cost in the other prediction direction includes: and finding a prediction block with the minimum difference in the time and/or space dimension with the reverse block in the reference frame in the other prediction direction as the prediction block with the minimum prediction cost in the other prediction direction. As an example, the difference in the temporal dimension may be a motion vector difference between the current block and the prediction block, and the difference in the spatial dimension may be a difference of two block pixel values.
In step S230, under the condition that the current iteration number satisfies a preset iteration number condition, obtaining a current prediction cost, determining whether the current prediction cost satisfies the preset cost condition, if so, updating another prediction direction in the bidirectional prediction to a current prediction direction, updating the current iteration number, and continuing to execute the bidirectional prediction iteration operation, otherwise, obtaining a bidirectional prediction result of the current block based on prediction blocks in two prediction directions.
For example, the preset iteration number condition may be, but is not limited to, that the current iteration number is less than a predetermined iteration number.
As an example, the obtaining of the current prediction cost and determining whether the current prediction cost meets a preset cost condition includes: obtaining the current prediction cost of the other prediction direction, and determining the relation between the current prediction cost of the other prediction direction and a cost threshold; and when the current prediction cost is larger than the cost threshold, determining that the current prediction cost meets a preset cost condition, otherwise, determining that the current prediction cost does not meet the preset cost condition.
As described above, for example, in step S220, a motion search is performed based on the inverse block, and a prediction block with the smallest prediction cost in the other prediction direction is obtained. In this case, the prediction cost corresponding to the prediction block with the smallest prediction cost in the other prediction direction may be directly used as the current prediction cost in the other prediction direction.
As an example, the cost threshold may be determined according to a minimum prediction cost among prediction costs of two prediction directions at the time of the unidirectional motion search. For example, the predetermined threshold may be the minimum prediction cost itself, or a threshold determined according to the minimum prediction cost. Furthermore, optionally, the cost threshold may also be determined according to a minimum prediction cost among prediction costs of two prediction directions in a unidirectional motion search and a quantization step size for the current block. For example, the predetermined threshold may be obtained by dividing a minimum prediction cost among prediction costs of two prediction directions in the unidirectional motion search by a value determined based on the quantization step.
Assuming that the above minimum prediction cost is denoted as bestUniLumaCost, and the value determined based on the quantization step size is denoted as ratio, the cost threshold may be denoted as bestUniLumaCost/ratio. As an example, the numerical value ratio may be determined by comparing the quantization step size with a predetermined step size threshold. For example, when the quantization step is greater than a predetermined step threshold, the value is equal to 1, otherwise, the value is equal to a value between 0 and 1 determined according to the quantization step. As an example, ratio QP > 301: 0.512 × exp (0.022 × QP), in which equation 30 is the above-mentioned predetermined step threshold, when QP > 30, ratio is 1, otherwise ratio is 0.512 × exp (0.022 × QP), which is a number between 0 and 1. It should be noted that the predetermined step threshold is not limited to 30, but may be other values. For example, assuming that the current prediction cost is labeled iterCost, if the following formula is satisfied, it is considered that the cost after the current iteration is too large, and then a better bi-directional prediction result than the uni-directional prediction is not generated, and it has no meaning to perform more iterations, and the bi-directional prediction may be ended early (i.e., the operation of step S220 is not performed again):
iterCost>bestUniLumaCost/ratio,
wherein ratio QP > 301: 0.512 × exp (0.022 × QP).
Through the above description, when the current iteration number satisfies the preset iteration number condition (for example, the current iteration number is less than the preset iteration number), instead of directly continuing the bidirectional prediction iteration operation, the current prediction cost is obtained, whether the current prediction cost satisfies the preset cost condition is determined, if not, the bidirectional prediction is ended in advance, and the bidirectional prediction result of the current block is obtained based on the prediction blocks in the current two prediction directions. Therefore, redundant iteration in bidirectional prediction can be avoided as much as possible under the condition of ensuring the coding performance, time consumption is reduced, and the improvement of the coding efficiency is facilitated.
Alternatively, although not shown in fig. 2, according to an exemplary embodiment, the video encoding method shown in fig. 2 may further include: and under the condition that the current iteration times do not meet the preset iteration time condition, obtaining a bidirectional prediction result of the current block based on the prediction blocks in the two prediction directions.
As an example, the above-mentioned obtaining of the bidirectional prediction result of the current block based on the prediction blocks in the two prediction directions may be obtaining of the bidirectional prediction result of the current block by averaging or performing weighted average on pixel values of the prediction blocks in the current two prediction directions, but is not limited thereto. Also, in case of obtaining the bidirectional prediction result of the current block, encoding of the current block may be performed based on the bidirectional prediction result of the current block. To more clearly understand the video encoding method according to the exemplary embodiment of the present disclosure, it is further described below with reference to the example of fig. 4. Fig. 4 is a schematic diagram illustrating an example of a video encoding method according to an exemplary embodiment of the present disclosure. In fig. 4, it is assumed that i is the current prediction direction, and it is assumed that a direction 0 is determined as the current prediction direction (i.e., i ═ 0) and the current iteration number is initialized to 0 (i.e., loop ═ 0) at step S210.
Next, an inverted block of the prediction block with the smallest prediction cost in the direction i is obtained, and a motion search is performed based on the inverted block in the direction (1-i), resulting in the prediction block with the smallest prediction cost in the direction (1-i), and then it is determined whether loop is less than N (a predetermined number of iterations, for example, N ═ 4). If not, the bidirectional prediction is finished, and the bidirectional prediction result of the current block is obtained based on the prediction blocks in the current two prediction directions. And if so, acquiring the current prediction cost of the direction (1-i), and determining whether the prediction cost meets a preset cost condition. If the preset cost condition is met, making loop +1 and i 1-i, then continuing to perform the bidirectional prediction iteration operation (i.e., obtaining an inverse block of the prediction block with the minimum prediction cost in the direction i, and performing motion search in the direction (1-i) based on the inverse block to obtain the prediction block with the minimum prediction cost in the direction (1-i)), otherwise, ending the bidirectional prediction in advance, and obtaining the bidirectional prediction result of the current block based on the prediction blocks in the current direction 0 and the direction 1.
In the above, the video coding method according to the embodiment of the present disclosure has been described with reference to fig. 2 to 4, according to the video coding method, when the current iteration number satisfies the preset iteration number condition, the bidirectional prediction is not directly continuously performed, but whether it is appropriate to continuously perform the bidirectional prediction is determined according to the current prediction cost, and if it is not appropriate, the bidirectional prediction is ended in advance, so that redundant iteration during the bidirectional prediction can be avoided as much as possible while ensuring the coding performance, and time consumption is reduced, thereby facilitating improvement of the coding efficiency.
A video encoding apparatus according to an exemplary embodiment of the present disclosure is briefly described below with reference to fig. 5.
Fig. 5 is a block diagram illustrating a video encoding apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 5, the video encoding apparatus 500 may include an initialization unit 510 and a bi-directional prediction unit 520. In particular, the initialization unit 510 may be configured to determine a current prediction direction for bi-prediction of the current block and initialize a current iteration number. The bi-directional prediction unit 520 may be configured to:
performing bi-predictive iterative operations, wherein the bi-predictive iterative operations comprise: obtaining an inverted block of a prediction block in a current prediction direction, and performing motion search in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block based on the inverted block to obtain a prediction block in the other prediction direction;
and under the condition that the current iteration times meet a preset iteration time condition, acquiring current prediction cost, determining whether the current prediction cost meets the preset cost condition, if so, updating the other prediction direction in the bidirectional prediction to be the current prediction direction, updating the current iteration times, and continuously executing the bidirectional prediction iteration operation, otherwise, obtaining a bidirectional prediction result of the current block based on prediction blocks in two prediction directions.
Since the video encoding method shown in fig. 2 can be performed by the video encoding apparatus 500 shown in fig. 5, and the initialization unit 510 and the bi-directional prediction unit 520 can perform operations corresponding to step S210 and steps S220 to S230 in fig. 2, respectively, any relevant details related to the operations performed by the units in fig. 5 can be referred to the corresponding descriptions related to fig. 2 to fig. 5, and are not repeated here.
Furthermore, it should be noted that although the video encoding apparatus 500 is described above as being divided into units for respectively performing the corresponding processes, it is clear to those skilled in the art that the processes performed by the units described above can also be performed without any specific division of the units or explicit demarcation between the units by the video encoding apparatus 500. In addition, the video encoding apparatus 500 may further include other units, for example, a storage unit, etc.
Fig. 6 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Referring to fig. 6, an electronic device 600 may include at least one memory 601 and at least one processor 602, the at least one memory storing computer-executable instructions that, when executed by the at least one processor, cause the at least one processor 602 to perform a video encoding method according to an embodiment of the present disclosure.
By way of example, the electronic device may be a PC computer, tablet device, personal digital assistant, smartphone, or other device capable of executing the set of instructions described above. The electronic device need not be a single electronic device, but can be any collection of devices or circuits that can execute the above instructions (or sets of instructions) either individually or in combination. The electronic device may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that interfaces with local or remote (e.g., via wireless transmission).
In an electronic device, a processor may include a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a programmable logic device, a special-purpose processor system, a microcontroller, or a microprocessor. By way of example, and not limitation, processors may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, and the like.
The processor may execute instructions or code stored in the memory, which may also store data. The instructions and data may also be transmitted or received over a network via a network interface device, which may employ any known transmission protocol.
The memory may be integral to the processor, e.g., RAM or flash memory disposed within an integrated circuit microprocessor or the like. Further, the memory may comprise a stand-alone device, such as an external disk drive, storage array, or any other storage device usable by a database system. The memory and the processor may be operatively coupled or may communicate with each other, such as through an I/O port, a network connection, etc., so that the processor can read files stored in the memory.
In addition, the electronic device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the electronic device may be connected to each other via a bus and/or a network.
According to an embodiment of the present disclosure, there may also be provided a computer-readable storage medium storing instructions, which when executed by at least one processor, cause the at least one processor to perform a video encoding method according to an exemplary embodiment of the present disclosure. Examples of the computer-readable storage medium herein include: read-only memory (ROM), random-access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random-access memory (RAM), dynamic random-access memory (DRAM), static random-access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD + R, CD-RW, CD + RW, DVD-ROM, DVD-R, DVD + R, DVD-RW, DVD + RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or compact disc memory, Hard Disk Drive (HDD), solid-state drive (SSD), card-type memory (such as a multimedia card, a Secure Digital (SD) card or a extreme digital (XD) card), magnetic tape, a floppy disk, a magneto-optical data storage device, an optical data storage device, a hard disk, a magnetic tape, a magneto-optical data storage device, a hard disk, a magnetic tape, a magnetic data storage device, a magnetic tape, a magnetic data storage device, a magnetic tape, a magnetic data storage device, a magnetic tape, a magnetic data storage device, a magnetic tape, a magnetic data storage device, A solid state disk, and any other device configured to store and provide a computer program and any associated data, data files, and data structures to a processor or computer in a non-transitory manner such that the processor or computer can execute the computer program. The instructions in the computer-readable storage medium or computer program described above may be run in an environment deployed in a computer apparatus, such as a client, a host, a proxy device, a server, etc., and further, in one example, the computer program and any associated data, data files, and data structures are distributed across a networked computer system such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed fashion by one or more processors or computers.
According to an embodiment of the present disclosure, there may also be provided a computer program product including computer instructions which, when executed by a processor, implement a video encoding method according to an exemplary embodiment of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A video encoding method, comprising:
determining a current prediction direction for bidirectional prediction of a current block, and initializing current iteration times;
performing bi-predictive iterative operations, wherein the bi-predictive iterative operations comprise: obtaining an inverted block of a prediction block in a current prediction direction, and performing motion search in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block based on the inverted block to obtain a prediction block in the other prediction direction;
and under the condition that the current iteration times meet a preset iteration time condition, acquiring current prediction cost, determining whether the current prediction cost meets the preset cost condition, if so, updating the other prediction direction in the bidirectional prediction to be the current prediction direction, updating the current iteration times, and continuously executing the bidirectional prediction iteration operation, otherwise, obtaining a bidirectional prediction result of the current block based on prediction blocks in two prediction directions.
2. The video coding method of claim 1, wherein the determining the current prediction direction for bi-prediction of the current block comprises:
and respectively executing unidirectional motion search in two prediction directions for the current block, and determining the direction with lower prediction cost in the two prediction directions as the current prediction direction of bidirectional prediction for the current block.
3. The video encoding method of claim 1, wherein the obtaining an inverted block of the prediction block in the current prediction direction, and performing a motion search in another prediction direction other than the current prediction direction among the two prediction directions for the current block based on the inverted block to obtain the prediction block in the other prediction direction comprises:
obtaining an inverse block of a prediction block with the minimum prediction cost in the current prediction direction, and performing motion search based on the inverse block in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block to obtain the prediction block with the minimum prediction cost in the other prediction direction.
4. The video coding method of claim 3, wherein the performing the motion search based on the inverse block to obtain the prediction block with the smallest prediction cost in the other prediction direction comprises:
and finding a prediction block with the minimum difference in the time and/or space dimension with the reverse block in the reference frame in the other prediction direction as the prediction block with the minimum prediction cost in the other prediction direction.
5. The video coding method of any one of claims 1 to 4, wherein the obtaining the current prediction cost and determining whether the current prediction cost satisfies a preset cost condition comprises:
obtaining the current prediction cost of the other prediction direction, and determining the relationship between the current prediction cost of the other prediction direction and a cost threshold, wherein the cost threshold is determined according to the minimum prediction cost in the prediction costs of the two prediction directions during unidirectional motion search;
and when the current prediction cost is larger than the cost threshold, determining that the current prediction cost meets a preset cost condition, otherwise, determining that the current prediction cost does not meet the preset cost condition.
6. The video encoding method of claim 5, wherein the cost threshold is determined according to a quantization step size for the current block and a minimum prediction cost among prediction costs of two prediction directions at the time of the unidirectional motion search.
7. The video coding method of claim 6, wherein the cost threshold is obtained by dividing a minimum prediction cost among prediction costs of two prediction directions at the time of the unidirectional motion search by a value determined based on the quantization step.
8. A video encoding device, comprising:
an initialization unit configured to determine a current prediction direction for bi-directional prediction of a current block and initialize a current iteration number;
a bi-directional prediction unit configured to:
performing bi-predictive iterative operations, wherein the bi-predictive iterative operations comprise: obtaining an inverted block of a prediction block in a current prediction direction, and performing motion search in the other prediction direction except the current prediction direction in the two prediction directions aiming at the current block based on the inverted block to obtain a prediction block in the other prediction direction;
and under the condition that the current iteration times meet a preset iteration time condition, acquiring current prediction cost, determining whether the current prediction cost meets the preset cost condition, if so, updating the other prediction direction in the bidirectional prediction to be the current prediction direction, updating the current iteration times, and continuously executing the bidirectional prediction iteration operation, otherwise, obtaining a bidirectional prediction result of the current block based on prediction blocks in two prediction directions.
9. An electronic device, comprising:
at least one processor;
at least one memory storing computer-executable instructions,
wherein the computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform the video encoding method of any of claims 1 to 7.
10. A computer-readable storage medium storing instructions that, when executed by at least one processor, cause the at least one processor to perform the video encoding method of any of claims 1 to 7.
CN202111464487.5A 2021-12-03 2021-12-03 Video encoding method, video encoding device, electronic equipment and storage medium Active CN113938690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111464487.5A CN113938690B (en) 2021-12-03 2021-12-03 Video encoding method, video encoding device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111464487.5A CN113938690B (en) 2021-12-03 2021-12-03 Video encoding method, video encoding device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113938690A true CN113938690A (en) 2022-01-14
CN113938690B CN113938690B (en) 2023-10-31

Family

ID=79288705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111464487.5A Active CN113938690B (en) 2021-12-03 2021-12-03 Video encoding method, video encoding device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113938690B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101022555A (en) * 2007-02-12 2007-08-22 清华大学 Interframe predictive coding mode quick selecting method
WO2008153262A1 (en) * 2007-06-15 2008-12-18 Sungkyunkwan University Foundation For Corporate Collaboration Bi-prediction coding method and apparatus, bi-prediction decoding method and apparatus, and recording midium
CN102065298A (en) * 2011-01-05 2011-05-18 西安电子科技大学 High-performance macroblock coding implementation method
CN104469336A (en) * 2013-09-25 2015-03-25 中国科学院深圳先进技术研究院 Coding method for multi-view depth video signals
EP3151558A1 (en) * 2015-09-30 2017-04-05 Thomson Licensing Method and device for predicting a current block of pixels in a current frame, and corresponding encoding and/or decoding methods and devices
CN110545425A (en) * 2019-08-21 2019-12-06 浙江大华技术股份有限公司 Inter-frame prediction method, terminal equipment and computer storage medium
CN110611820A (en) * 2019-09-11 2019-12-24 北京达佳互联信息技术有限公司 Video coding method and device, electronic equipment and storage medium
CN110636293A (en) * 2019-09-27 2019-12-31 腾讯科技(深圳)有限公司 Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN111543059A (en) * 2017-12-31 2020-08-14 华为技术有限公司 Image prediction method, device and codec
CN112004097A (en) * 2020-07-30 2020-11-27 浙江大华技术股份有限公司 Inter-frame prediction method, image processing apparatus, and computer-readable storage medium
CN112135126A (en) * 2019-11-05 2020-12-25 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment
CN113573066A (en) * 2021-07-07 2021-10-29 网宿科技股份有限公司 Video coding method and device
CN113597767A (en) * 2019-03-08 2021-11-02 Oppo广东移动通信有限公司 Prediction method, encoder, decoder, and computer storage medium
CN116600121A (en) * 2023-05-18 2023-08-15 北京大学深圳研究生院 Video coding method and device, electronic equipment and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101022555A (en) * 2007-02-12 2007-08-22 清华大学 Interframe predictive coding mode quick selecting method
WO2008153262A1 (en) * 2007-06-15 2008-12-18 Sungkyunkwan University Foundation For Corporate Collaboration Bi-prediction coding method and apparatus, bi-prediction decoding method and apparatus, and recording midium
CN102065298A (en) * 2011-01-05 2011-05-18 西安电子科技大学 High-performance macroblock coding implementation method
CN104469336A (en) * 2013-09-25 2015-03-25 中国科学院深圳先进技术研究院 Coding method for multi-view depth video signals
EP3151558A1 (en) * 2015-09-30 2017-04-05 Thomson Licensing Method and device for predicting a current block of pixels in a current frame, and corresponding encoding and/or decoding methods and devices
CN111543059A (en) * 2017-12-31 2020-08-14 华为技术有限公司 Image prediction method, device and codec
CN113597767A (en) * 2019-03-08 2021-11-02 Oppo广东移动通信有限公司 Prediction method, encoder, decoder, and computer storage medium
CN110545425A (en) * 2019-08-21 2019-12-06 浙江大华技术股份有限公司 Inter-frame prediction method, terminal equipment and computer storage medium
CN110611820A (en) * 2019-09-11 2019-12-24 北京达佳互联信息技术有限公司 Video coding method and device, electronic equipment and storage medium
CN110636293A (en) * 2019-09-27 2019-12-31 腾讯科技(深圳)有限公司 Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, storage medium, and electronic apparatus
CN112135126A (en) * 2019-11-05 2020-12-25 杭州海康威视数字技术股份有限公司 Encoding and decoding method, device and equipment
CN112004097A (en) * 2020-07-30 2020-11-27 浙江大华技术股份有限公司 Inter-frame prediction method, image processing apparatus, and computer-readable storage medium
CN113573066A (en) * 2021-07-07 2021-10-29 网宿科技股份有限公司 Video coding method and device
CN116600121A (en) * 2023-05-18 2023-08-15 北京大学深圳研究生院 Video coding method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113938690B (en) 2023-10-31

Similar Documents

Publication Publication Date Title
CN112087633B (en) Video decoding method, device and storage medium
CN109640116B (en) Cloud mobile phone network video coding method and server
JP6181291B2 (en) Information transmission based on reading speed
US20110270941A1 (en) File decoding system and method
CN114040245A (en) Video playing method and device, computer storage medium and electronic equipment
CN110891195B (en) Method, device and equipment for generating screen image and storage medium
CN112929728A (en) Video rendering method, device and system, electronic equipment and storage medium
CN113938690B (en) Video encoding method, video encoding device, electronic equipment and storage medium
US20230104243A1 (en) Improved cross component intra prediction mode
CN111277838A (en) Encoding mode selection method, device, electronic equipment and computer readable medium
CN112839224A (en) Prediction mode selection method and device, video coding equipment and storage medium
CN114157868B (en) Video frame coding mode screening method and device and electronic equipment
CN114157895A (en) Video processing method and device, electronic equipment and storage medium
CN113194270B (en) Video processing method and device, electronic equipment and storage medium
CN113079103A (en) Audio transmission method, audio transmission device, electronic equipment and storage medium
US10140689B2 (en) Efficient path-based method for video denoising
CN116431347B (en) Method, device, electronic equipment and storage medium for resource processing
CN116760986B (en) Candidate motion vector generation method, candidate motion vector generation device, computer equipment and storage medium
US11882169B1 (en) Adaptive media streaming
US20210289206A1 (en) Block-based spatial activity measures for pictures
CN110087145B (en) Method and apparatus for processing video
US20210409706A1 (en) Low latency cross component intra prediction mode
CN116527914A (en) Decoding method and device suitable for space image
CN112714317A (en) Method, apparatus, electronic device and readable medium for video encoding
CN115984088A (en) Image processing method, image processing device, electronic equipment and storage medium

Legal Events

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