CN110418145B - 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
CN110418145B
CN110418145B CN201910680931.3A CN201910680931A CN110418145B CN 110418145 B CN110418145 B CN 110418145B CN 201910680931 A CN201910680931 A CN 201910680931A CN 110418145 B CN110418145 B CN 110418145B
Authority
CN
China
Prior art keywords
ctu
coded
ctus
video frame
encoded
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.)
Active
Application number
CN201910680931.3A
Other languages
Chinese (zh)
Other versions
CN110418145A (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 QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910680931.3A priority Critical patent/CN110418145B/en
Publication of CN110418145A publication Critical patent/CN110418145A/en
Application granted granted Critical
Publication of CN110418145B publication Critical patent/CN110418145B/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/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding

Landscapes

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

Abstract

The embodiment of the invention provides a video coding method, a video coding device, electronic equipment and a storage medium, wherein the method comprises the following steps: when the Coding Tree Unit (CTU) of the video is monitored to finish coding, selecting the CTU to be coded; wherein, the CTU to be encoded is: an unencoded CTU that is dependent on the monitored CTU; checking whether all CTUs depended by the CTU to be coded complete coding; and if so, encoding the CTU to be encoded. Therefore, the utilization rate of resources can be improved, and the video coding efficiency is improved.

Description

Video coding method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of video encoding technologies, and in particular, to a video encoding method and apparatus, an electronic device, and a storage medium.
Background
The compression rate of the new generation Video Coding standard H.265/HEVC (High Efficiency Video Coding) is 50% higher than that of the previous generation standard H.264/AVC (Advanced Video Coding), but the Coding complexity is improved and the Coding time is increased. In order to increase the encoding speed, the HEVC standard includes a series of Parallel encoding tools, of which wave front Parallel Processing (WPP) technology is representative.
When encoding a video, each frame of the video is usually divided into a plurality of Coding Tree Units (CTUs), and each CTU is encoded. To increase video coding speed, video coding techniques allow different CTUs of the same video frame to be coded simultaneously, thereby enabling parallel coding. However, because of the complex dependency relationship between CTUs, the CTU to be encoded can start encoding only after the CTU on which the CTU to be encoded depends completes encoding.
In the prior art, a CTU is encoded by a plurality of threads, and a fixed correspondence exists between the threads and the CTU to be encoded, for example, thread 1 corresponds to CTU1 and CTU2, that is, when the thread 1 encodes CTU1 first, and the CTU1 is encoded, and when the CTU on which the CTU2 depends is encoded, the thread 1 encodes CTU 2; thread 2 corresponds to the CTU3 and the CTU4, that is, the thread 2 encodes the CTU3 first, and when the CTU3 encoding is completed and the CTU on which the CTU4 depends is also encoded, the thread 2 encodes the CTU4, wherein the thread 1 and the thread 2 encode at the same time. The prior art may exist: thread 1 completes encoding the CTU1, but at this time, the CTU on which the CTU2 depends has not completed encoding yet, and thus thread 1 needs to wait; meanwhile, the CTUs that the CTU4 depends on are all encoded, that is, the CTU4 may be encoded, but the thread 2 has not yet completed encoding the CTU3, at this time, the CTU4 needs to wait for the thread 2 to complete encoding the CTU3 before encoding the CTU4, which may result in a situation that some threads have completed encoding and are in an idle state, and some CTUs may have completed encoding but cannot encode the CTUs that the CTU depends on. At this time, the idle resources are idle, and these uncoded CTUs that can be coded cannot be coded in time, which results in resource waste and low video coding efficiency.
Disclosure of Invention
Embodiments of the present invention provide a video encoding method, an apparatus, an electronic device, and a storage medium, so as to improve the utilization rate of resources, thereby improving the video encoding efficiency. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a video encoding method, including:
when the Coding Tree Unit (CTU) of the video is monitored to finish coding, selecting the CTU to be coded; wherein, the CTU to be encoded is: an unencoded CTU that is dependent on the monitored CTU;
checking whether all CTUs depended by the CTU to be coded complete coding;
and if so, encoding the CTU to be encoded.
Optionally, each CTU in the video frame is arranged in a matrix;
the CTU to be encoded comprises: and the CTUs in the column next to the same row of the monitored CTUs and the CTUs in the column next to the row of the monitored CTUs.
Optionally, the CTU to be encoded further includes:
a CTU in a reference video frame; the reference video frame is: depending on the video frame to which the monitored CTU belongs.
Optionally, each CTU in the video frame is arranged in a matrix;
the CTU depended by the CTU to be coded comprises: the CTUs in the column above the same row of the CTU to be coded and the CTUs in the column below the row of the CTU to be coded.
Optionally, the CTU on which the CTU to be encoded depends further includes:
a CTU in a referenced video frame; the referenced video frame is: and the video frame on which the video frame of the CTU to be coded depends.
Optionally, the encoding the CTU to be encoded includes:
adding the CTU to be coded into a thread pool; selecting an idle thread in the thread pool; and coding the CTU to be coded through the idle thread.
In a second aspect, an embodiment of the present invention provides a video encoding apparatus, including:
the selection module is used for selecting the CTU to be coded after the coding tree unit CTU of the video is monitored to be coded; wherein, the CTU to be encoded is: an unencoded CTU that is dependent on the monitored CTU;
the detection module is used for checking whether all CTUs depended by the CTUs to be coded complete coding;
and the coding module is used for coding the CTU to be coded if the CTUs depended by the CTU to be coded are checked to be completely coded.
Optionally, each CTU in the video frame is arranged in a matrix;
the CTU to be encoded comprises: and the CTUs in the column next to the same row of the monitored CTUs and the CTUs in the column next to the row of the monitored CTUs.
Optionally, the CTU to be encoded further includes:
a CTU in a reference video frame; the reference video frame is: depending on the video frame to which the monitored CTU belongs.
Optionally, each CTU in the video frame is arranged in a matrix;
the CTU depended by the CTU to be coded comprises: the CTUs in the column above the same row of the CTU to be coded and the CTUs in the column below the row of the CTU to be coded.
Optionally, the CTU on which the CTU to be encoded depends further includes:
a CTU in a referenced video frame; the referenced video frame is: and the video frame on which the video frame of the CTU to be coded depends.
Optionally, the encoding module is specifically configured to add the CTU to be encoded to a thread pool; selecting an idle thread in the thread pool; and coding the CTU to be coded through the idle thread.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium, where instructions that, when executed by a processor of an electronic device, enable the electronic device to perform a video encoding method, implementing the method steps of the first aspect.
In yet another aspect of the present invention, there is also provided a computer program product including instructions which, when run on a computer, cause the computer to perform any of the video encoding methods described above.
According to the video coding method, the video coding device, the electronic equipment and the storage medium, when the coding of the Coding Tree Unit (CTU) of the video is monitored, the CTU to be coded can be selected; wherein, the CTU to be encoded is: an unencoded CTU that is dependent on the monitored CTU; checking whether all CTUs depended by the CTU to be coded complete coding; and if so, encoding the CTU to be encoded. In the embodiment of the invention, when the CTU completes coding, the CTU to be coded which depends on the monitored CTU is selected, and when the CTU to be coded depends on the CTU to be coded is checked to complete coding, the CTU to be coded is coded. Therefore, the resource waste can be reduced, the utilization rate of resources is improved, and the video coding efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a video encoding method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the CTU relationship in the embodiment of the present invention;
FIG. 3 is a schematic flow chart of an embodiment of the present invention;
FIG. 4 is a schematic flow chart diagram illustrating another embodiment of the present invention;
FIG. 5 is a block diagram of a video encoding apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In order to reduce resource waste and improve video coding efficiency, the embodiment of the invention provides a video coding method. The following describes the video encoding method provided by the embodiment of the present invention in detail.
The video coding method provided by the embodiment of the invention can be applied to electronic equipment. Specifically, the electronic device may be a processor, an encoder, an intelligent terminal such as a computer, or the like.
An embodiment of the present invention provides a video encoding method, as shown in fig. 1, which may include:
s101, when the Coding Tree Unit (CTU) of the video is monitored to be coded, selecting the CTU to be coded.
Wherein, the CTU to be encoded is: depending on the non-encoded CTU of the monitored CTU.
The CTUs to be encoded may include one or more.
The method includes that a dependency relationship exists among a plurality of CTUs obtained after each video frame of a video is divided, and if a CTU needs to be coded, the CTU which the CTU depends on needs to be coded. Specifically, the dependency relationship between multiple CTUs can be determined when dividing a video frame into CTUs. In the process of encoding each CTU, the dependency relationship between each CTU may be directly determined, that is, for each CTU, the CTU dependent on the CTU and the CTU dependent on the CTU may be determined.
When it is monitored that a CTU completes encoding, a CTU to be encoded may be selected, and a CTU dependent on the monitored CTU may be selected from among CTUs that are not encoded.
In the embodiment of the invention, the CTUs can be coded in parallel through a plurality of threads, the electronic equipment can respectively monitor whether the CTUs coded by the threads are coded completely or not in the coding process, and for each thread, when the CTU coded by the thread is monitored to be coded completely, the CTU to be coded corresponding to the CTU with the coded completely is selected.
S102, checking whether all CTUs depended by the CTU to be coded complete coding.
If so, i.e. if it is checked that all CTUs on which the CTU to be encoded depends have completed encoding, step S103 is performed.
After selecting the CTU to be coded, the CTU on which the CTU to be coded depends can be determined according to the dependency relationship among the CTUs. The CTUs on which the CTUs to be encoded depend may include one or more.
When the CTUs to be encoded depend on include a plurality of CTUs, it may be sequentially detected whether each CTU to be encoded depend on completes encoding.
In one implementation, during the encoding of the CTU, when the CTU is encoded, the encoding completion flag may be marked. Therefore, when detecting whether each CTU depended by the CTU to be coded completes coding, the coding completion identifier indicating that the CTU has completed coding can be detected, and if the coding completion identifier corresponding to the CTU can be detected, the CTU can be determined to complete coding.
In another implementation manner, whether the coding result corresponding to the CTU can be detected or not may be directly determined, and if the coding result corresponding to the CTU can be detected, it may be determined that the CTU completes coding.
In an optional embodiment of the present invention, it is determined whether a CTU to be encoded exists; if yes, checking whether all CTUs depended by the CTU to be coded complete coding. In some cases, the monitored CTUs with completed encoding are located at the boundaries of a plurality of CTUs, and there may be no CTU depending on the monitored CTUs, that is, there may be no corresponding CTU to be encoded depending on the monitored CTUs. In the embodiment of the invention, before checking whether all CTUs depended by the CTU to be coded complete coding, whether the CTU to be coded exists is judged, and if the CTU to be coded exists, whether all the CTUs depended by the CTU to be coded complete coding is checked.
If it is checked that the CTUs on which the CTUs to be encoded depend do not all complete encoding, the CTUs that depend on the monitored CTUs that have completed encoding may be reselected, i.e. the CTUs to be encoded are reselected.
S103, coding the CTU to be coded.
Specifically, the CTU to be encoded is encoded, and an encoding policy may be selected for encoding according to actual requirements, where the encoding policy may be any manner that can implement encoding of the CTU, and the embodiment of the present invention does not limit a specific encoding process.
In an optional embodiment, after checking that all CTUs depended on by a to-be-coded CTU complete coding, adding the to-be-coded CTU into a thread pool, and selecting an idle thread in the thread pool; and coding the CTU to be coded through an idle thread. Specifically, the thread pool may include a plurality of threads, and the electronic device may call an idle thread to encode the CTU to be encoded.
In the embodiment of the invention, when the CTU completes coding, the CTU to be coded which depends on the monitored CTU is selected, and when the CTU to be coded depends on the CTU to be coded is checked to complete coding, the CTU to be coded is coded. Therefore, the resource waste can be reduced, the utilization rate of resources is improved, and the video coding efficiency is improved.
In an optional embodiment of the present invention, each CTU in the video frame is arranged in a matrix.
The CTU to be encoded may include: and the CTUs in the column next to the same row of the monitored CTUs and the CTUs in the column next to the row of the monitored CTUs.
First, the CTU representation, such as CTU (P, X, Y), will be described, where P represents the frame number of the video frame to which the CTU belongs, X represents the CTU column number, and Y represents the CTU line number.
The monitored CTUs are CTUs (p0, x, y), and the CTUs to be encoded depending on the monitored CTUs may include CTUs (p0, x +1, y) and CTUs (p0, x-1, y +1), as shown in fig. 2.
In another alternative embodiment, the CTU to be encoded may further include: a CTU in a reference video frame; the reference video frame is: depending on the video frame to which the monitored CTU belongs.
There are also complex dependencies between video frames included in a video, and the dependencies between video frames may be predetermined. In the encoding process, for each video frame, a video frame dependent on the video frame and a video frame on which the video frame depends may be determined according to the dependency relationship between the video frames, that is, a reference video frame and a referred video frame of the video frame may be determined according to the dependency relationship between the video frames.
As shown in fig. 2, the monitored CTU is a video frame p0 to which the CTU (p0, x, y) belongs, and a video frame dependent on p0 includes a video frame pa, which can also be understood as a video frame of a reference video frame p 0. The CTUs to be encoded may also include CTUs of video frame pa, such as CTU (pa, x-2, y-2).
In an alternative embodiment of the present invention, when the CTU (p0, x, y) is coded completely, each CTU to be coded is triggered, that is, whether all the CTUs that each CTU to be coded depends on are coded completely is checked, specifically, as shown in fig. 3, when it is monitored that the CTU (p0, x, y) is coded completely, the CTU that depends on the CTU (p0, x, y) is triggered, that is, whether all the CTUs that the CTU depends on are coded completely is checked, specifically, the CTU (p0, x +1, y), the CTU (p0, x-1, y +1), and the CTU in the video frame pa that circulates all the reference video frames p0, for example, the CTU (pa, x-2, y-2) in the reference video frame pa are triggered.
In an optional embodiment of the present invention, each CTU in the video frame is arranged in a matrix.
The CTUs on which the CTUs to be encoded depend may include: the CTUs in the column above the same row of the CTU to be coded and the CTUs in the column below the row of the CTU to be coded.
As shown in fig. 2, the CTU to be encoded (pa, x-2, y-2) is determined as described above, and the CTUs on which the CTU to be encoded depends may include CTUs (pa, x-1, y-3) and CTUs (pa, x-3, y-2).
In another implementation manner, the CTUs on which the CTUs to be encoded depend may further include:
a CTU in a referenced video frame; the referenced video frames are: and (4) the video frame on which the CTU to be coded belongs depends.
The CTU to be coded is determined (pa, x-2, y-2), and the CTU depended by the CTU to be coded can also comprise the CTU (p0, x, y).
In an alternative embodiment of the present invention, triggering the CTU to be encoded may include executing a triggering sub-process, where the triggering sub-process checks whether all CTUs depended on the CTU to be encoded complete the encoding process, as shown in fig. 4.
If the CTU to be coded is determined to be the CTU (pa, x, y), whether all the CTUs depended on by the CTU (pa, x, y) are coded is checked, if all the CTUs depended on by the CTU (pa, x-1, y) are sequentially checked, if all the video frames depended on by the video frames pa of the CTU to be coded are checked, the CTU (pa, x +1, y-1) and the CTU (pa, x +1, y-1) can also be understood as the CTU in the reference frame pb of the video frames pa, such as the CTU (pb, x +2, y +2) until all the CTUs in the reference frame pb of the video frames pa are cycled, and the coding is finished, the CTU (pa, x, y) is put into a thread pool to start coding.
In the embodiment of the invention, when the CTU to be coded can be coded, the CTU to be coded is coded at the first time, so that the mutual waiting among threads in the coding process can be eliminated, the resource waste can be reduced, the utilization rate of resources is improved, and the video coding efficiency is improved.
The invention provides a specific embodiment, which is as follows:
when the CTU (p0, x, y) is coded, namely the monitoring CTU (p0, x, y) completes coding, the CTU (p0, x, y) is the monitored CTU, the CTU to be coded is selected, namely the uncoded CTU depending on the CTU (p0, x, y) is selected, and as shown in fig. 2, the CTU (p0, x +1, y), the CTU (p0, x-1, y +1) and the CTU (pa, x-2, y-2) can be included.
The process of checking whether all the CTUs depended on by each CTU to be encoded complete the encoding is described in detail by taking the CTU to be encoded as CTU (pa, x-2, y-2) as an example.
And determining the CTUs depended by the CTU (pa, x-2, y-2) as the CTU (pa, x-1, y-3), the CTU (pa, x-3, y-2) and the CTU (p0, x, y). Whether all the three dependent CTUs are coded can be sequentially judged, if all the three CTUs are coded, the CTU (pa, x-2, y-2) is added into a thread pool to start coding, specifically, coding can be performed through threads in the thread pool, and specifically, an idle thread in the thread pool can be selected to code the CTU (pa, x-2, y-2).
And for the CTU (p0, x +1, y) and the CTU (p0, x-1, y +1), carrying out the same process with the CTU (pa, x-2, y-2), checking whether all the CTUs depended on by the CTU (p0, x +1, y) are coded completely, and if all the CTUs depended on by the CTU (p0, x +1, y) are coded completely, adding the CTU (p0, x +1, y) into a thread pool to start coding, wherein an idle thread in the thread pool can be selected to code the CTU (p0, x +1, y). And checking whether all the CTUs depended by the CTU (p0, x-1, y +1) are completely coded, if all the CTUs depended by the CTU (p0, x-1, y +1) are completely coded, adding the CTU (p0, x-1, y +1) into a thread pool to start coding, and specifically selecting idle threads in the thread pool to code the CTU (p0, x-1, y + 1).
Corresponding to the video encoding method provided in the foregoing embodiment, an embodiment of the present invention further provides a video encoding apparatus, as shown in fig. 5, which may include:
the selecting module 501 is configured to select a CTU to be encoded after the coding tree unit CTU of the video is monitored to complete encoding; wherein, the CTU to be encoded is: an unencoded CTU that is dependent on the monitored CTU;
a detection module 502, configured to check whether all CTUs that are depended on by the CTU to be encoded complete encoding;
and an encoding module 503, configured to encode the CTU to be encoded if it is checked that all CTUs depended on by the CTU to be encoded complete encoding.
In the embodiment of the invention, when the CTU completes coding, the CTU to be coded which depends on the monitored CTU is selected, and when the CTU to be coded depends on the CTU to be coded is checked to complete coding, the CTU to be coded is coded. Therefore, the resource waste can be reduced, the utilization rate of resources is improved, and the video coding efficiency is improved.
Optionally, each CTU in the video frame is arranged in a matrix form;
the CTU to be encoded comprises: and the CTUs in the column next to the same row of the monitored CTUs and the CTUs in the column next to the row of the monitored CTUs.
Optionally, the CTU to be encoded further includes:
a CTU in a reference video frame; the reference video frame is: depending on the video frame to which the monitored CTU belongs.
Optionally, each CTU in the video frame is arranged in a matrix form;
the CTU depended by the CTU to be coded comprises the following components: the CTUs in the column above the same row of the CTU to be coded and the CTUs in the column below the row of the CTU to be coded.
Optionally, the CTUs on which the CTUs to be encoded depend further includes:
a CTU in a referenced video frame; the referenced video frames are: and (4) the video frame on which the CTU to be coded belongs depends.
Optionally, the encoding module 503 is specifically configured to add the CTU to be encoded into the thread pool, and encode the CTU to be encoded through the thread pool.
The video encoding device provided by the embodiment of the invention is a device applying the video encoding method, and all the embodiments of the video encoding method are suitable for the device and can achieve the same or similar beneficial effects.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604.
A memory 603 for storing a computer program;
the processor 601 is configured to implement the video encoding method provided in the foregoing embodiment when executing the program stored in the memory 603.
In the embodiment of the invention, when the CTU completes coding, the CTU to be coded which depends on the monitored CTU is selected, and when the CTU to be coded depends on the CTU to be coded is checked to complete coding, the CTU to be coded is coded. Therefore, the resource waste can be reduced, the utilization rate of resources is improved, and the video coding efficiency is improved.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In still another embodiment provided by the present invention, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to execute the video encoding method provided by the above-mentioned embodiment.
In the embodiment of the invention, when the CTU completes coding, the CTU to be coded which depends on the monitored CTU is selected, and when the CTU to be coded depends on the CTU to be coded is checked to complete coding, the CTU to be coded is coded. Therefore, the resource waste can be reduced, the utilization rate of resources is improved, and the video coding efficiency is improved.
In a further embodiment provided by the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the video encoding method provided by the above-mentioned embodiment.
In the embodiment of the invention, when the CTU completes coding, the CTU to be coded which depends on the monitored CTU is selected, and when the CTU to be coded depends on the CTU to be coded is checked to complete coding, the CTU to be coded is coded. Therefore, the resource waste can be reduced, the utilization rate of resources is improved, and the video coding efficiency is improved.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the storage medium, and the program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (14)

1. A video encoding method, comprising:
when the Coding Tree Unit (CTU) of the video is monitored to finish coding, selecting the CTU to be coded; wherein, the CTU to be encoded is: an unencoded CTU that is dependent on the monitored CTU;
checking whether all CTUs depended by the CTU to be coded complete coding;
if so, encoding the CTU to be encoded;
and if the CTUs depended by the CTU to be coded are not all coded, reselecting the CTU to be coded.
2. The method of claim 1, wherein each CTU in the video frame is arranged in a matrix;
the CTU to be encoded comprises: and the CTUs in the column next to the same row of the monitored CTUs and the CTUs in the column next to the row of the monitored CTUs.
3. The method according to claim 1, wherein the CTU to be encoded further comprises:
a CTU in a reference video frame; the reference video frame is: depending on the video frame to which the monitored CTU belongs.
4. The method of claim 1, wherein each CTU in the video frame is arranged in a matrix;
the CTU depended by the CTU to be coded comprises: the CTUs in the column above the same row of the CTU to be coded and the CTUs in the column below the row of the CTU to be coded.
5. The method according to claim 1, wherein the CTU on which the CTU to be encoded depends further comprises:
a CTU in a referenced video frame; the referenced video frame is: and the video frame on which the video frame of the CTU to be coded depends.
6. The method according to any one of claims 1 to 5, wherein the encoding the CTU to be encoded comprises:
adding the CTU to be coded into a thread pool;
selecting an idle thread in the thread pool;
and coding the CTU to be coded through the idle thread.
7. A video encoding apparatus, comprising:
the selection module is used for selecting the CTU to be coded after the coding tree unit CTU of the video is monitored to be coded; wherein, the CTU to be encoded is: an unencoded CTU that is dependent on the monitored CTU;
the detection module is used for checking whether all CTUs depended by the CTUs to be coded complete coding;
the coding module is used for coding the CTU to be coded if the CTUs depended by the CTU to be coded are checked to be completely coded; and if the CTUs depended by the CTU to be coded are not all coded, reselecting the CTU to be coded.
8. The apparatus of claim 7, wherein each CTU in the video frame is arranged in a matrix;
the CTU to be encoded comprises: and the CTUs in the column next to the same row of the monitored CTUs and the CTUs in the column next to the row of the monitored CTUs.
9. The apparatus of claim 7, wherein the CTU to be encoded further comprises:
a CTU in a reference video frame; the reference video frame is: depending on the video frame to which the monitored CTU belongs.
10. The apparatus of claim 7, wherein each CTU in the video frame is arranged in a matrix;
the CTU depended by the CTU to be coded comprises: the CTUs in the column above the same row of the CTU to be coded and the CTUs in the column below the row of the CTU to be coded.
11. The apparatus according to claim 7, wherein the CTU on which the CTU to be encoded depends further comprises:
a CTU in a referenced video frame; the referenced video frame is: and the video frame on which the video frame of the CTU to be coded depends.
12. The apparatus according to any one of claims 7 to 11, wherein the encoding module is specifically configured to add the CTU to be encoded to a thread pool; selecting an idle thread in the thread pool; and coding the CTU to be coded through the idle thread.
13. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor, when executing the program stored in the memory, is adapted to perform the method steps of any of claims 1-6.
14. A computer-readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform a video encoding method, implementing the method steps of any of claims 1-6.
CN201910680931.3A 2019-07-26 2019-07-26 Video coding method and device, electronic equipment and storage medium Active CN110418145B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910680931.3A CN110418145B (en) 2019-07-26 2019-07-26 Video coding method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910680931.3A CN110418145B (en) 2019-07-26 2019-07-26 Video coding method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110418145A CN110418145A (en) 2019-11-05
CN110418145B true CN110418145B (en) 2022-04-22

Family

ID=68363376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910680931.3A Active CN110418145B (en) 2019-07-26 2019-07-26 Video coding method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110418145B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105992008A (en) * 2016-03-30 2016-10-05 南京邮电大学 Multilevel multitask parallel decoding algorithm on multicore processor platform
CN108449603A (en) * 2018-03-22 2018-08-24 南京邮电大学 Based on the multi-level task level of multi-core platform and the parallel HEVC coding/decoding methods of data level
CN108540797A (en) * 2018-03-23 2018-09-14 南京邮电大学 HEVC based on multi-core platform combines WPP coding methods within the frame/frames

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2016231584A1 (en) * 2016-09-22 2018-04-05 Canon Kabushiki Kaisha Method, apparatus and system for encoding and decoding video data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105992008A (en) * 2016-03-30 2016-10-05 南京邮电大学 Multilevel multitask parallel decoding algorithm on multicore processor platform
CN108449603A (en) * 2018-03-22 2018-08-24 南京邮电大学 Based on the multi-level task level of multi-core platform and the parallel HEVC coding/decoding methods of data level
CN108540797A (en) * 2018-03-23 2018-09-14 南京邮电大学 HEVC based on multi-core platform combines WPP coding methods within the frame/frames

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Efficient arbitrary ratio downscale transcoding for HEVC";ZhenanLin;《2016 Visual Communications and Image Processing (VCIP)》;20161130;全文 *

Also Published As

Publication number Publication date
CN110418145A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN112799584B (en) Data storage method and device
CN111104664B (en) Risk identification method of electronic equipment and server
CN107613301B (en) Image processing method and device
US20210250404A1 (en) Video data storage method and device in cloud storage system
CN112311611A (en) Data anomaly monitoring method and device and electronic equipment
CN112836751A (en) Target detection method and device
CN108509322B (en) Method for avoiding excessive return visit, electronic device and computer readable storage medium
CN110069217B (en) Data storage method and device
CN112799791A (en) Method and device for calling distributed lock, electronic equipment and storage medium
CN110418145B (en) Video coding method and device, electronic equipment and storage medium
CN111625358B (en) Resource allocation method and device, electronic equipment and storage medium
CN112565886A (en) Video frame extraction method and device, electronic equipment and readable storage medium
CN112541041A (en) Data processing method, device, server and storage medium
CN110324629B (en) Image transcoding method and device and electronic equipment
CN109660806B (en) Encoding method and device and electronic equipment
CN109408369B (en) System testing method and device and electronic equipment
CN113568733B (en) Resource allocation method, device, electronic equipment and storage medium
CN113238852A (en) Task allocation method and device, electronic equipment and storage medium
CN111050179A (en) Video transcoding method and device
CN107105308A (en) Homepage recommends method and device
CN115389911B (en) Chip scheduler fault judgment method and device, electronic equipment and storage medium
CN108664293B (en) Application control method and device in android system
CN111367905B (en) Object data storage and data index construction method and device and access server
CN117216133A (en) Method and system for realizing data same-ring ratio based on visual api interface
CN116881050A (en) Interactive automatic restarting method, device and system

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