CN108600757A - Macro block (mb) type determination method, video transcoding method, electronic equipment and storage medium - Google Patents

Macro block (mb) type determination method, video transcoding method, electronic equipment and storage medium Download PDF

Info

Publication number
CN108600757A
CN108600757A CN201810413006.XA CN201810413006A CN108600757A CN 108600757 A CN108600757 A CN 108600757A CN 201810413006 A CN201810413006 A CN 201810413006A CN 108600757 A CN108600757 A CN 108600757A
Authority
CN
China
Prior art keywords
macro block
type
encoder
current
optional
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
CN201810413006.XA
Other languages
Chinese (zh)
Inventor
刘兴强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201810413006.XA priority Critical patent/CN108600757A/en
Publication of CN108600757A publication Critical patent/CN108600757A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • 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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/114Adapting the group of pictures [GOP] structure, e.g. number of B-frames between two anchor frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream

Landscapes

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

Abstract

The invention discloses macro block (mb) type determination method, video transcoding method, electronic equipment and storage mediums, wherein macro block (mb) type determination method is used for video code conversion module, the video code conversion module includes for handling same video flowing, and the first encoder and second encoder exported respectively, first encoder is for handling the first macro block, and the second encoder is for handling the second macro block.This method includes:The macro block (mb) type of target macroblock is obtained, the target macroblock is to be associated with the first macro block of current second macro block, and the macro block (mb) type of the target macroblock is calculated by the first encoder;The optional type set of current second macro block is adjusted according to the macro block (mb) type of the target macroblock;The macro block (mb) type of current second macro block is judged according to the optional type set after adjustment.Macro block (mb) type traversal range is reduced, the calculation amount of video code conversion can be reduced, improve code efficiency, and the first encoder, second encoder can export the video of different code checks.

Description

Macro block (mb) type determination method, video transcoding method, electronic equipment and storage medium
Technical field
The present invention relates to video compression technology more particularly to macro block (mb) type determination method, video transcoding method, electronic equipments And storage medium.
Background technology
H.264/AVC, the video encoding standards such as HEVC/H.265 provide excellent coding efficiency.H.264/AVC it compresses Technology mainly uses following several method and is compressed to video data.
1) intra prediction compresses, and solution is airspace data redundancy issue.
2) inter-prediction compresses, i.e. motion estimation and compensation, and solution is time domain data redundancy issue.
3) correlation spatially is become data unrelated on frequency domain and then carried out by integral discrete cosine transform, i.e. DCT Quantization.
4) CABAC compresses.
H.264/AVC, the video encoding standards such as HEVC/H.265 are block-based motion compensation and discrete cosine transform (DCT) base unit of working frame, coding and decoding video processing is macro block (MB), and the coding process of macro block is related to compiling Numerous Video Key technologies such as determination, reference frame selection, the estimation of pattern.It can be seen that Macroblock Encoding Algorithm is whole There is consequence in a video working frame.
For H.264/AVC, Macroblock Encoding Algorithm basic principle is as shown in Figure 1.Successively in all optional macro blocks In type, each available code pattern is traversed, calculates the number of coded bits under each coding mode (MODE), it is corresponding to rebuild Image fault degree;And calculate Lagrangian value J, i.e. rate distortion cost, by comparing, when selection rate distortion cost minimum Coding mode be macro block final coding mode.
It can be seen that H.264/AVC Macroblock Encoding Algorithm traverses one by one according to macro block (mb) type, but it is in fact each macro The type of coding of block is finally only a kind of.Therefore, the complexity of algorithm is that ergodic process increases movement under various modes and estimates The time of the processing such as meter, intra prediction, coding.Enter to have more the trans-coding system of scene especially for one, multichannel transcoding task is equal It needs in all optional macro block (mb) types, traverses each available coding mode, macro block (mb) type judgement needs to occupy prodigious Computing resource spends the more time, thus the efficiency of Video coding is relatively low.
Invention content
For overcome the deficiencies in the prior art, one of the objects of the present invention is to provide macro block (mb) type determination method, energy It solves existing macro block (mb) type judgement to need to occupy prodigious computing resource, spends more time, thus the effect of Video coding The relatively low problem of rate.
The second object of the present invention is to provide video transcoding method, can solve existing macro block (mb) type judgement and need to account for With prodigious computing resource, the more time is spent, thus the relatively low problem of efficiency of Video coding.
The third object of the present invention is to provide electronic equipment, can solve existing macro block (mb) type judgement and need to occupy very Big computing resource spends the more time, thus the relatively low problem of efficiency of Video coding.
The fourth object of the present invention is to provide storage medium, is stored with computer program, can solve existing macro block Type decision needs to occupy prodigious computing resource, spends the more time, thus the relatively low problem of efficiency of Video coding.
An object of the present invention is realized using following technical scheme:
Macro block (mb) type determination method is used for video code conversion module, and the video code conversion module includes for handling same regard Frequency flows, and the first encoder exported respectively and at least one second encoder, and first encoder is macro for handling first Block, the second encoder is for handling the second macro block;
The macro block (mb) type determination method includes the following steps:
The macro block (mb) type of target macroblock is obtained, the target macroblock is to be associated with the first macro block of current second macro block, institute The macro block (mb) type for stating target macroblock is calculated by the first encoder;
The optional type set of current second macro block is adjusted according to the macro block (mb) type of the target macroblock;
The macro block (mb) type of current second macro block is judged according to the optional type set after adjustment.
Further, the optional type set includes the first kind, the macro block (mb) type according to the target macroblock The optional type set of current second macro block is adjusted, is included the following steps:
If the macro block (mb) type of the target macroblock is the first kind, the optional type set after adjustment only includes The first kind;
The optional type set according to after adjustment judges the macro block (mb) type of current second macro block, specially:It is described to work as The macro block (mb) type of preceding second macro block is the first kind.
Further, the optional type set includes Second Type, the macro block (mb) type according to the target macroblock The optional type set of current second macro block is adjusted, is included the following steps:
If the macro block (mb) type of the target macroblock is not the Second Type, the optional type set after adjustment is not wrapped Containing the Second Type.
Further, the optional type set includes intra prediction subset;
The macro block (mb) type according to the target macroblock is adjusted the optional type set of current second macro block, packet Include following steps:
If current second macro block is located at P frames or B frames, and the target macroblock is not I macro blocks, then can described in deletion Select the intra prediction subset in type set.
Further, first macro block for being associated with the second macro block, specially:Positioned at second macro block corresponding position The first macro block, or be adjacent to the first macro block of second macro block corresponding position.
Further, the current second macro block corresponding position is specially the position according to current second macro block, with And the calculating of the video scale information of second encoder and the first encoder.
Further, the optional type set includes third type and the 4th type, described according to the target macroblock Macro block (mb) type the optional type set of current second macro block is adjusted, include the following steps:
If the macro block (mb) type of first macro block positioned at second macro block corresponding position is the third type, adjust Optional type set after whole does not include the 4th type.
Further, the third type is 8 × 16 types, and the 4th type is 16 × 8 types;Or
The third type is 16 × 8 types, and the 4th type is 8 × 16 types.
Further, further comprising the steps of before the macro block (mb) type for obtaining target macroblock:
Second encoder obtains frame type information from the first encoder.
Further, the video code conversion module further includes set adjustment unit, the macro block class for obtaining target macroblock Type specifically includes following steps:
The set adjustment unit obtains the position of current second macro block from second encoder;
The set adjustment unit calculates current second macro block corresponding position according to the position of current second macro block;
The set adjustment unit obtains the target macroblock according to current second macro block corresponding position from the first encoder Macro block (mb) type.
Further, the macro block (mb) type according to the target macroblock to the optional type set of current second macro block into Row adjustment, specially:The set adjustment unit is according to the macro block (mb) type of the target macroblock to the optional of current second macro block Type set is adjusted;
The optional type set according to after adjustment judges the macro block (mb) type of current second macro block, specially:Described Two encoders judge the macro block (mb) type of current second macro block according to the optional type set after adjustment.
The second object of the present invention is realized using following technical scheme:
Video transcoding method, be used for video code conversion module, the video code conversion module include for handling same video flowing, And the first encoder exported respectively and at least one second encoder;
The video transcoding method includes the step of the macro block (mb) type determination method as described in any one of claim 1-10 Suddenly.
Further, the video transcoding method is further comprising the steps of:
First encoder and second encoder will be transmitted to after the decoding video stream of acquisition.
Further, the video transcoding method is further comprising the steps of:
At least one in first encoder, second encoder will be transmitted to after decoded video flowing adjustment resolution ratio A, the video flowing for being input to first encoder and second encoder has different resolution ratio.
The third object of the present invention is realized using following technical scheme:
Electronic equipment, including memory, processor and program stored in memory, described program be configured to by Processor executes, and processor is realized when executing described program:
The step of above-mentioned macro block (mb) type determination method;Or
The step of above-mentioned video transcoding method.
The fourth object of the present invention is realized using following technical scheme:
Storage medium, the storage medium are stored with computer program, real when the computer program is executed by processor It is existing:
The step of above-mentioned macro block (mb) type determination method;Or
The step of above-mentioned video transcoding method.
Compared with prior art, the beneficial effects of the present invention are:By using the macro block (mb) type of target macroblock, target macroblock To be associated with the first macro block of the second macro block, the macro block (mb) type of the second macro block in second encoder, the macro block of target macroblock are judged Type is calculated by the first encoder;Since second encoder and the same video input stream of the first coder processes, second are compiled The coding mode of a certain macro block can refer to the coding mode of respective macroblock in the first encoder in code device, to current second macro block Optional type set be adjusted, to reduce macro block (mb) type traverse range, the calculation amount of video code conversion can be reduced, carried High coding efficiency, and the first encoder, second encoder can export the video of different code checks.
Description of the drawings
Fig. 1 is Macroblock Encoding Algorithm principle schematic;
Fig. 2 is the flow diagram of the macro block (mb) type determination method of the embodiment of the present invention one;
Fig. 3 is the structural schematic diagram of the video code conversion module of embodiment one;
Fig. 4 is associated with the schematic diagram of the first macro block of the second macro block;
The schematic diagram of macro-block partition mode when Fig. 5 is inter-prediction;
Fig. 6 is the flow diagram of the macro block (mb) type determination method of the embodiment of the present invention two;
Fig. 7 is the structural schematic diagram of the video code conversion module of the embodiment of the present invention three;
Fig. 8 is the structural schematic diagram of the electronic equipment of the embodiment of the present invention four.
Specific implementation mode
In the following, in conjunction with attached drawing and specific implementation mode, the present invention is described further, it should be noted that not Under the premise of conflicting, new implementation can be formed between various embodiments described below or between each technical characteristic in any combination Example.
Embodiment one
Such as the flow diagram that Fig. 2 is macro block (mb) type determination method, it is suitable for video code conversion module as shown in Figure 3.It should Video code conversion module includes and the first encoder for exporting respectively and at least one second coding for handling same video flowing Device.First encoder and each second encoder carry out compressed encoding to the same input video stream;First encoder, second Different code check control parameters may be used in encoder, so as to export the video flowing of different quality, such as outputting video streams 1- Video flowing 3.
Macro block is the main bearer of video information, and a coded image is typically divided into multiple macro block compositions, macro block packet Contain brightness and the chrominance information of each pixel.In h .264, macro block is in picture frame 16 × 16 pixel region, is fortune The basic operation unit of dynamic compensation.In H.265, the size of macro block is extended to 64 × 64 from 16 × 16 H.264, so as to In the compression of high-resolution video.The embodiment of the present invention by standard H.264 for illustrate, the present invention cannot be limited with this The range of protection.Record according to the present invention, those skilled in the art, which are not required to make the creative labor, to implement the present invention Example method, step be applied to H.265 in 64 × 64 macro blocks.
For ease of understanding, the macro block during the first coder processes input video stream is known as the first macro block;By second Macro block during coder processes input video stream is known as the second macro block.
The macro block (mb) type determination method of the present embodiment includes the following steps:
Step S110, the macro block (mb) type of target macroblock is obtained, the target macroblock is be associated with current second macro block the One macro block, the macro block (mb) type of the target macroblock are calculated by the first encoder.
As preferred embodiment, the first encoder independently carries out the coding to input video stream, including percent of pass loses True expense carries out the step of forced coding pattern judges, the forced coding pattern packet of the first macro block to comparing each first macro block Include the macro block (mb) type of the first macro block.
Second encoder is when handling a certain second macro block, it is also desirable to judge the corresponding forced coding mould of second macro block Formula includes the macro block (mb) type of the second macro block.It, can due to second encoder and the same input video stream of the first coder processes To provide reference using the judgement of macro block type information pair the second macro block macro block (mb) type of the first macro block.
As preferred embodiment, target macroblock is associated with the first macro block of the second macro block, specially:Positioned at institute The first macro block of the second macro block corresponding position is stated, or is adjacent to the first macro block of second macro block corresponding position.
As shown in figure 4, the first macro block for being associated with the second macro block 10 may include being located at 10 corresponding position of the second macro block 20 the first macro block 21.
As preferred embodiment, the current second macro block corresponding position is specially according to current second macro block Position and the video scale information of second encoder and the first encoder calculate.Second encoder and first is compiled Code device can handle different resolution, the ratio of width to height same video flowing, second encoder can be obtained according to resolution ratio, the ratio of width to height With the video scale information of the first encoder, and then the position relationship of the second macro block 10 and a certain first macro block 21 is obtained. It can be found according to the high scale information of the width of macro block by the coordinate of the second macro block 10 corresponding position 20 of second macro block 10 The macro block of second corresponding position 20 in the first encoder of macro block 10, i.e. the first macro block 21.
Since the coding mode of adjoining macro block can mutually provide reference, such as when the neighbouring macro block of a certain macro block is certain When one type, it is the macro block of the type that the macro block itself, which also has very maximum probability, can be the same resolution decreasing or drop code check, Therefore it is associated with the first macro block of the second macro block, i.e., target macroblock, which can also be, is adjacent to second macro block, 10 corresponding position 20 The first macro block 22.
In the present embodiment, the first macro block 22 for being adjacent to second macro block, 10 corresponding position 20 is specially positioned at described First macro block 22 in the upper, lower, left, or right direction of the first macro block 21 of 10 corresponding position 20 of the second macro block, in another embodiment In, the first macro block 22 for being adjacent to second macro block, 10 corresponding position 20 can also be positioned at 10 corresponding positions of the second macro block The first macro block (figure is not noted) for setting 20 21 oblique angle direction of the first macro block, can also be positioned at 10 corresponding position of the second macro block First macro block (not shown) of 20 21 the second circle of periphery of the first macro block.
According to target macroblock, that is, it is associated with the first macro block of the second macro block, so that it may to obtain the macro block (mb) type of target macroblock.
Step S120, the optional type set of current second macro block is adjusted according to the macro block (mb) type of the target macroblock It is whole.
Due to second encoder and the same input video stream of the first coder processes, each frame image in second encoder is equal The a certain frame image in the first encoder is can correspond to, therefore the coding mode of a certain macro block can refer in second encoder The coding mode of respective macroblock in first encoder.If a certain second macro block phase in the first encoder in this second encoder It is 16 × 16 types to answer the macro block (mb) type of macro block, then can directly determine that the macro block (mb) type of second macro block is also 16 × 16 classes Type.If the target macroblock number that macro block (mb) type is 4 × 4 is less than preset quantity or is zero, the macro block of second macro block Type may be nor 4 × 4 types.
(Intra) predictive coding and interframe (Inter) predictive coding are broadly divided into frame to the coding of each macro block.
The basic principle of intraframe predictive coding is realized to present encoding block using the contiguous block pixel of own decoding and reconstituting Prediction, then the residual error of prediction block and actual block is converted, is quantified and closely related coding.In the h .264 standard, intra prediction Coding mode shares three classes:For the Intra 4 × 4 of 4 × 4 brightness block codings, there are 9 kinds of prediction modes, since block size is smaller, It is suitable for the abundant region of image detail;For the Intra 16 × 16 of 16 × 16 luminance macroblocks coding, there are 4 kinds of prediction modes, The flat site being suitable in image;And the Intra 8 × 8 for 8 × 8 coloration block codings.
Inter-prediction is the prediction mode based on block motion compensation using video frame/field of oneself coding reconstruct.H.264/ In AVC estimations, one 16 × 16 coded macroblocks can be divided into different sub-blocks, form the block size of 7 kinds of different modes, As shown in Figure 5.It is 16 × 16,16 × 8,8 × 16,8 × 8,8 × 4,4 × 8,4 that wherein pattern a-g, which corresponds respectively to macro block (mb) type, × 4 macro block.
Input video stream can be divided into intracoded frame, forward-predictive-coded frames and double by the first encoder, second encoder To encoded predicted frame, i.e. I frames, P frames and B frames.I frames only include I macro blocks, P frames include P macro blocks and I macro blocks, B frames include B macro blocks and I macro blocks;First macro block, the second macro block can be I macro blocks, P macro blocks, B macro blocks, and I macro blocks can only utilize decoded in current slice Pixel is used as with reference to progress intra prediction;P macro blocks can be used as using the decoded image in front and be carried out in frame in advance with reference to image It surveys;B macro blocks are then to carry out intra prediction using sagittal reference picture.
Therefore, the macro block (mb) type of I macro blocks can be 16 × 16,8 × 8 or 4 × 4, i.e., if current second macro block is in I frames Macro block, or be the I macro blocks in P frames or B frames, then the optional set of types of current second macro block be combined into 16 × 16,8 × 8,4 × 4 }.P macro blocks, B macro blocks macro block (mb) type can be 16 × 16,16 × 8,8 × 16,8 × 8,8 × 4,4 × 8,4 × 4, i.e., It is combined into if current second macro block is P frames or the P macro blocks in B frames or B macro blocks, the optional set of types of current second macro block { 16 × 16,16 × 8,8 × 16,8 × 8,8 × 4,4 × 8,4 × 4 }.
As preferred embodiment, when to the macroblock codings of I frames, need by traversing all possible intraframe coding Modal sets look for that a kind of conduct forced coding pattern that rate distortion cost is minimum;And for the macro block of P frames or B frames, then it needs to traverse Intra prediction mode and inter-frame forecast mode.For P frames or B frames, it is I macro blocks or P macro blocks or B not know current second macro block Macro block, thus the optional type set of current second macro block include intra prediction subset Intra 16 × 16, Intra 8 × 8, Intra 4 × 4 } and inter-prediction subset Inter16 × 16, Inter 16 × 8, Inter 8 × 16, Inter 8 × 8, Inter 8 × 4, Inter 4 × 8, Inter 4 × 4 } in each element.
As preferred embodiment, step S120 is according to the macro block (mb) type of the target macroblock to current second macro block Optional type set is adjusted, and is included the following steps:
If the macro block (mb) type of the target macroblock is the first kind, the optional type set after adjustment only includes first Type.Therefore, current second macro block can directly be judged to being encoded with the first kind in subsequent step, to reduce Computation complexity improves code efficiency.
Wherein, the first kind is some optional type in the optional type set of current second macro block, is not specified Specially which.
For example, if the macro block (mb) type of all target macroblocks is all 16 × 16 types, the optional set of types after adjustment Close only includes 16 × 16 types;If the macro block (mb) type of target macroblock is 16 × 8 types, the optional set of types after adjustment Close only includes 16 × 8 types.
As preferred embodiment, step S120 is according to the macro block (mb) type of the target macroblock to current second macro block Optional type set is adjusted, and is included the following steps:
If the macro block (mb) type of the target macroblock is not Second Type, the optional type set after adjustment does not include the Two types.Therefore, the optional type of current second macro block can exclude the Second Type, and the optional type set after adjustment is not wrapped Containing the Second Type, subsequently there is no need to be calculated the Second Type to judge whether it corresponds to forced coding pattern, from And macro block (mb) type traversal range is reduced, computation complexity is reduced, code efficiency is improved.
Wherein, Second Type is some optional type in the optional type set of current second macro block, is not specified Specially which.
For example, if the macro block (mb) type of all target macroblocks is not 16 × 16 types, just leave out optional set of types 16 × 16 types in conjunction, the optional type set after adjustment do not include 16 × 16 types;If the macro block (mb) type of target macroblock It is not 4 × 4 types, then just leaving out 4 × 4 types in optional type set, the optional type set after adjustment does not include 4 × 4 types.
As preferred embodiment, step S120 is according to the macro block (mb) type of the target macroblock to current second macro block Optional type set is adjusted, and is included the following steps:
If current second macro block is located at P frames or B frames, and the target macroblock is not I macro blocks, then can described in deletion Select the intra prediction subset in type set.
If current second macro block is located at P frames or B frames, current second macro block may as P macro blocks or B macro blocks, May also rate distortion cost is minimum when as I macro blocks, forced coding pattern can be obtained.At this point it is possible to reference to the first coding The coding mode of respective macroblock in device is adjusted the optional type set of current second macro block.If target macroblock is not It is I macro block (mb) types, then current second macro block need not carry out I macro block assessments to current second macro block long, can deletes optional Intra prediction subset in type set, i.e. { Intra 16 × 16, Intra 8 × 8, Intra 4 × 4 } retain inter-prediction Subset Inter 16 × 16, Inter 16 × 8, Inter 8 × 16, Inter 8 × 8, Inter 8 × 4, Inter 4 × 8, Inter 4 × 4 } in each element, to reduce macro block (mb) type traverse range, reduce computation complexity, improve coding Efficiency.
As preferred embodiment, step S120 is according to the macro block (mb) type of the target macroblock to current second macro block Optional type set is adjusted, and is included the following steps:
If the macro block (mb) type of first macro block positioned at second macro block corresponding position is third type, after adjustment Optional type set do not include the 4th type.
Wherein, third type and the 4th type are two difference optional classes in the optional type set of current second macro block Type.
There are correlation, especially length and width are unequal for the division of second encoder, the first encoder to a certain position macro block Type.As preferred embodiment, the third type is 8 × 16 types, and the 4th type is 16 × 8 types;Or Third type described in person is 16 × 8 types, and the 4th type is 8 × 16 types.If being located at the second macro block corresponding positions The first macro block set is judged as 8 × 16 types, then current second macro block will not be judged to be broken into 16 × 8 types substantially, then The optional type of current second macro block can exclude the 4th type, i.e. 16 × 8 types, and the optional type set after adjustment is not wrapped Containing the 4th type, subsequently there is no need to be calculated the 4th type to judge whether it corresponds to forced coding pattern, from And macro block (mb) type traversal range is reduced, computation complexity is reduced, code efficiency is improved.
Step S130, the macro block (mb) type of current second macro block is judged according to the optional type set after adjustment.
If including only some type in the optional type set after adjustment, the macro block (mb) type of such as target macroblock is equal For the first kind, then the optional type set after adjusting only includes the first kind, then can be directly with the type As the macro block (mb) type of current second macro block, the forced coding pattern for judging the macro block (mb) type is subsequently only needed;If after adjustment Optional type set in include multiple types, then calculate separately all types of corresponding available code patterns rate distortion open Pin, selects macro block (mb) type of the corresponding type of minimum rate distortion cost as current second macro block, while can obtain optimal encoding Pattern.
Macro block (mb) type determination method provided in an embodiment of the present invention, by using the macro block (mb) type of target macroblock, target macro Block is the first macro block for being associated with the second macro block, judge second encoder in the second macro block macro block (mb) type, target macroblock it is macro Block type is calculated by the first encoder;Due to second encoder and the same video input stream of the first coder processes, second The coding mode of a certain macro block can refer to the coding mode of respective macroblock in the first encoder in encoder, macro to current second The optional type set of block is adjusted, and is traversed range to reduce macro block (mb) type, can be reduced the calculation amount of video code conversion, Code efficiency is improved, and the first encoder, second encoder can export the video of different code checks.
Embodiment two
Macro block (mb) type determination method as shown in FIG. 6, includes the following steps:
Step S210, second encoder obtains frame type information from the first encoder.
First encoder carry out input video stream coding when, can calculate picture group (Group of Pictures, GOP) structure, picture group structure can embody the type of each frame, i.e. frame type information.Second encoder can be multiplexed from first and compile The frame type information that code device obtains, to which second encoder need not carry out analysis calculating to frame type;And it can ensure Two encoders, the first encoder are completely the same to the definition of each frame image type, to ensure second encoder using the first coding The Stability and veracity of device macro block type information.
In another embodiment, can picture group structure be calculated by second encoder, can also realizes second encoder pair the The utilization of one encoder macro block type information, only stability is slightly poor, and computational requirements are larger.
Step S220, the macro block (mb) type of target macroblock is obtained, the target macroblock is be associated with current second macro block the One macro block, the macro block (mb) type of the target macroblock are calculated by the first encoder.
As preferred embodiment, in the present embodiment, the video code conversion module further includes set adjustment unit (figure Do not show), step S220 obtains the macro block (mb) type of target macroblock, specifically includes following steps:
Step S221, the described set adjustment unit obtains the position of current second macro block from second encoder.
Step S222, the described set adjustment unit calculates current second macro block corresponding positions according to the position of current second macro block It sets.
Step S223, the described set adjustment unit is according to current second macro block corresponding position from described in the acquisition of the first encoder The macro block (mb) type of target macroblock.
The first macro block corresponding with current second macro block, i.e. target macroblock are found by the specific implementation of set adjustment unit, And the macro block (mb) type of target macroblock is inquired from the first encoder.
Step S230, the optional type set of current second macro block is adjusted according to the macro block (mb) type of the target macroblock It is whole.
As preferred embodiment, step S230 is according to the macro block (mb) type of the target macroblock to current second macro block Optional type set is adjusted, specially:The set adjustment unit is according to the macro block (mb) type of the target macroblock to current The optional type set of second macro block is adjusted.
The judgement to the optional type of current second macro block is realized by set adjustment unit;In addition gather adjustment unit also It needs the optional type set after adjustment being sent to second encoder.
Step S240, the macro block (mb) type of current second macro block is judged according to the optional type set after adjustment.
As preferred embodiment, step S240 judges current second macro block according to the optional type set after adjustment Macro block (mb) type, specially:The second encoder judges the macro block of current second macro block according to the optional type set after adjustment Type.
If including only some type in the optional type set after adjustment, the macro block (mb) type of such as target macroblock is equal For the first kind, then the optional type set after adjusting only includes the first kind, then can be directly with the type Macro block (mb) type as current second macro block;If including multiple types in the optional type set after adjustment, count respectively The rate distortion cost for calculating all types of corresponding available code patterns selects the corresponding type of minimum rate distortion cost as current The macro block (mb) type of two macro blocks.
Macro block (mb) type determination method provided in an embodiment of the present invention is further multiplexed the first encoder by second encoder Frame type information so that second encoder need not carry out frame type analysis calculating, and can ensure second encoder, First encoder is completely the same to the definition of each frame image type, to ensure that second encoder utilizes the first encoder macro block (mb) type The Stability and veracity of information.In addition also by by the positioning of target macroblock and the acquisition of the macro block (mb) type of target macroblock, with And give the set adjustment unit except encoder to tasks such as the judgements of optional type of current second macro block and realize, Ke Yigeng The parallel processing capability for adequately utilizing video code conversion module, increases code efficiency.
Embodiment three
An embodiment of the present invention provides video transcoding methods, are used for video code conversion module as shown in Figure 3.The video code conversion Module includes and the first encoder exported respectively and at least one second encoder for handling same video flowing.
Video transcoding method is specially when second encoder carries out macro block (mb) type judgement using embodiment one, embodiment two The macro block (mb) type determination method of offer.
Such as H.264/AVC and HEVC/H.265 is regarded other steps of video transcoding method can be according to the prior art, Frequency coding standard realizes that the embodiment of the present invention is not related to the improvement to the part, repeats no more.
As preferred embodiment, as shown in fig. 7, video code conversion module further includes Video Decoder, for that will input Video flowing is converted to the data suitable for the first encoder, second encoder.Correspondingly, video transcoding method further includes following step Suddenly:
First encoder and second encoder will be transmitted to after the decoding video stream of acquisition.
As preferred embodiment, video code conversion module further includes video scaling unit, and first is transmitted to for adjusting Encoder, second encoder video data resolution ratio.Correspondingly, video transcoding method is further comprising the steps of:
At least one in first encoder, second encoder will be transmitted to after decoded video flowing adjustment resolution ratio It is a.
It is appreciated that the first encoder and second encoder are transmitted to after can decoded video flowing being adjusted resolution ratio In one of or it is multiple, can also decoded video flowing directly be handled by the first encoder or second encoder. I.e., it is possible to be transmitted separately to the first encoder and second encoder after decoded video flowing is adjusted by different resolution In.Therefore the first encoder, second encoder can export the video of different resolution.
Video transcoding method provided in an embodiment of the present invention, by using the macro block (mb) type of target macroblock, target macroblock is It is associated with the first macro block of the second macro block, judges the macro block (mb) type of the second macro block in second encoder, the macro block class of target macroblock Type is calculated by the first encoder;Due to second encoder and the same video input stream of the first coder processes, the second coding The coding mode of a certain macro block can refer to the coding mode of respective macroblock in the first encoder in device, to current second macro block Optional type set is adjusted, and is traversed range to reduce macro block (mb) type, can be reduced the calculation amount of video code conversion, improve Code efficiency, and the first encoder, second encoder can export the video of different code checks.
As seen through the above description of the embodiments, those skilled in the art can be understood that the present invention can It is realized by the mode of software plus required general hardware platform.Based on this understanding, technical scheme of the present invention essence On in other words the part that contributes to existing technology can be expressed in the form of software products, the computer software product It can be stored in a storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are used so that a computer equipment (can be personal computer, server either network equipment etc.) executes the certain of each embodiment of the present invention or embodiment Method described in part, such as:
Storage medium, the storage medium are stored with computer program, real when the computer program is executed by processor It is existing:
The step of aforementioned macro block (mb) type determination method;Or
The step of aforementioned video code-transferring method.
The present invention can be used in numerous general or special purpose computing system environments or configuration.Such as:Personal computer, service Device computer, handheld device or portable device, laptop device, multicomputer system, microprocessor-based system, machine top Box, programmable consumer-elcetronics devices, network PC, minicomputer, mainframe computer including any of the above system or equipment Distributed computing environment etc., such as example IV.
Example IV
Electronic equipment as shown in Figure 8, including memory 200, processor 300 and the journey being stored in memory 200 Sequence, described program are configured to be executed by processor 300, and processor 300 is realized when executing described program:
The step of aforementioned macro block (mb) type determination method;Or
The step of aforementioned video code-transferring method.
The method in electronic equipment and previous embodiment in the present embodiment is based on two sides under same inventive concept Face is in front described in detail method implementation process, so those skilled in the art can be clear according to foregoing description Understand to Chu the structure and implementation process of the system in this implementation, in order to illustrate the succinct of book, details are not described herein again.
Electronic equipment provided in an embodiment of the present invention, by using the macro block (mb) type of target macroblock, target macroblock is association In the first macro block of the second macro block, judge that the macro block (mb) type of the second macro block in second encoder, the macro block (mb) type of target macroblock are It is calculated by the first encoder;Due to second encoder and the same video input stream of the first coder processes, in second encoder The coding mode of a certain macro block can refer to the coding mode of respective macroblock in the first encoder, to the optional of current second macro block Type set is adjusted, and is traversed range to reduce macro block (mb) type, can be reduced the calculation amount of video code conversion, improve coding Efficiency, and the first encoder, second encoder can export the video of different code checks.
" first ", " second " and " third " that various embodiments of the present invention are related to is only used for distinguishing different macro blocks, macro block (mb) type, Do not have differentiation sequential action.
The above embodiment is only the preferred embodiment of the present invention, and the scope of protection of the present invention is not limited thereto, The variation and replacement for any unsubstantiality that those skilled in the art is done on the basis of the present invention belong to institute of the present invention Claimed range.

Claims (16)

1. macro block (mb) type determination method, which is characterized in that be used for video code conversion module, the video code conversion module includes for locating Same video flowing is managed, and the first encoder exported respectively and at least one second encoder, first encoder is for locating The first macro block is managed, the second encoder is for handling the second macro block;
The macro block (mb) type determination method includes the following steps:
The macro block (mb) type of target macroblock is obtained, the target macroblock is to be associated with the first macro block of current second macro block, the mesh The macro block (mb) type for marking macro block is calculated by the first encoder;
The optional type set of current second macro block is adjusted according to the macro block (mb) type of the target macroblock;
The macro block (mb) type of current second macro block is judged according to the optional type set after adjustment.
2. macro block (mb) type determination method as described in claim 1, it is characterised in that:The optional type set includes the first kind Type, the macro block (mb) type according to the target macroblock are adjusted the optional type set of current second macro block, including with Lower step:
If the macro block (mb) type of the target macroblock is the first kind, the optional type set after adjustment only includes described The first kind;
The optional type set according to after adjustment judges the macro block (mb) type of current second macro block, specially:Described current The macro block (mb) type of two macro blocks is the first kind.
3. macro block (mb) type determination method as described in claim 1, it is characterised in that:The optional type set includes the second class Type, the macro block (mb) type according to the target macroblock are adjusted the optional type set of current second macro block, including with Lower step:
If the macro block (mb) type of the target macroblock is not the Second Type, the optional type set after adjustment does not include institute State Second Type.
4. the macro block (mb) type determination method stated such as claim 1, it is characterised in that:The optional type set includes intra prediction Subset;
The macro block (mb) type according to the target macroblock is adjusted the optional type set of current second macro block, including with Lower step:
If current second macro block is located at P frames or B frames, and the target macroblock is not I macro blocks, then deletes the optional class Intra prediction subset in type set.
5. macro block (mb) type determination method according to any one of claims 1-4, it is characterised in that:It is described to be associated with the second macro block The first macro block, specially:The first macro block positioned at second macro block corresponding position, or to be adjacent to second macro block corresponding First macro block of position.
6. the macro block (mb) type determination method stated such as claim 5, it is characterised in that:The current second macro block corresponding position is specific For according to the position of current second macro block and the calculating of the video scale information of second encoder and the first encoder 's.
7. the macro block (mb) type determination method stated such as claim 5, it is characterised in that:The optional type set includes third type With the 4th type, the macro block (mb) type according to the target macroblock adjusts the optional type set of current second macro block It is whole, include the following steps:
If the macro block (mb) type of first macro block positioned at second macro block corresponding position is the third type, after adjustment Optional type set do not include the 4th type.
8. the macro block (mb) type determination method stated such as claim 7, it is characterised in that:The third type is 8 × 16 types, described 4th type is 16 × 8 types;Or
The third type is 16 × 8 types, and the 4th type is 8 × 16 types.
9. macro block (mb) type determination method according to any one of claims 1-4, it is characterised in that:The acquisition target macroblock It is further comprising the steps of before macro block (mb) type:
Second encoder obtains frame type information from the first encoder.
10. macro block (mb) type determination method according to any one of claims 1-4, it is characterised in that:The video code conversion module Further include set adjustment unit, the macro block (mb) type for obtaining target macroblock specifically includes following steps:
The set adjustment unit obtains the position of current second macro block from second encoder;
The set adjustment unit calculates current second macro block corresponding position according to the position of current second macro block;
The set adjustment unit obtains the macro of the target macroblock according to current second macro block corresponding position from the first encoder Block type.
11. macro block (mb) type determination method as claimed in claim 10, it is characterised in that:It is described according to the macro of the target macroblock Block type is adjusted the optional type set of current second macro block, specially:The set adjustment unit is according to the mesh The macro block (mb) type of mark macro block is adjusted the optional type set of current second macro block;
The optional type set according to after adjustment judges the macro block (mb) type of current second macro block, specially:Described second compiles Code device judges the macro block (mb) type of current second macro block according to the optional type set after adjustment.
12. video transcoding method, it is characterised in that:For video code conversion module, the video code conversion module includes for handling Same video flowing, and the first encoder exported respectively and at least one second encoder;
The video transcoding method includes the steps that the macro block (mb) type determination method as described in any one of claim 1-10.
13. video transcoding method as claimed in claim 12, it is characterised in that:The video transcoding method further includes following step Suddenly:
First encoder and second encoder will be transmitted to after the decoding video stream of acquisition.
14. video transcoding method as claimed in claim 12, it is characterised in that:The video transcoding method further includes following step Suddenly:
It is transmitted at least one of first encoder, second encoder after decoded video flowing is adjusted resolution ratio, The video flowing for being input to first encoder and second encoder has different resolution ratio.
15. electronic equipment, it is characterised in that:Including memory, processor and program stored in memory, described program It is configured to be executed by processor, processor is realized when executing described program:
The step of macro block (mb) type determination method as described in any one of claim 1-11;Or
The step of video transcoding method as described in any one of claim 12-14.
16. storage medium, the storage medium is stored with computer program, it is characterised in that:The computer program is handled Device is realized when executing:
The step of macro block (mb) type determination method as described in any one of claim 1-11;Or
The step of video transcoding method as described in any one of claim 12-14.
CN201810413006.XA 2018-05-03 2018-05-03 Macro block (mb) type determination method, video transcoding method, electronic equipment and storage medium Pending CN108600757A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810413006.XA CN108600757A (en) 2018-05-03 2018-05-03 Macro block (mb) type determination method, video transcoding method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810413006.XA CN108600757A (en) 2018-05-03 2018-05-03 Macro block (mb) type determination method, video transcoding method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN108600757A true CN108600757A (en) 2018-09-28

Family

ID=63620770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810413006.XA Pending CN108600757A (en) 2018-05-03 2018-05-03 Macro block (mb) type determination method, video transcoding method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108600757A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971903A (en) * 2019-10-17 2020-04-07 西安万像电子科技有限公司 Coding method, device and system
CN113014926A (en) * 2021-04-30 2021-06-22 北京汇钧科技有限公司 Video transcoding method and device, electronic equipment and storage medium
CN113438486A (en) * 2021-05-11 2021-09-24 中天恒星(上海)科技有限公司 Multi-channel video coding method and coding device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475880A (en) * 2013-09-11 2013-12-25 浙江大学 Method for low-complexity video transcoding from H.264 to HEVC based on statistic analysis
CN103546751A (en) * 2012-07-10 2014-01-29 美国博通公司 Video coding method and system
CN104104948A (en) * 2013-04-15 2014-10-15 富士通株式会社 Video transcoding method and video transcoder
CN106162174A (en) * 2016-08-31 2016-11-23 北京奇艺世纪科技有限公司 A kind of video multi-resolution encoding method and apparatus
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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546751A (en) * 2012-07-10 2014-01-29 美国博通公司 Video coding method and system
CN104104948A (en) * 2013-04-15 2014-10-15 富士通株式会社 Video transcoding method and video transcoder
CN103475880A (en) * 2013-09-11 2013-12-25 浙江大学 Method for low-complexity video transcoding from H.264 to HEVC based on statistic analysis
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
CN106162174A (en) * 2016-08-31 2016-11-23 北京奇艺世纪科技有限公司 A kind of video multi-resolution encoding method and apparatus

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971903A (en) * 2019-10-17 2020-04-07 西安万像电子科技有限公司 Coding method, device and system
CN113014926A (en) * 2021-04-30 2021-06-22 北京汇钧科技有限公司 Video transcoding method and device, electronic equipment and storage medium
WO2022228104A1 (en) * 2021-04-30 2022-11-03 北京汇钧科技有限公司 Video transcoding method and apparatus, and electronic device and storage medium
CN113014926B (en) * 2021-04-30 2023-04-07 北京汇钧科技有限公司 Video transcoding method and device, electronic equipment and storage medium
CN113438486A (en) * 2021-05-11 2021-09-24 中天恒星(上海)科技有限公司 Multi-channel video coding method and coding device

Similar Documents

Publication Publication Date Title
JP6625680B2 (en) Video encoding method and apparatus, and decoding method and apparatus
CN100586184C (en) Infra-frame prediction method
CN102484719B (en) Method and apparatus for encoding video, and method and apparatus for decoding video
CN104796693A (en) Rapid HEVC CU deep partition coding method
CN101729891B (en) Method for encoding multi-view depth video
CN103548356B (en) Picture decoding method using dancing mode and the device using this method
CN106170092A (en) Fast encoding method for lossless coding
CN104429062A (en) Apparatus for coding a bit stream representing a three-dimensional video
CN108600757A (en) Macro block (mb) type determination method, video transcoding method, electronic equipment and storage medium
CN103118262B (en) Rate distortion optimization method and device, and video coding method and system
CN105681797B (en) A kind of DVC-HEVC video transcoding methods based on prediction residual
CN111669589B (en) Image encoding method, image encoding device, computer device, and storage medium
CN105898332B (en) For the fast deep figure frame mode decision method of 3D-HEVC coding standards
CN106657998B (en) A kind of KVM Video coding quantization parameter range control method
CN106993187A (en) A kind of coding method of variable frame rate and device
CN101022555A (en) Interframe predictive coding mode quick selecting method
CN108769689A (en) Skip macro blocks determination method, video transcoding method, electronic equipment and storage medium
CN108401185A (en) Reference frame selecting method, video transcoding method, electronic equipment and storage medium
CN100525454C (en) Selecting method for predicting mode between frames
US20220191503A1 (en) Method for deriving motion vector, and electronic device
CN107277519A (en) The method and electronic equipment of a kind of frame type for judging frame of video
CN108989818A (en) A kind of image coding parameter method of adjustment and device
CN102438146B (en) Method for improving video quality and implementing device thereof
CA2817790A1 (en) Method for h264 transcoding with code stream information reuse
CN109391816A (en) The method for parallel processing of HEVC medium entropy coding link is realized based on CPU+GPU heterogeneous platform

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: 20180928