CN108401185B - Reference frame selection method, video transcoding method, electronic device and storage medium - Google Patents

Reference frame selection method, video transcoding method, electronic device and storage medium Download PDF

Info

Publication number
CN108401185B
CN108401185B CN201810412994.6A CN201810412994A CN108401185B CN 108401185 B CN108401185 B CN 108401185B CN 201810412994 A CN201810412994 A CN 201810412994A CN 108401185 B CN108401185 B CN 108401185B
Authority
CN
China
Prior art keywords
reference frame
macro block
encoder
video
target
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
CN201810412994.6A
Other languages
Chinese (zh)
Other versions
CN108401185A (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.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething 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 Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201810412994.6A priority Critical patent/CN108401185B/en
Publication of CN108401185A publication Critical patent/CN108401185A/en
Application granted granted Critical
Publication of CN108401185B publication Critical patent/CN108401185B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • 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/167Position within a video image, e.g. region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/573Motion compensation with multiple frame prediction using two or more reference frames in a given prediction direction

Abstract

The invention discloses a reference frame selection method, a video transcoding method, electronic equipment and a storage medium, which are used for a video transcoding module, wherein the video transcoding module comprises a first encoder and a second encoder, the first encoder is used for processing a first macro block, and the second encoder is used for processing a second macro block; the reference frame selection method comprises the following steps: acquiring reference frame information of a target macro block, wherein the target macro block is a first macro block related to a second macro block, and the reference frame information of the target macro block is calculated by a first encoder; and calculating the reference frame information of the second macro block according to the reference frame information of the target macro block. The second encoder can refer to the reference frame information of the first encoder, reduce the traversal range of the optimal reference frame and reduce the evaluation of the second encoder on the reference frame, thereby reducing the calculation amount of video transcoding; and the first encoder and the second encoder can output videos with different code rates.

Description

Reference frame selection method, video transcoding method, electronic device and storage medium
Technical Field
The present invention relates to video compression technologies, and in particular, to a reference frame selection method, a video transcoding method, an electronic device, and a storage medium.
Background
Video coding standards such as H.264/AVC, HEVC/H.265 and the like provide excellent coding performance. The h.264/AVC compression technique mainly employs the following methods to compress video data.
1) And (4) intra-frame prediction compression, which solves the problem of spatial domain data redundancy.
2) Inter-frame prediction compression, i.e. motion estimation and compensation, solves the problem of time domain data redundancy.
3) The integer discrete cosine transform, DCT, transforms spatial correlations into frequency domain independent data and then quantizes.
4) CABAC compression.
The realization of video coding such as H.264/AVC, HEVC/H.265 and the like needs to search the best matching macro block of the current macro block to be coded in a reference frame, and the process is called motion estimation; then, motion compensation is performed, i.e. the current block is subtracted from the reference block to obtain a residual block, and the residual block and the motion vector are used as compressed video information. It is therefore important to know the exact choice of the reference frame.
Moreover, the high compression performance of video coding standards such as h.264/AVC and HEVC/h.265 is at the cost of increasing the complexity of operation, so how to quickly and accurately select a reference frame to shorten the motion estimation time and increase the coding efficiency is a problem that needs to be solved urgently.
One scenario of a transcoding system is one-in multiple-out, as shown in fig. 1, a video decoder receives an input video stream, decodes the input video stream, and then sends the decoded data to a subsequent stage; the later stage comprises multi-path transcoding tasks, each transcoding stream is independently subjected to one-path transcoding task by using a video encoder, and the multi-path transcoding tasks are completely unrelated.
For the transcoding system, the decoder can transmit decoded information such as decoded GOP structures, macroblock modes, motion vectors and the like to the video encoder, and the video encoder quickly judges the reference frame according to the transmitted decoded information; although this optimization can utilize the association between the video encoder and the video decoder, the encoder reduces the complexity of encoding by using the known information of the decoder, but this optimization cannot be applied to scenes with code rate variation in the transcoding process.
Disclosure of Invention
In order to overcome the deficiencies of the prior art, an object of the present invention is to provide a reference frame selection method, which can solve the problem of how to quickly and accurately select a reference frame, so as to shorten the motion estimation time and improve the coding efficiency.
The second objective of the present invention is to provide a video transcoding method, which can solve the problem of how to quickly and accurately select a reference frame to shorten the motion estimation time and improve the encoding efficiency.
It is another object of the present invention to provide an electronic device, which can solve the problem of how to quickly and accurately select a reference frame to shorten the motion estimation time and improve the encoding efficiency.
It is a fourth objective of the present invention to provide a storage medium storing a computer program, which can solve the problem of how to quickly and accurately select a reference frame to shorten the motion estimation time and improve the encoding efficiency.
One of the purposes of the invention is realized by adopting the following technical scheme:
the reference frame selection method is used for a video transcoding module, wherein the video transcoding module comprises a first encoder and at least one second encoder which are used for processing the same video stream and respectively outputting the video stream, the first encoder is used for processing a first macro block, and the second encoder is used for processing a second macro block; the reference frame selection method comprises the following steps:
acquiring reference frame information of a target macro block, wherein the target macro block is a first macro block related to a second macro block, and the reference frame information of the target macro block is calculated by a first encoder;
and calculating the reference frame information of the second macro block according to the reference frame information of the target macro block.
Further, the first macro block associated with the second macro block specifically includes: the first macro block is located at the corresponding position of the second macro block, or the first macro block is adjacent to the corresponding position of the second macro block.
Further, the reference frame selection method further comprises the following steps:
the second encoder obtains frame type information from the first encoder.
Further, the calculating the reference frame information of the second macroblock according to the reference frame information of the target macroblock specifically includes the following steps:
acquiring a candidate reference frame of the second macro block according to the frame type information and the reference frame information of the target macro block;
and calculating the reference frame information of the second macro block according to the candidate reference frame.
Further, the calculating the reference frame information of the second macroblock according to the candidate reference frame specifically includes the following steps:
sorting the candidate reference frames according to the reference frame information of the corresponding target macro blocks of the candidate reference frames;
and traversing the sorted candidate reference frames in sequence, and selecting the best reference frame of the second macro block.
The second purpose of the invention is realized by adopting the following technical scheme:
the video transcoding method is used for a video transcoding module, and the video transcoding module comprises a first encoder and at least one second encoder which are used for processing the same video stream and respectively outputting the same video stream;
the video transcoding method comprising the reference frame selection method of any of claims 1-5.
Further, the video transcoding method further comprises the following steps:
and decoding the acquired video stream and transmitting the decoded video stream to the first encoder and the second encoder.
Further, the video transcoding method further comprises the following steps:
and transmitting the decoded video stream to at least one of the first encoder and the second encoder after adjusting the resolution.
The third purpose of the invention is realized by adopting the following technical scheme:
an electronic device comprising a memory, a processor, and a program stored in the memory, the program configured to be executed by the processor, the processor when executing the program implementing:
the step of the reference frame selection method; or
The video transcoding method comprises the following steps.
The fourth purpose of the invention is realized by adopting the following technical scheme:
a storage medium storing a computer program that when executed by a processor implements:
the step of the reference frame selection method; or
The video transcoding method comprises the following steps.
Compared with the prior art, the invention has the beneficial effects that: calculating reference frame information of a second macroblock in a second encoder by using reference frame information of a target macroblock, the target macroblock being a first macroblock associated with the second macroblock, the reference frame information of the target macroblock being calculated by the first encoder; because the second encoder and the first encoder process the same video input stream, the second encoder can refer to the reference frame information of the first encoder, reduce the traversal range of the best reference frame, and reduce the evaluation of the second encoder on the reference frame, thereby reducing the calculation amount of video transcoding; and the first encoder and the second encoder can output videos with different code rates.
Drawings
Fig. 1 is a schematic structural diagram of an input-output transcoding system;
FIG. 2 is a flowchart illustrating a reference frame selection method according to a first embodiment of the present invention;
fig. 3 is a schematic structural diagram of a video transcoding module according to a first embodiment;
FIG. 4 is a schematic diagram of a first macroblock associated with a second macroblock;
FIG. 5 is a flowchart illustrating a reference frame selection method according to a second embodiment of the present invention;
fig. 6 is a schematic structural diagram of a video transcoding module according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that any combination of the embodiments or technical features described below can be used to form a new embodiment without conflict.
Example one
Fig. 2 is a schematic flowchart of a reference frame selection method in this embodiment, and is suitable for the video transcoding module shown in fig. 3. The video transcoding module comprises a first encoder and at least one second encoder which are used for processing the same video stream and outputting the video stream respectively. The first encoder and each second encoder compress and encode the same input video stream; the first encoder and the second encoder can adopt different rate control parameters, so that video streams with different qualities, such as video stream 1-video stream 3, can be output.
Macroblocks are the primary carriers of video information, and a coded picture is usually divided into macroblocks that contain luminance and chrominance information for each pixel. In h.264, a macroblock is a 16 × 16 pixel area in an image frame and is a basic unit of operation for motion compensation. In h.265, the macroblock size is extended from 16 × 16 to 64 × 64 of h.264 to facilitate compression of high resolution video.
For ease of understanding, a macroblock in the process of processing the input video stream by the first encoder is referred to as a first macroblock; the macroblock in the process of processing the input video stream by the second encoder is referred to as a second macroblock.
The reference frame selection method of the present embodiment includes the following steps:
step S110, obtaining reference frame information of a target macro block, where the target macro block is a first macro block associated with a second macro block, and the reference frame information of the target macro block is calculated by a first encoder.
As a preferred embodiment, the first encoder independently performs encoding of the input video stream, performs motion estimation on each first macroblock, and obtains a best reference frame corresponding to each first macroblock, where a correspondence between a certain first macroblock and its best reference frame is reference frame information of the first macroblock.
When the second encoder processes a second macroblock, it needs to find the best reference frame corresponding to the second macroblock. Since the second encoder processes the same input video stream as the first encoder, the reference frame information of the first macroblock can be used to narrow the traversal range of the best reference frame of the second macroblock.
As a preferred embodiment, the target macroblock, i.e. the first macroblock associated with the second macroblock, specifically is: the first macro block is located at the corresponding position of the second macro block, or the first macro block is adjacent to the corresponding position of the second macro block.
As shown in fig. 4, the first macro block associated with the second macro block includes a first macro block 21 located at a corresponding position 20 of the second macro block 10.
The corresponding position 20 of the second macro block 10 can be found from the coordinates of the second macro block 10 according to the high-width scaling information of the macro blocks, i.e. the macro block 21 of the corresponding position 20 of the second macro block 10 in the first encoder.
Since the reference frames of neighboring macroblocks will coincide with a high probability during inter-coding, even if the resolution or code rate is reduced, the first macroblock associated with the second macroblock, i.e. the target macroblock, may also be the first macroblock 22 adjacent to the corresponding position 20 of the second macroblock 10.
In this embodiment, the first macro block 22 adjacent to the corresponding position 20 of the second macro block 10 is specifically a first macro block 22 located in the upper, lower, left or right direction of the first macro block 21 located at the corresponding position 20 of the second macro block 10, and in another embodiment, the first macro block 22 adjacent to the corresponding position 20 of the second macro block 10 may also be a first macro block (not shown) located in the oblique direction of the first macro block 21 located at the corresponding position 20 of the second macro block 10, and may also be a first macro block (not shown) located in the second circle around the first macro block 21 located at the corresponding position 20 of the second macro block 10.
The reference frame information of the target macro block can be obtained according to the target macro block, namely the first macro block associated with the second macro block.
And step S120, calculating the reference frame information of the second macro block according to the reference frame information of the target macro block.
Because the second encoder and the first encoder process the same input video stream, each frame image in the second encoder can correspond to a certain frame image in the first encoder, so that a corresponding certain frame or multiple frame images in the second encoder can be found out according to the reference frame information of the target macro block; this one or more frame pictures in the second encoder may be referred to as a candidate reference frame for the second macroblock; and then a candidate reference frame can be selected as the best reference frame of the second macro block, and the corresponding relation between the second macro block and the best reference frame is the reference frame information of the second macro block.
In a preferred embodiment, selecting a candidate reference frame as the best reference frame for a macroblock comprises the following steps: traversing all candidate reference frames according to the time sequence from near to far; and setting a certain threshold value according to a preset variable in motion estimation in the traversing process, and ending the traversing of the candidate reference frame if the calculated preset variable value is smaller than the threshold value, wherein the current candidate reference frame is the optimal reference frame.
In a preferred embodiment, there may be a plurality of target macro blocks of a second macro block, i.e. the first macro block associated with the second macro block, and there may be a plurality of target macro blocks corresponding to the same best reference frame, so there may be one or more candidate reference frames of the second macro block.
In another embodiment, if there is only one candidate reference frame of the second macro block, i.e. the best reference frame of the first macro block associated with the second macro block is the same, the candidate reference frame of the second macro block is the best reference frame thereof. If the candidate reference frames of the second macro block are multiple, the candidate reference frames can be sorted according to the occurrence frequency of the optimal reference frame of the first macro block associated with the second macro block, the preset variable of the candidate reference frame with the high frequency is calculated preferentially, a certain threshold value is set, if the calculated preset variable value is smaller than the threshold value, traversal of the candidate reference frame is finished, and the current candidate reference frame is the optimal reference frame.
In the reference frame selection method provided by the embodiment of the present invention, reference frame information of a second macro block in a second encoder is calculated by using reference frame information of a target macro block, which is a first macro block associated with the second macro block, and the reference frame information of the target macro block is calculated by a first encoder; because the second encoder and the first encoder process the same video input stream, the second encoder can refer to the reference frame information of the first encoder, reduce the traversal range of the best reference frame, and reduce the evaluation of the second encoder on the reference frame, thereby reducing the calculation amount of video transcoding; and the first encoder and the second encoder can output videos with different code rates.
Example two
The reference frame selection method as shown in fig. 5 includes the following steps:
step S210, the second encoder obtains the frame type information from the first encoder.
When the first encoder encodes an input video stream, a Group of Pictures (GOP) structure is calculated, and the GOP structure may represent the type of each frame, i.e., frame type information. The second encoder may multiplex the frame type information obtained from the first encoder, so that the second encoder does not need to perform analysis calculation on the frame type; and the definition of the second encoder and the first encoder to each frame image type can be ensured to be completely consistent, so that the accuracy and the stability of the second encoder using the reference frame information of the first encoder are ensured.
In another embodiment, the second encoder may calculate the picture group structure, or the second encoder may use the reference frame information of the first encoder, but the stability is slightly poor and the calculation amount is more required.
Step S220, obtaining reference frame information of a target macro block, where the target macro block is a first macro block associated with a second macro block, and the reference frame information of the target macro block is calculated by a first encoder.
Step S220 corresponds to step S110 in the first embodiment, and is not described again.
Step S230, calculating reference frame information of the second macroblock according to the reference frame information of the target macroblock.
As a preferred embodiment, the step S230 calculates the reference frame information of the second macroblock according to the reference frame information of the target macroblock, and specifically includes the following steps:
and step S231, acquiring a candidate reference frame of the second macro block according to the frame type information and the reference frame information of the target macro block.
The second encoder can map the best reference frame of the target macro block, i.e. the best reference frame of each first macro block associated with the second macro block, to the corresponding frame in the second encoder more quickly according to the frame type information, so that the candidate reference frame of the second macro block can be found out more quickly.
Step S232, calculating the reference frame information of the second macro block according to the candidate reference frame.
As a preferred embodiment, selecting a candidate reference frame as the best reference frame of a certain macroblock may include the following steps: traversing all candidate reference frames according to the time sequence from near to far; and setting a certain threshold value according to a preset variable in motion estimation in the traversing process, and ending the traversing of the candidate reference frame if the calculated preset variable value is smaller than the threshold value, wherein the current candidate reference frame is the optimal reference frame.
As a preferred implementation, the step S232 calculates the reference frame information of the second macroblock according to the candidate reference frame, and specifically includes the following steps:
s2321, sorting the candidate reference frames according to the reference frame information of the corresponding target macro blocks of the candidate reference frames;
step S2322, sequentially traversing the sorted candidate reference frames, and selecting the best reference frame of the second macro block.
There may be multiple target macro blocks of a second macro block, and there may be multiple target macro blocks corresponding to the same best reference frame, so there may be one or more candidate reference frames of the second macro block.
In a preferred embodiment, if there is only one candidate reference frame of the second macro block, i.e. the best reference frame of the first macro block associated with the second macro block is the same, the candidate reference frame of the second macro block is the best reference frame thereof. If the candidate reference frames of the second macro block are multiple, the candidate reference frames can be sorted according to the occurrence frequency of the optimal reference frame of the first macro block associated with the second macro block, the preset variable of the candidate reference frame with the high frequency is calculated preferentially, a certain threshold value is set, if the calculated preset variable value is smaller than the threshold value, traversal of the candidate reference frame is finished, and the current candidate reference frame is the optimal reference frame.
The reference frame selection method provided by the embodiment of the invention further multiplexes the frame type information of the first encoder through the second encoder, so that the second encoder does not need to analyze and calculate the frame type, and the second encoder and the first encoder can ensure that the definitions of the image types of the frames are completely consistent, thereby ensuring the accuracy and stability of the second encoder using the reference frame information of the first encoder.
EXAMPLE III
The embodiment of the invention provides a video transcoding method, which is used for a video transcoding module shown in FIG. 3. The video transcoding module comprises a first encoder and at least one second encoder which are used for processing the same video stream and outputting the video stream respectively.
The video transcoding method specifically adopts the reference frame selection methods provided in the first and second embodiments when the second encoder selects the reference frame.
Other steps of the video transcoding method can be implemented according to the prior art, such as video coding standards of h.264/AVC and HEVC/h.265, and the embodiments of the present invention do not relate to improvements of this portion, and are not described again.
In a preferred embodiment, as shown in fig. 6, the video transcoding module further includes a video decoder for converting the input video stream into data suitable for the first encoder and the second encoder. Correspondingly, the video transcoding method further comprises the following steps:
and decoding the acquired video stream and transmitting the decoded video stream to the first encoder and the second encoder.
In a preferred embodiment, the video transcoding module further includes a video scaling unit for adjusting the resolution of the video data transmitted to the first encoder and the second encoder. Correspondingly, the video transcoding method further comprises the following steps:
and transmitting the decoded video stream to at least one of the first encoder and the second encoder after adjusting the resolution.
Therefore, the first encoder and the second encoder can output videos with different resolutions.
The video transcoding method provided by the embodiment of the invention calculates the reference frame information of the second macro block in the second encoder by using the reference frame information of the target macro block, wherein the target macro block is a first macro block related to the second macro block, and the reference frame information of the target macro block is calculated by the first encoder; because the second encoder and the first encoder process the same video input stream, the second encoder can refer to the reference frame information of the first encoder, reduce the traversal range of the best reference frame, and reduce the evaluation of the second encoder on the reference frame, thereby reducing the calculation amount of video transcoding; and the first encoder and the second encoder can output videos with different code rates.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. With such an understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods according to the embodiments or some parts of the embodiments, such as:
a storage medium storing a computer program that when executed by a processor implements: the reference frame selection method; or steps of the aforementioned video transcoding method.
The invention is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like, as in embodiment four.
Example four
The electronic device shown in fig. 7 comprises a memory 200, a processor 300 and a program stored in the memory 200, the program being configured to be executed by the processor 300, the processor 300 implementing when executing the program: the reference frame selection method; or steps of the aforementioned video transcoding method.
The electronic device in this embodiment and the method in the foregoing embodiment are based on two aspects of the same inventive concept, and the method implementation process has been described in detail in the foregoing, so that those skilled in the art can clearly understand the structure and implementation process of the system in this embodiment according to the foregoing description, and for the sake of brevity of the description, details are not repeated here.
According to the electronic device provided by the embodiment of the invention, the reference frame information of the second macro block in the second encoder is calculated by utilizing the reference frame information of the target macro block, wherein the target macro block is a first macro block related to the second macro block, and the reference frame information of the target macro block is calculated by the first encoder; because the second encoder and the first encoder process the same video input stream, the second encoder can refer to the reference frame information of the first encoder, reduce the traversal range of the best reference frame, and reduce the evaluation of the second encoder on the reference frame, thereby reducing the calculation amount of video transcoding; and the first encoder and the second encoder can output videos with different code rates.
The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.

Claims (7)

1. A reference frame selection method, characterized by: the video transcoding module comprises a first encoder and at least one second encoder which are used for processing the same video stream and respectively output, the first encoder is used for processing a first macro block, the second encoder is used for processing a second macro block, and the first encoder and the second encoder can adopt different code rate control parameters for encoding; the reference frame selection method comprises the following steps:
acquiring reference frame information of a target macro block, wherein the target macro block is a first macro block related to a second macro block, the reference frame information of the target macro block is calculated by a first encoder, and the reference frame information of the target macro block is the corresponding relation between each target macro block and the optimal reference frame of the target macro block;
calculating the reference frame information of the second macro block according to the reference frame information of the target macro block; the reference frame selection method further includes:
the second encoder obtaining frame type information from the first encoder;
the calculating the reference frame information of the second macroblock according to the reference frame information of the target macroblock specifically includes:
acquiring a candidate reference frame of the second macro block according to the frame type information and the reference frame information of the target macro block;
sorting the candidate reference frames according to the reference frame information of the corresponding target macro blocks of the candidate reference frames; and traversing the sorted candidate reference frames in sequence, selecting the best reference frame of the second macro block, wherein the best reference frame is selected according to a preset variable in motion estimation, or the candidate reference frames are sorted according to the occurrence frequency of the best reference frame of the first macro block associated with the second macro block, the preset variable of the candidate reference frame with high frequency is preferentially calculated, and the best reference frame is selected according to the preset variable.
2. The reference frame selection method of claim 1, wherein: the first macro block associated with the second macro block specifically includes: the first macro block is located at the corresponding position of the second macro block, or the first macro block is adjacent to the corresponding position of the second macro block.
3. The video transcoding method is characterized by comprising the following steps: the video transcoding module comprises a first encoder and at least one second encoder which are used for processing the same video stream and respectively outputting the same;
the video transcoding method comprising the reference frame selection method of any of claims 1-2.
4. A method of video transcoding as claimed in claim 3 wherein: the video transcoding method further comprises the following steps:
and decoding the acquired video stream and transmitting the decoded video stream to the first encoder and the second encoder.
5. A method of video transcoding as claimed in claim 3 wherein: the video transcoding method further comprises the following steps:
and transmitting the decoded video stream to at least one of the first encoder and the second encoder after adjusting the resolution.
6. An electronic device, characterized in that: comprising a memory, a processor, and a program stored in the memory, the program configured to be executed by the processor, the processor when executing the program implementing:
a step of a reference frame selection method according to any one of claims 1-2; or
A method of transcoding video according to any of claims 3 to 5.
7. A storage medium storing a computer program, characterized in that: the computer program when executed by a processor implements:
a step of a reference frame selection method according to any one of claims 1-2; or
A method of transcoding video according to any of claims 3 to 4.
CN201810412994.6A 2018-05-03 2018-05-03 Reference frame selection method, video transcoding method, electronic device and storage medium Active CN108401185B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810412994.6A CN108401185B (en) 2018-05-03 2018-05-03 Reference frame selection method, video transcoding method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810412994.6A CN108401185B (en) 2018-05-03 2018-05-03 Reference frame selection method, video transcoding method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN108401185A CN108401185A (en) 2018-08-14
CN108401185B true CN108401185B (en) 2021-10-22

Family

ID=63100908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810412994.6A Active CN108401185B (en) 2018-05-03 2018-05-03 Reference frame selection method, video transcoding method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN108401185B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901591B (en) * 2020-07-28 2023-07-18 有半岛(北京)信息科技有限公司 Method, device, server and storage medium for determining coding mode
CN112070797A (en) * 2020-08-21 2020-12-11 中国科学院计算技术研究所 Target detection method, system, acceleration device, medium and electronic equipment
CN113438486A (en) * 2021-05-11 2021-09-24 中天恒星(上海)科技有限公司 Multi-channel video coding method and coding device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2966865A1 (en) * 2014-07-07 2016-01-13 Renesas Electronics Corporation Picture encoding device, picture decoding device, and picture communication system
CN106231315A (en) * 2016-08-05 2016-12-14 北京数码视讯科技股份有限公司 A kind of video coding system and the method for video coding of this system of application

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2966865A1 (en) * 2014-07-07 2016-01-13 Renesas Electronics Corporation Picture encoding device, picture decoding device, and picture communication system
CN106231315A (en) * 2016-08-05 2016-12-14 北京数码视讯科技股份有限公司 A kind of video coding system and the method for video coding of this system of application

Also Published As

Publication number Publication date
CN108401185A (en) 2018-08-14

Similar Documents

Publication Publication Date Title
US9485515B2 (en) Video coding using reference motion vectors
US9078009B2 (en) Data compression for video utilizing non-translational motion information
CN108833923B (en) Video encoding method, video decoding method, video encoding device, video decoding device, storage medium and computer equipment
US8681873B2 (en) Data compression for video
CN107046645B (en) Image coding and decoding method and device
US9414086B2 (en) Partial frame utilization in video codecs
CN110809887A (en) Motion vector modification for multi-reference prediction
US20110228853A1 (en) Moving image encoding and decoding system
US20150049804A1 (en) Video decoder, video encoder, video decoding method, and video encoding method
US9055302B2 (en) Video encoder and video decoder
CA2727149C (en) Method and device for video encoding using predicted residuals
CN104284197A (en) Video encoder and operation method thereof
CN108848377B (en) Video encoding method, video decoding method, video encoding apparatus, video decoding apparatus, computer device, and storage medium
CN108401185B (en) Reference frame selection method, video transcoding method, electronic device and storage medium
US8396127B1 (en) Segmentation for video coding using predictive benefit
CN113596475A (en) Image/video encoding method, apparatus, system, and computer-readable storage medium
WO2014058796A1 (en) Method and apparatus for video coding using reference motion vectors
US20190028718A1 (en) Video encoding device, video encoding method, video decoding device, and video decoding method
US20140029663A1 (en) Encoding techniques for banding reduction
CN113382249B (en) Image/video encoding method, apparatus, system, and computer-readable storage medium
US8792549B2 (en) Decoder-derived geometric transformations for motion compensated inter prediction
CN113422959A (en) Video encoding and decoding method and device, electronic equipment and storage medium
JP5938424B2 (en) Method for reconstructing and encoding image blocks
USRE47004E1 (en) Moving image coding device and method
US11528485B2 (en) Encoding apparatus and program

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