CN111669599A - Video decoding method, video decoding device and terminal equipment - Google Patents

Video decoding method, video decoding device and terminal equipment Download PDF

Info

Publication number
CN111669599A
CN111669599A CN202010560348.1A CN202010560348A CN111669599A CN 111669599 A CN111669599 A CN 111669599A CN 202010560348 A CN202010560348 A CN 202010560348A CN 111669599 A CN111669599 A CN 111669599A
Authority
CN
China
Prior art keywords
video
decoded
group
decoding
hard decoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010560348.1A
Other languages
Chinese (zh)
Inventor
谭皓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010560348.1A priority Critical patent/CN111669599A/en
Publication of CN111669599A publication Critical patent/CN111669599A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/156Availability of hardware or computational resources, e.g. encoding based on power-saving criteria

Abstract

The application is applicable to the technical field of video processing, and provides a video decoding method, a video decoding device, a terminal device and a computer readable storage medium, wherein the video decoding method comprises the following steps: if a preset instruction is detected and the type of a video to be decoded is determined to be a hard decoding type supported by a terminal device, acquiring key frame information of the video to be decoded, wherein the preset instruction is used for indicating the decoding operation of the video to be decoded, the video to be decoded comprises at least one group of image groups, and a first frame video frame in each group of image groups is a key frame; determining a hard decoding mode of the video to be decoded according to the key frame information; and carrying out hard decoding on the video to be decoded according to the hard decoding mode. By the method, a proper hard decoding mode can be determined for the video to be decoded, so that the video can be efficiently decoded.

Description

Video decoding method, video decoding device and terminal equipment
Technical Field
The present application belongs to the field of video processing technologies, and in particular, to a video decoding method, a video decoding apparatus, a terminal device, and a computer-readable storage medium.
Background
Currently common video decoding methods typically include soft decoding and hard decoding. Wherein, the soft decoding can be realized by a software decoder, by adopting FFmpeg and the like; soft decoding is good in universality, but is slow in decoding speed and high in power consumption. The hard decoding is to decode the video by using a Graphics Processing Unit (GPU) on the terminal device; the decoding speed of hard decoding is high, the power consumption is low, but the compatibility is poor, and the application range is greatly limited. Therefore, how to determine a reasonable hard decoding manner to perform video decoding reasonably and efficiently is a problem that needs to be solved at present.
Disclosure of Invention
The embodiment of the application provides a video decoding method, a video decoding device, a terminal device and a computer readable storage medium, which can determine a proper hard decoding mode aiming at a video to be decoded, thereby efficiently decoding the video.
In a first aspect, an embodiment of the present application provides a video decoding method, including:
if a preset instruction is detected and the type of a video to be decoded is determined to be a hard decoding type supported by a terminal device, acquiring key frame information of the video to be decoded, wherein the preset instruction is used for indicating the decoding operation of the video to be decoded, the video to be decoded comprises at least one group of image groups, and a first frame video frame in each group of image groups is a key frame;
determining a hard decoding mode of the video to be decoded according to the key frame information;
and carrying out hard decoding on the video to be decoded according to the hard decoding mode.
In a second aspect, an embodiment of the present application provides a video decoding apparatus, including:
the device comprises an acquisition module, a decoding module and a display module, wherein the acquisition module is used for acquiring key frame information of a video to be decoded if a preset instruction is detected and the type of the video to be decoded is determined to be a hard decoding type supported by a terminal device, the preset instruction is used for indicating the video to be decoded, the video to be decoded comprises at least one group of images, and a first frame video frame in each group of images is a key frame;
a determining module, configured to determine a hard decoding mode for the video to be decoded according to the key frame information;
and the hard decoding module is used for carrying out hard decoding on the video to be decoded according to the hard decoding mode.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, a display, and a computer program stored in the memory and executable on the processor, where the processor implements the video decoding method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the video decoding method as described in the first aspect.
In a fifth aspect, the present application provides a computer program product, which when run on a terminal device, causes the terminal device to execute the video decoding method described in the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that: in the embodiment of the application, when the preset instruction is detected and the type of the video to be decoded is determined to be the hard decoding type supported by the terminal device, the specific hard decoding mode is adjusted according to the key frame information of the video to be decoded and the video to be decoded is subjected to hard decoding, so that a more reasonable hard decoding mode can be determined according to the specific state of the video to be decoded, the video is efficiently decoded, and the video decoding efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a flowchart illustrating a video decoding method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a method for determining a hard decoding manner for the video to be decoded according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a video decoding apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The video decoding method provided by the embodiment of the application can be applied to terminal devices such as a server, a desktop computer, a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, a super-mobile personal computer (UMPC), a netbook, and a Personal Digital Assistant (PDA), and the embodiment of the application does not limit the specific types of the terminal devices at all.
Specifically, fig. 1 shows a flowchart of a video decoding method provided in an embodiment of the present application, where the video decoding method can be applied to a terminal device.
The video decoding method may include:
step S101, if a preset instruction is detected and it is determined that the type of a video to be decoded is a hard decoding type supported by a terminal device, acquiring key frame information of the video to be decoded, wherein the preset instruction is used for indicating to perform decoding operation on the video to be decoded, the video to be decoded comprises at least one group of image groups, and a first frame video frame in each group of image groups is a key frame.
In this embodiment of the application, the preset instruction may be generated after the preset trigger condition is detected to be met. The preset trigger condition may be determined according to an actual scenario. For example, the preset trigger condition may be preset gesture information, a touch operation on a virtual key of a touch interface, or a pressing operation on one or more physical keys of the terminal device, and the like. The video to be decoded may be a locally stored video, or may be a video acquired from an external device through a specific information transmission manner (such as a wireless transmission manner or a wired transmission manner).
In some embodiments, the type of the video to be decoded may be determined according to a file type identifier such as a name extension of the video to be decoded. The hard decoding types supported by the terminal device may be stored in the terminal device in advance in a list or the like. The hard decoding type supported by the terminal device may be determined according to model information of the terminal device and/or software version information of an operating system of the terminal device. In some embodiments, the type of the video to be decoded may be compared with a hard decoding type pre-stored in a specific list in the terminal device to determine whether the type of the video to be decoded is a hard decoding type supported by the terminal device.
In the embodiment of the present application, any group of pictures (GOP) may include three video frames. The first frame of video frame of the image group may be a key frame, which is also called Intra-coded picture frame (Intra-coded picture) or I frame. The key frame is an independent frame with all information, and can be independently decoded without referring to other images. In addition, the image group may further include a B frame (bidirectional predictive coded picture), that is, a bidirectional predictive coded image frame. The difference between the current frame and the previous and subsequent frames is recorded in the B frame. The group of pictures also includes a Predictive-coded Picture frame (also called P frame), which needs to be encoded with reference to a previous video frame.
Generally, in the video to be decoded, the partition of the group of pictures is predetermined. The number of frames included in each of the image groups may be the same or different. Since the key frame in any group of pictures is only one frame, some attribute information of the group of pictures can be obtained through the key frame information, for example, the number of the groups of pictures contained in the video to be decoded can be determined according to the number of the key frames, and the dividing condition of the group of pictures can be obtained according to the distribution condition of the key frames in the video to be decoded.
Illustratively, the key frame information includes frequency information of the key frames and/or interval information between the key frames. The frequency information of the key frame may include an average frequency of occurrence of the key frame in the video to be decoded, or an average frequency of occurrence in a specific video portion of the video to be decoded. For example, in some cases, the average frequency of occurrence of the key frames in the video to be decoded may be 10 frames/second, and in other cases, the average frequency of occurrence of the key frames in the video to be decoded may be 3 frames/second. In addition, the occurrence frequency of the key frame in different parts of the video to be decoded may also be obtained, and the specific content of the frequency information is not limited herein. The interval information between the key frames may include the number of frames spaced between respective adjacent key frames, and the like. Generally, for any key frame, the number of frames between the key frame and the next key frame, that is, the number of frames included in the group of images in which the key frame is located, is reduced by 1. Therefore, the interval information between the key frames can indicate the division condition of the corresponding image groups in the video to be decoded.
And step S102, determining a hard decoding mode of the video to be decoded according to the key frame information.
In the embodiment of the present application, according to the key frame information, information such as an occurrence frequency of the key frame in the video to be decoded and a dividing condition of each group of pictures in the video to be decoded can be determined, so that a more reasonable hard decoding manner can be determined to improve video decoding efficiency. For example, according to the key frame information, a portion to be decoded and/or a decoding flow in the video to be decoded may be determined. The portion to be decoded may be determined and selected according to actual scene requirements, for example, if the occurrence frequency of the key frame in the video to be decoded is high, it may be determined that the hard decoding manner is to decode only the key frame in the video to be decoded to achieve a desired video effect; if the occurrence frequency of the key frame in the video to be decoded is low, it may be determined that the hard decoding manner is to decode each frame of video frame in the video to be decoded. In addition, it is also possible to respectively determine each group of image groups to determine a portion to be decoded in any group of image groups, that is, it is possible to respectively determine an image group hard decoding manner of each group of image groups, so that, subsequently, according to the sequence before and after the playing of each group of image groups in the video to be decoded, each group of image groups is sequentially hard decoded by the image group hard decoding manner respectively corresponding to each group of image groups, so as to implement hard decoding of the video to be decoded.
Step S103, according to the hard decoding mode, the video to be decoded is hard decoded.
In the embodiment of the present application, hard decoding may be performed on each group of image groups in sequence according to the order of the group of image groups before and after playing in the video to be decoded, so as to implement hard decoding on the video to be decoded. Therefore, decoding can be performed for each group of images according to the above-described hard decoding method. In some examples, since the hard decoding modes of the group of pictures may be different for each group of pictures in the determined hard decoding modes, the hard decoding modes of the group of pictures may be continuously adjusted for each group of pictures during the hard decoding process. Of course, in some examples, the image group decoding manner of each image group may be the same.
In some embodiments, the video decoding method further includes:
and if the preset instruction is detected and the type of the video to be decoded is not the hard decoding type supported by the terminal equipment, decoding the video to be decoded in a soft decoding mode.
In the embodiment of the present application, there may be a plurality of soft decoding methods, and the method is not limited herein. Illustratively, the soft decoding mode may include FFmpeg and the like.
In some embodiments, the key frame information includes an average frequency of occurrence of key frames;
the step S101 may include:
if a preset instruction is detected and the type of the video to be decoded is determined to be a hard decoding type supported by the terminal equipment, determining the duration of the video to be decoded and the number of key frames contained in the video to be decoded;
determining the average occurrence frequency of the key frames in the video to be decoded according to the duration of the video to be decoded and the number of the key frames contained in the video to be decoded;
the step S102 may be configured to:
and determining a hard decoding mode of the video to be decoded according to the average frequency of occurrence.
In this embodiment, information such as an average frequency of occurrence of the key frame in the video to be decoded may be calculated according to the duration of the video to be decoded and the number of key frames included in the video to be decoded, so as to determine a hard decoding manner for the video to be decoded. For example, the hard decoding manner may be used to determine the to-be-decoded portion and/or the decoding flow in the to-be-decoded video.
In some embodiments, the determining, if the preset instruction is detected and the type of the video to be decoded is determined to be a hard decoding type supported by the terminal device, the determining the duration of the video to be decoded and the number of key frames included in the video to be decoded includes:
and if the preset instruction is detected and the type of the video to be decoded is determined to be the hard decoding type supported by the terminal equipment, reading file header information of the video to be decoded, wherein the file header information comprises the duration of the video to be decoded and the number of key frames contained in the video to be decoded.
In this embodiment, the header information may include identification information and/or attribute information about a video to be decoded, and the like, where the header information may specifically include a duration of the video to be decoded and a number of key frames included in the video to be decoded. By reading the file header information of the video to be decoded, the time length of the video to be decoded and the number of key frames contained in the video to be decoded can be quickly acquired, so that the number is divided by the time length to acquire information such as the average occurrence frequency of the key frames in the video to be decoded. Therefore, the average occurrence frequency of the key frames in the video to be decoded can be quickly determined through the embodiment of the application, the content of the video to be decoded does not need to be traversed, and therefore the information processing efficiency is improved.
In some embodiments, the determining a hard decoding mode for the video to be decoded according to the average occurrence frequency includes:
step S201, if the average frequency of occurrence is greater than a preset frequency, determining that the hard decoding mode of the video to be decoded is to perform hard decoding on key frames in each group of image groups;
step S202, if the average frequency is not greater than the preset frequency, determining that the hard decoding manner of the video to be decoded is to perform hard decoding on each frame of video frame in each group of image groups.
In this embodiment, the hard decoding mode of the video to be decoded may be determined according to the average occurrence frequency of the key frames. The hard decoding mode may be a unified hard decoding mode for each image group in the video to be decoded; in addition, in some embodiments, the hard decoding manner may also be modified according to the specific situation of the group of pictures in the hard decoding process.
In some embodiments, the key frame information includes interval information between key frames of two adjacent frames;
the determining a hard decoding mode for the video to be decoded according to the key frame information includes:
for each group of image, determining a hard decoding mode for the group of image according to the key frame in the group of image and the interval information between the key frames in the next group of image;
the hard decoding the video to be decoded according to the hard decoding method includes:
and according to the sequence of the groups of image groups in the video to be decoded before and after playing, carrying out hard decoding on the groups of image groups in sequence by using an image group hard decoding mode corresponding to the groups of image groups.
In this embodiment of the present application, information such as the size of the image group may be determined according to the interval information between the key frame in the image group and the key frame in the next image group of the image group, so as to determine whether there are many video frames included in the image group, and thus determine the portion to be decoded in the image group.
For example, for each group of pictures, determining a hard decoding mode for a group of pictures of the group of pictures according to the key frames in the group of pictures and the interval information between key frames in a group of pictures next to the group of pictures may specifically include:
if the interval between the key frame in the group of pictures and the key frame in the group of pictures next to the group of pictures is less than a first preset number of frames, the group of pictures of the group of pictures can be hard-decoded only by the key frame in the group of pictures; if the interval between the key frame in the group of pictures and the key frame in the group of pictures next to the group of pictures is not less than a first preset number of frames but less than a second preset number of frames, the group of pictures in the group of pictures can be hard-decoded by hard-decoding the key frame and the P frame in the group of pictures; if the interval between the key frame in the group of pictures and the key frame in the group of pictures next to the group of pictures is not less than a second preset number of frames, the group of pictures can be hard-decoded by hard-decoding each video frame in the group of pictures.
Of course, the hard decoding method of the group of pictures may be specifically determined according to the actual scene, and is not limited herein.
In some embodiments, the determining, for each group of pictures, a hard decoding mode for a group of pictures of the group of pictures according to interval information between a key frame in the group of pictures and a key frame in a group of pictures next to the group of pictures includes:
sequentially acquiring each group of image groups in a data queue according to the sequence of the image groups in the video to be decoded before and after playing, and determining a hard image group decoding mode of the read image groups according to the number of video frames contained in the read image groups each time one group of image groups is read, wherein the number of the image groups stored in the data queue does not exceed one group.
In this embodiment, the data queue may be used as a data buffer for sequentially storing each group of image groups in the data queue according to the sequence of the image groups before and after playing in the video to be decoded and the hard decoding process. The number of the groups of images stored in the data queue does not exceed one, so that different groups of images are not stored in the data queue at the same time. A group of image groups can be cached in the data queue, so that a hard decoding client in the terminal device can conveniently read a group of complete image group data from the data queue, and hard decode the read image group according to an image group hard decoding mode. The operation of acquiring the group of pictures in the data queue and the operation of hard decoding the read group of pictures may be asynchronous.
Therefore, by specifying information such as the size of the group of pictures based on the number of frames included in the group of pictures read in the data queue, it is possible to specify a hard decoding scheme for the group of pictures read.
In the embodiment of the application, when the preset instruction is detected and the type of the video to be decoded is determined to be the hard decoding type supported by the terminal device, the specific hard decoding mode is adjusted according to the key frame information of the video to be decoded and the video to be decoded is subjected to hard decoding, so that the more reasonable hard decoding mode can be determined according to the specific state of the video to be decoded, the video is efficiently decoded, and the video decoding efficiency is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 3 shows a block diagram of a video decoding apparatus according to an embodiment of the present application, which corresponds to the video decoding method described above in the foregoing embodiment, and only shows portions related to the embodiment of the present application for convenience of description.
Referring to fig. 3, the video decoding apparatus 3 includes:
an obtaining module 301, configured to obtain key frame information of a video to be decoded if a preset instruction is detected and it is determined that a type of the video to be decoded is a hard decoding type supported by a terminal device, where the preset instruction is used to instruct to perform a decoding operation on the video to be decoded, the video to be decoded includes at least one group of images, and a first frame video frame in each group of images is a key frame;
a determining module 302, configured to determine a hard decoding mode for the video to be decoded according to the key frame information;
a hard decoding module 303, configured to perform hard decoding on the video to be decoded according to the hard decoding manner.
Optionally, the key frame information includes an average frequency of occurrence of key frames;
the acquiring module 301 specifically includes:
the first determining unit is used for determining the duration of the video to be decoded and the number of key frames contained in the video to be decoded if a preset instruction is detected and the type of the video to be decoded is determined to be a hard decoding type supported by the terminal equipment;
a second determining unit, configured to determine, according to a duration of the video to be decoded and a number of key frames included in the video to be decoded, an average occurrence frequency of the key frames in the video to be decoded;
the determining module 302 is specifically configured to:
and determining a hard decoding mode of the video to be decoded according to the average frequency of occurrence.
Optionally, the first determining unit is specifically configured to:
and if the preset instruction is detected and the type of the video to be decoded is determined to be the hard decoding type supported by the terminal equipment, reading file header information of the video to be decoded, wherein the file header information comprises the duration of the video to be decoded and the number of key frames contained in the video to be decoded.
Optionally, the key frame information includes interval information between key frames of two adjacent frames;
the determining module 302 specifically includes:
a first determining subunit, configured to determine, if the average occurrence frequency is greater than a preset frequency, that the hard decoding mode of the video to be decoded is to perform hard decoding on the key frames in each group of image groups;
and a second determining subunit, configured to determine, if the average occurrence frequency is not greater than the preset frequency, that the hard decoding manner of the video to be decoded is to perform hard decoding on each frame of video frames in each group of image groups.
Optionally, the determining module 302 is specifically configured to:
for each group of image, determining a hard decoding mode for the group of image according to the key frame in the group of image and the interval information between the key frames in the next group of image;
the hard decoding module 303 is specifically configured to:
and according to the sequence of the groups of image groups in the video to be decoded before and after playing, carrying out hard decoding on the groups of image groups in sequence by using an image group hard decoding mode corresponding to the groups of image groups.
Optionally, the determining module 302 is specifically configured to:
sequentially acquiring each group of image groups in a data queue according to the sequence of the image groups in the video to be decoded before and after playing, and determining a hard image group decoding mode of the read image groups according to the number of video frames contained in the read image groups each time one group of image groups is read, wherein the number of the image groups stored in the data queue does not exceed one group.
Optionally, the video decoding apparatus 3 further includes:
and the soft decoding module is used for decoding the video to be decoded in a soft decoding mode if a preset instruction is detected and the type of the video to be decoded is not the hard decoding type supported by the terminal equipment.
In the embodiment of the application, when the preset instruction is detected and the type of the video to be decoded is determined to be the hard decoding type supported by the terminal device, the specific hard decoding mode is adjusted according to the key frame information of the video to be decoded and the video to be decoded is subjected to hard decoding, so that the more reasonable hard decoding mode can be determined according to the specific state of the video to be decoded, the video is efficiently decoded, and the video decoding efficiency is improved.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 4 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 4, the terminal device 4 of this embodiment includes: at least one processor 40 (only one is shown in fig. 4), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, wherein the steps in any of the various video decoding method embodiments described above are implemented when the computer program 42 is executed by the processor 40.
The terminal device 4 may be a server, a mobile phone, a wearable device, an Augmented Reality (AR)/Virtual Reality (VR) device, a desktop computer, a notebook, a desktop computer, a palmtop computer, or other computing devices. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of the terminal device 4, and does not constitute a limitation of the terminal device 4, and may include more or less components than those shown, or combine some of the components, or different components, such as may also include input devices, output devices, network access devices, etc. The input device may include a keyboard, a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of a fingerprint), a microphone, a camera, and the like, and the output device may include a display, a speaker, and the like.
The Processor 40 may be a Central Processing Unit (CPU), and the Processor 40 may also be other general-purpose processors, 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, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. In other embodiments, the memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the terminal device 4. Further, the memory 41 may include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs, such as program codes of the computer programs. The above-mentioned memory 41 may also be used to temporarily store data that has been output or is to be output.
In addition, although not shown, the terminal device 4 may further include a network connection module, such as a bluetooth module Wi-Fi module, a cellular network module, and the like, which is not described herein again.
In this embodiment, when the processor 40 executes the computer program 42 to implement the steps in any of the video decoding method embodiments, when a preset instruction is detected and it is determined that the type of the video to be decoded is a hard decoding type supported by a terminal device, a specific hard decoding manner may be adjusted according to the key frame information of the video to be decoded and the video to be decoded is hard decoded, so that a more reasonable hard decoding manner may be determined according to a specific state of the video to be decoded, thereby efficiently decoding the video and improving the efficiency of video decoding.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above method embodiments.
The embodiments of the present application provide a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in the above method embodiments when executed.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer-readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), random-access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the above modules or units is only one logical function division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A video decoding method, comprising:
if a preset instruction is detected and the type of a video to be decoded is determined to be a hard decoding type supported by a terminal device, acquiring key frame information of the video to be decoded, wherein the preset instruction is used for indicating the decoding operation of the video to be decoded, the video to be decoded comprises at least one group of image groups, and a first frame video frame in each group of image groups is a key frame;
determining a hard decoding mode of the video to be decoded according to the key frame information;
and carrying out hard decoding on the video to be decoded according to the hard decoding mode.
2. The video decoding method of claim 1, wherein the key frame information includes an average frequency of occurrence of key frames;
if the preset instruction is detected and the type of the video to be decoded is determined to be the hard decoding type supported by the terminal equipment, acquiring the key frame information of the video to be decoded, wherein the key frame information comprises:
if a preset instruction is detected and the type of the video to be decoded is determined to be a hard decoding type supported by the terminal equipment, determining the duration of the video to be decoded and the number of key frames contained in the video to be decoded;
determining the average occurrence frequency of the key frames in the video to be decoded according to the duration of the video to be decoded and the number of the key frames contained in the video to be decoded;
the determining a hard decoding mode of the video to be decoded according to the key frame information includes:
and determining a hard decoding mode of the video to be decoded according to the average frequency of occurrence.
3. The video decoding method of claim 2, wherein the determining the duration of the video to be decoded and the number of key frames included in the video to be decoded, if the preset instruction is detected and the type of the video to be decoded is determined to be a hard decoding type supported by a terminal device, comprises:
if a preset instruction is detected and the type of the video to be decoded is determined to be a hard decoding type supported by the terminal equipment, reading file header information of the video to be decoded, wherein the file header information comprises the duration of the video to be decoded and the number of key frames contained in the video to be decoded.
4. The video decoding method of claim 2, wherein said determining a hard decoding mode for the video to be decoded according to the average frequency of occurrence comprises:
if the average frequency of occurrence is greater than a preset frequency, determining that the hard decoding mode of the video to be decoded is to perform hard decoding on key frames in each group of image groups;
and if the average frequency of occurrence is not greater than the preset frequency, determining that the hard decoding mode of the video to be decoded is to perform hard decoding on each frame of video frame in each group of image groups.
5. The video decoding method of claim 1, wherein the key frame information includes interval information between key frames of two adjacent frames;
the determining a hard decoding mode of the video to be decoded according to the key frame information includes:
for each group of image groups, determining a hard decoding mode of the group of images according to key frames in the group of images and interval information between key frames of a next group of image groups of the group of images;
the hard decoding the video to be decoded according to the hard decoding mode includes:
and according to the sequence of the groups of image groups in the video to be decoded before and after playing, carrying out hard decoding on the groups of image groups in sequence by using an image group hard decoding mode corresponding to the groups of image groups.
6. The video decoding method of claim 5, wherein said determining, for each group of pictures, a hard decoding mode for a group of pictures based on interval information between a key frame in the group of pictures and a key frame in a group of pictures next to the group of pictures comprises:
sequentially acquiring each group of image groups in a data queue according to the sequence of the image groups in the video to be decoded before and after playing, and determining a hard image group decoding mode of the read image groups according to the number of video frames contained in the read image groups each time one group of image groups is read, wherein the number of the image groups stored in the data queue does not exceed one group.
7. The video decoding method of any of claims 1 to 6, wherein the video decoding method further comprises:
and if the preset instruction is detected and the type of the video to be decoded is not the hard decoding type supported by the terminal equipment, decoding the video to be decoded in a soft decoding mode.
8. A video decoding apparatus, comprising:
the device comprises an acquisition module, a decoding module and a display module, wherein the acquisition module is used for acquiring key frame information of a video to be decoded if a preset instruction is detected and the type of the video to be decoded is determined to be a hard decoding type supported by a terminal device, the preset instruction is used for indicating the decoding operation of the video to be decoded, the video to be decoded comprises at least one group of image groups, and a first frame video frame in each group of image groups is a key frame;
a determining module, configured to determine a hard decoding mode for the video to be decoded according to the key frame information;
and the hard decoding module is used for carrying out hard decoding on the video to be decoded according to the hard decoding mode.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the video decoding method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out a video decoding method according to any one of claims 1 to 7.
CN202010560348.1A 2020-06-18 2020-06-18 Video decoding method, video decoding device and terminal equipment Pending CN111669599A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010560348.1A CN111669599A (en) 2020-06-18 2020-06-18 Video decoding method, video decoding device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010560348.1A CN111669599A (en) 2020-06-18 2020-06-18 Video decoding method, video decoding device and terminal equipment

Publications (1)

Publication Number Publication Date
CN111669599A true CN111669599A (en) 2020-09-15

Family

ID=72388503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010560348.1A Pending CN111669599A (en) 2020-06-18 2020-06-18 Video decoding method, video decoding device and terminal equipment

Country Status (1)

Country Link
CN (1) CN111669599A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113542856A (en) * 2021-06-28 2021-10-22 宜宾中星技术智能系统有限公司 Reverse playing method, device, equipment and computer readable medium for online video
CN114390336A (en) * 2021-12-13 2022-04-22 百度在线网络技术(北京)有限公司 Video decoding method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101091388A (en) * 2004-12-28 2007-12-19 松下电器产业株式会社 Mobile type digital broadcast receiving apparatus and receiving method
CN101409832A (en) * 2008-11-06 2009-04-15 上海华为技术有限公司 Transmission method and apparatus for video data
US20090180533A1 (en) * 2008-01-11 2009-07-16 Apple Inc. control of video decoder for reverse playback operation
CN103310820A (en) * 2012-03-14 2013-09-18 三星电子(中国)研发中心 Method for optimizing multimedia player
CN108063973A (en) * 2017-12-14 2018-05-22 浙江大华技术股份有限公司 A kind of method for decoding video stream and equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101091388A (en) * 2004-12-28 2007-12-19 松下电器产业株式会社 Mobile type digital broadcast receiving apparatus and receiving method
US20090180533A1 (en) * 2008-01-11 2009-07-16 Apple Inc. control of video decoder for reverse playback operation
CN101409832A (en) * 2008-11-06 2009-04-15 上海华为技术有限公司 Transmission method and apparatus for video data
CN103310820A (en) * 2012-03-14 2013-09-18 三星电子(中国)研发中心 Method for optimizing multimedia player
CN108063973A (en) * 2017-12-14 2018-05-22 浙江大华技术股份有限公司 A kind of method for decoding video stream and equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113542856A (en) * 2021-06-28 2021-10-22 宜宾中星技术智能系统有限公司 Reverse playing method, device, equipment and computer readable medium for online video
CN113542856B (en) * 2021-06-28 2023-06-13 宜宾中星技术智能系统有限公司 Method, device, equipment and computer readable medium for reverse playing of online video
CN114390336A (en) * 2021-12-13 2022-04-22 百度在线网络技术(北京)有限公司 Video decoding method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN111400553A (en) Video searching method, video searching device and terminal equipment
CN113457160A (en) Data processing method and device, electronic equipment and computer readable storage medium
WO2017202175A1 (en) Method and device for video compression and electronic device
CN111669599A (en) Video decoding method, video decoding device and terminal equipment
CN112055254B (en) Video playing method, device, terminal and storage medium
CN111464760A (en) Dynamic image generation method and device and terminal equipment
CN112230923A (en) User interface rendering method, user interface rendering device and server
CN113395572A (en) Video processing method and device, storage medium and electronic equipment
CN109302636B (en) Method and device for providing panoramic image information of data object
CN111813465A (en) Information acquisition method, device, medium and equipment
CN110188782B (en) Image similarity determining method and device, electronic equipment and readable storage medium
CN108989704B (en) Image generation method and device and terminal equipment
CN109358927B (en) Application program display method and device and terminal equipment
CN112215751A (en) Image scaling method, image scaling device and terminal equipment
CN112929728A (en) Video rendering method, device and system, electronic equipment and storage medium
CN108765503B (en) Skin color detection method, device and terminal
CN113096218A (en) Dynamic image playing method, device, storage medium and computer equipment
CN112328351A (en) Animation display method, animation display device and terminal equipment
US7861007B2 (en) Method and apparatus for multimedia display in a mobile device
CN111447439B (en) Image coding method, image coding device and mobile terminal
WO2022120828A1 (en) Video frame extraction method, device, and storage medium
CN113691756A (en) Video playing method and device and electronic equipment
CN108335706B (en) Seamless playing method of multimedia file, terminal equipment and storage medium
CN111949826A (en) Method for adding and displaying article information in video, electronic equipment and storage medium
CN112631708B (en) Picture display method and 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200915