[go: up one dir, main page]

CN109618154A - A kind of video frame coding/decoding method - Google Patents

A kind of video frame coding/decoding method Download PDF

Info

Publication number
CN109618154A
CN109618154A CN201811342314.4A CN201811342314A CN109618154A CN 109618154 A CN109618154 A CN 109618154A CN 201811342314 A CN201811342314 A CN 201811342314A CN 109618154 A CN109618154 A CN 109618154A
Authority
CN
China
Prior art keywords
video frame
frame
reference frame
decoded
information
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
CN201811342314.4A
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.)
Jianhu Yunfei Data Technology Co Ltd
Original Assignee
Jianhu Yunfei Data 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 Jianhu Yunfei Data Technology Co Ltd filed Critical Jianhu Yunfei Data Technology Co Ltd
Priority to CN201811342314.4A priority Critical patent/CN109618154A/en
Publication of CN109618154A publication Critical patent/CN109618154A/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/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/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • 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/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/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/513Processing of motion vectors
    • 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/523Motion estimation or motion compensation with sub-pixel accuracy
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation

Landscapes

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

Abstract

The present invention relates to a kind of video frame coding/decoding methods, this method is according to video frame to be encoded and the corresponding resolution ratio relationship for referring to interframe, determine the resolution ratio method of determination of current reference frame, to be capable of the current reference frame of flexible choice and the resolution match of video frame to be encoded according to reference frame resolution ratio method of determination.Even if current reference frame is different from the resolution ratio of video frame to be encoded, the reference frame of video frame to be encoded also can be used as, improve the service efficiency and code efficiency of reference frame.

Description

A kind of video frame coding/decoding method
Technical field
The present invention relates to technical field of image processing more particularly to a kind of video frame coding/decoding methods.
Background technique
Under the conditions of bandwidth is limited, traditional encoder without distinguishing encodes video frame, in fact it could happen that certain The ropy problem of scene video, when encoding without distinction for all video frames, there are partial video frame is of poor quality The case where.
Summary of the invention
The embodiment of the invention provides a kind of video frame coding/decoding methods, which comprises
Obtain the coded data of video frame to be decoded;
According to the identification information for indicating resolution ratio relationship in the coded data, determine that the resolution ratio of current reference frame determines Mode;
According to the resolution ratio method of determination, the corresponding current reference frame of the video frame to be decoded is generated;
Obtain the resolution information of the video frame to be decoded and the current reference frame;
The sample mode of the current reference frame is determined according to the resolution information: when point of the video frame to be decoded When resolution ratio represented by resolution information is less than resolution ratio represented by the resolution information of the current reference frame, described in determination The sample mode of current reference frame is down-sampling processing mode;Represented by the resolution information of the video frame to be decoded point When resolution is greater than resolution ratio represented by the resolution information of the current reference frame, the sampling side of the current reference frame is determined Formula is up-sampling treatment mode;
According to the resolution information of the sample mode and the video frame to be decoded, the current reference frame is adopted Sample processing, obtains object reference frame;
The video frame to be decoded is decoded according to the object reference frame, it is corresponding to obtain the video frame to be decoded Reconstruction video frame;
According to the identification information for indicating resolution ratio relationship, determines and rebuild video frame sample mode;
Determine the scope of application of the resolution ratio relationship;The scope of application includes frame sequence range and frame group range;
According to the reconstruction video frame sample mode, reconstruction video frame corresponding to the scope of application is carried out at sampling Reason, obtains the corresponding decoding video frame of the scope of application;
Decoding video frame sequence is obtained according to the decoding video frame.
Video frame coding/decoding method provided by the invention is closed according to video frame to be encoded and the corresponding resolution ratio with reference to interframe System, determines the resolution ratio method of determination of current reference frame, thus according to reference frame resolution ratio method of determination, can flexible choice with The current reference frame of the resolution match of video frame to be encoded.Even if the resolution ratio of current reference frame and video frame to be encoded is not Together, the reference frame that also can be used as video frame to be encoded improves the service efficiency and code efficiency of reference frame.
Specific embodiment
It is provided in an embodiment of the present invention that a kind of video frame coding/decoding method is provided.Specifically comprise the following steps:
Obtain the coded data of video frame to be decoded.
Wherein, coded data is the data for being decoded.Coded data can be coding side according to full resolution at Reason mode encodes input video frame, is also possible to coding side according to down-sampling processing mode to input video frame It is encoded again after progress down-sampling.Specifically, decoding end can receive the coded data that coding side is sent by network.
According to the identification information for indicating resolution ratio relationship in coded data, the resolution ratio determination side of current reference frame is determined Formula.
Wherein, current reference frame is the video frame to be referred to when treating decoding video frame and being decoded.Current reference Frame is the video frame rebuild to the corresponding coded data of the video frame that can be used as reference frame.Current video frame to be decoded is corresponding Current reference frame according to the difference of inter-prediction type, can be forward reference frame or bi-directionally referenced frame, video frame pair to be decoded The number for the current reference frame answered can be one or more.It should be noted that the current reference frame in video frame coding/decoding method It is corresponding with the current reference frame in method for video coding.
Wherein, the resolution ratio that the identification information of resolution ratio relationship is used to identify between video frame to be decoded and reference frame is corresponding The information of relationship.Resolution ratio method of determination is sample mode, and sample mode is the mode that sampling processing is carried out to video frame, specifically It may include oversampling ratio and/or the method for sampling.In the present embodiment, specifically sampling processing is carried out to current reference frame to adopt Sample loading mode.
When coding section and decoding end have arranged fixed sample mode, decoding end can be according to the sample mode of agreement to working as Preceding reference frame carries out sampling processing.
Decoding end can be according to the local hardware information and/or video frame to be encoded for the equipment for executing video frame coding/decoding method Image feature information determines the sample mode corresponding to frame to be decoded.
When coding side is being treated encoded video frame and encoded, current reference frame corresponding to encoded video frame will be treated The sample mode information of sampling processing is carried out when being added in the corresponding coded data of current reference frame, decoding end can be from corresponding Sample mode information is read in head information, and determines that corresponding to video frame to be encoded is configured according to the sample mode information of reading Sample mode.For example, when sample mode information is added to the corresponding frame header information of coded data, video frame group by coding side When header information or the predeterminated position of sequence header information, decoding end can be from corresponding frame header information, video frame group head The predetermined position of information or sequence header information reads sample mode information.
According to resolution ratio method of determination, the corresponding current reference frame of video frame to be decoded is generated.
Wherein, resolution ratio method of determination is sample mode.The resolution represented by the resolution information of video frame to be decoded When rate is greater than resolution ratio represented by the resolution information of current reference frame, according to sample mode, and according to video frame to be decoded Resolution information, to current reference frame carry out up-sampling treatment, obtain corresponding object reference frame.
Up-sampling treatment is to amplify to image, for example interpolated value method can be used, on the basis of original image pixel On new element is inserted into using suitable interpolation algorithm between pixel.Wherein, the resolution information institute of video frame to be decoded The resolution ratio of expression, which is greater than resolution ratio represented by the resolution information of current reference frame, specifically may is that under full resolution mode Video frame to be decoded refer to the current reference frame handled using down-sampling mode;Alternatively, using down-sampling mode handle to Decoding video frame refers to the current reference frame handled using down-sampling mode, and the down-sampling ratio of video frame to be decoded is greater than and works as The down-sampling ratio of preceding reference frame.
Determine that corresponding to the sample mode that video frame to be decoded is configured includes: according to local hardware information and/or wait solve The image feature information of code video frame, determines the sample mode that up-sampling treatment is carried out to current reference frame.
The resolution ratio represented by the resolution information of video frame to be decoded is greater than the resolution information institute of current reference frame When the resolution ratio of expression, up-sampling treatment is carried out to current reference frame.Wherein, up-sampling treatment is carried out to current reference frame to adopt Sample loading mode can be determined according to the image feature information of local hardware information and/or video frame to be decoded.For example, for processing The corresponding top sampling method complexity of the strong equipment of device processing capacity is high, the corresponding up-sampling of the weak equipment of processor processing capacity Method complexity is low.Also for example, for being up-sampled to current reference frame more than image feature information and complicated video frame When the high method of sampling of method of sampling complexity, few for image feature information and simple video frame, to current may be selected The method of sampling complexity low method of sampling may be selected when reference frame is up-sampled.Alternatively, comprehensive consideration executes Video coding The local hardware information of equipment and the characteristics of image of video frame to be decoded carry out, to select current most suitable up-sampling side Formula.
The resolution ratio represented by the resolution information of video frame to be decoded is greater than the resolution information institute of current reference frame When the resolution ratio of expression, up-sampling treatment is carried out to current reference frame.Specifically, can be according to the sample mode of configuration, and root According to the resolution information of video frame to be decoded, up-sampling treatment is carried out to current reference frame, to obtain and video frame to be decoded The consistent object reference frame of resolution ratio.
The resolution ratio represented by the resolution information of video frame to be decoded is less than the resolution information institute of current reference frame When the resolution ratio of expression, current reference frame is carried out down according to sample mode, and according to the resolution information of video frame to be decoded Sampling processing obtains corresponding object reference frame.
Down-sampling processing is reduced to image.Resolution ratio represented by the resolution information of video frame to be decoded is less than Resolution ratio represented by the resolution information of current reference frame specifically may is that the video to be decoded handled using down-sampling mode Frame refers to the current reference frame under full resolution mode;Alternatively, the video frame to be decoded reference handled using down-sampling mode is adopted The current reference frame handled with down-sampling mode, and the down-sampling ratio of video frame to be decoded is less than the down-sampling of current reference frame Ratio.
The resolution ratio represented by the resolution information of video frame to be decoded is less than the resolution information institute of current reference frame When the resolution ratio of expression, down-sampling processing is carried out to current reference frame.Specifically, it can be handled according to use down-sampling mode Downsapling method corresponding to video frame to be decoded carries out corresponding down-sampling processing to current reference frame, with obtain with wait solve The consistent object reference frame of resolution ratio of code video frame.
The resolution ratio represented by the resolution information of video frame to be decoded is less than the resolution information institute of current reference frame When the resolution ratio of expression, down-sampling processing can not be carried out to current reference frame.Directly point pixel is carried out to current reference frame to insert Value processing, to obtain object reference frame.
The resolution ratio represented by the resolution information of video frame to be decoded is equal to the resolution information institute of current reference frame When the resolution ratio of expression, sampling processing can not be carried out to current reference frame.Image element interpolation directly is carried out to current reference frame Processing, to obtain object reference frame.
Decoding video frame is treated according to current reference frame to be decoded, and obtains the corresponding reconstruction video of video frame to be decoded Frame.
Rebuilding video frame is the video frame that decoding and rebuilding obtains.It is appreciated that the corresponding resolution ratio letter of the reconstruction video frame Breath is corresponding with the resolution information of the video frame to be encoded in cataloged procedure.If image information is not during coding There are losses, then it is identical for rebuilding video frame with video frame to be encoded, if image information has damage during coding It loses, then it is corresponding with penalty values with the difference of video frame to be encoded to rebuild video frame.Be decoded to coded data is to be decoded The corresponding resolution information of video frame carries out.Decoding may include in prediction, inverse transformation, inverse quantization and entropy decoding at least It one, is determined with specific reference to the process of coding.In decoding, according to the resolution information of video frame to be decoded to current reference Frame, each to be decoded piece of corresponding location information of frame to be decoded, current reference frame the corresponding location information of each reference block And at least one of motion vector is handled, processing method when processing method therein is decoded with coding side is It is matched.Such as the corresponding current reference frame of available video frame to be decoded, according to the corresponding resolution ratio of video frame to be decoded Information handles current reference frame, obtains object reference frame, obtains target reference block according to the motion vector information of carrying, To be decoded piece of corresponding predicted value is obtained according to target reference block, and is obtained according to the prediction residual in coded data with predicted value Rebuild video frame.
It when decoding end is decoded, is decoded according to the corresponding resolution information of video frame to be decoded.Worked as After preceding reference frame, reference block corresponding with the encoding block of video frame to be encoded can be obtained from current reference frame, according to reference Block is decoded encoding block.Sampling processing can also be carried out to current reference frame according to video frame to be decoded, obtained corresponding Object reference frame, from object reference frame obtain with to be decoded piece of corresponding target reference block of video frame to be decoded, according to mesh Mark reference block is decoded encoding block, obtains the corresponding reconstruction video frame of video frame to be decoded.
When coding side has carried out transformation to location information, then corresponding location information is acquired in decoding process When, it needs to convert the location information accordingly, with the consistent of the target reference block that keeps coding side and decoding end to obtain Property.
It, can be according to target motion vectors list when the motion vector information carried in coded data is target motion vectors Bit resolution information resolution information corresponding with video frame to be decoded converts target motion vectors, obtains to be decoded The first motion vector under the corresponding resolution information of video frame obtains to be decoded piece of corresponding target according to the first motion vector Reference block.
When the motion vector information carried in coded data is motion vector difference, current to be decoded piece of acquisition corresponding Initial predicted motion vector, to each to be decoded piece of corresponding motion vector difference and predicted motion vector under equal resolution into Row processing, obtain corresponding to be decoded piece corresponding to and the first motion vector under the resolution ratio of video frame to be decoded, according to First motion vector obtains to be decoded piece of corresponding target reference block.
It can be the target prediction motion vector under target resolution by initial predicted motion vector transform, it is pre- according to target It surveys motion vector and motion vector difference obtains target motion vectors, then target motion vectors are transformed into video frame to be decoded Resolution ratio under the first motion vector.It can also be by initial predicted motion vector transform under the resolution ratio of video frame to be decoded Predicted motion vector, motion vector difference is transformed to the motion vector difference under the resolution ratio of video frame to be decoded, according to Motion vector difference under the resolution ratio of video frame to be decoded and the predicted motion vector under the resolution ratio of video frame to be decoded Obtain the first motion vector.
Decoding end can determine that third is sweared according to the corresponding resolution information of video frame to be decoded and first resolution information Change of variable parameter, first resolution information include the resolution ratio of target motion vectors unit resolution rate information or current reference frame Information;Each to be decoded piece of corresponding target motion vectors in video frame to be decoded are obtained according to coded data;It is sweared according to third Change of variable parameter and target motion vectors obtain each to be decoded piece of corresponding target reference block in video frame to be decoded;According to Target reference block is decoded coded data, obtains the corresponding reconstruction video frame of video frame to be decoded.
Third vector parameter is for converting the location information or motion vector that obtain motion vector.Third Vector parameters can be the ratio between first resolution information and the resolution information of frame to be decoded, third vector parameters and the One vector parameters are corresponding.It, can be by target when being converted using third vector parameters on target motion vector Under motion vector transform to the corresponding resolution ratio of frame to be decoded, corresponding motion vector, then third vector parameters can be The inverse of one vector parameters.When being converted using third vector parameter to the corresponding location information of motion vector, such as The first vector parameter is for converting first location information in fruit coding side, then due to be decoded piece and encoding block Location information is identical, therefore third vector parameter is identical as the first vector parameter.If the first vector in coding side Transformation parameter is for converting second location information, due to being calculated according to target motion vectors and first location information The positional value arrived is to carry out transformed positional value to second location information to according to the first vector parameter in coding side, Therefore third vector parameter is the inverse of the first vector parameter.
When carrying target motion vectors in coded data, target motion vectors are read from coded data.Work as coded number According to middle carrying be motion vector difference when, then target prediction motion vector can be calculated, according to motion vector difference and mesh Mark predicted motion vector obtains target motion vectors.
After decoding end obtains third vector parameter, according to third vector parameter to obtained motion vector or The corresponding location information of motion vector is converted, and the corresponding location information of target reference block is obtained, to obtain object reference Block.
After obtaining target reference block, according to carrying to be decoded piece pre- in the pixel value of target reference block and coded data Residual error is surveyed, the pixel value for rebuilding each image block of video frame is obtained, obtains rebuilding video frame.
Determine that third vector is joined according to the corresponding resolution information of video frame to be decoded and first resolution information Several steps includes: to determine third according to the resolution information of the corresponding resolution information of video frame to be decoded and current reference frame Vector parameter;It is obtained according to third vector parameter and target motion vectors each to be decoded in video frame to be decoded The step of block corresponding target reference block includes: to obtain current to be decoded piece of corresponding first location information;According to first position Information, third vector parameter and target motion vectors obtain current to be decoded piece of corresponding target reference block.
Target reference block pair can be obtained according to first location information, third vector parameter and target motion vectors The second location information answered obtains target reference block according to second location information.Due to coding and decoded correspondence, if compiled The first vector parameter is for converting first location information in code end, then due to be decoded piece and the position of encoding block Information is identical, therefore third vector parameter is identical as the first vector parameter.If the first vector in coding side Parameter is for converting second location information, due to what is be calculated according to target motion vectors and first location information Positional value is to carry out transformed positional value to second location information to according to the first vector parameter in coding side, therefore Third vector parameter is the inverse of the first vector parameter.
The resolution ratio of frame to be decoded is 1200*1200 pixel, and the resolution ratio of current reference frame is 600*600 pixel, first Vector parameter is for converting first location information, and the first vector parameter is 1/2, then third vector is joined Number is 1/2.
Determine that third vector is joined according to the corresponding resolution information of video frame to be decoded and first resolution information Several steps includes: to be determined according to the corresponding resolution information of video frame to be decoded and target motion vectors unit resolution rate information Third vector parameter;According to third vector parameter and target motion vectors obtain in video frame to be decoded it is each to The step of decoding block corresponding target reference block includes: to obtain first according to target motion vectors and third vector parameter Motion vector;Current to be decoded piece of corresponding target reference block is obtained according to the first motion vector.
Third vector parameter is according to the corresponding resolution information of video frame to be decoded and target motion vectors unit What resolution information determined, for target motion vectors to be transformed to corresponding first movement under the corresponding resolution ratio of band decoding frame Vector.After obtaining third vector parameter, third vector parameter and target motion vectors can be multiplied, will The product arrived is as the first motion vector.It is appreciated that obtaining according to third vector parameter and target motion vectors This process of one motion vector is corresponding with present encoding block is obtained according to the first vector parameter and the first motion vector Target motion vectors are inverse process.For example, if in coding side, this to be decoded piece corresponding the first vector of encoding block parameter Equal to 2.The first obtained motion vector is (2,2), according to the first vector parameter and the first motion vector for (2,2) It is (4,4) that product, which obtains target motion vectors,.So in decoding process, third vector parameter is 1/2, obtained target fortune Dynamic vector is (4,4), obtains the first movement arrow according to the product of third vector parameter 1/2 and target motion vectors (4,4) Amount is (2,2).
When what is carried in coded data is motion vector difference, then obtained according to coded data each in video frame to be decoded The step of to be decoded piece of corresponding target motion vectors include: obtained according to coded data it is current wait solve in video frame to be decoded The corresponding motion vector difference of code block;Obtain current to be decoded piece of corresponding initial predicted motion vector;It is moved according to initial predicted The corresponding current motion vector unit resolution rate information of vector and target motion vectors unit resolution rate information, obtain the second vector Transformation coefficient;The corresponding target prediction fortune of current decoding block is obtained according to initial predicted motion vector and the second vector coefficient Dynamic vector;Target motion vectors are obtained according to target prediction motion vector and motion vector difference.
In one embodiment, with block to be encoded be with to be decoded piece in cataloged procedure due to decoding it is corresponding, initially in advance It is identical to survey motion vector acquisition rule, therefore current to be decoded piece of corresponding initial motion predictive vector and current block to be encoded pair The initial predicted motion vector answered is consistent, and the method for obtaining target prediction motion vector is referred to the side in cataloged procedure Method specifically repeats no more.Target motion vectors be target prediction motion vector and motion vector difference and.
Can flexible choice correspond to the corresponding current reference frame of frame to be decoded sample mode, with to current reference frame into The corresponding sampling processing of row, and then obtain object reference frame.Decoding frame is treated further according to object reference frame to be decoded, and obtains weight Build video frame.Due to that can be adjusted with the sample mode of flexible choice current reference frame with carrying out sampling reconstruction to current reference frame Current reference frame resolution ratio also can be used as reference frame even if current reference frame is different from the current resolution ratio of frame to be decoded, improve The service efficiency of reference frame reduces prediction residual, and then improve decoding image so that the accuracy of inter-prediction can be improved Quality.
And according to the resolution information of video frame to be decoded, sampling processing is carried out to current reference frame, obtains corresponding mesh Mark reference frame the step of include: according to sample mode, and according to the resolution information of video frame to be decoded to current reference frame into Row sampling processing obtains middle reference frame;Image element interpolation processing is carried out to intermediate reference frame, obtains object reference frame.
Specifically, it during treating decoding video frame and being decoded, needs to search in current reference frame using movement Rope technology finds reference block corresponding with encoding block in video frame to be decoded, the motion information according to encoding block relative to reference block Motion vector is calculated, motion vector is decoded to inform the corresponding reference data of decoding end reference block in current reference Position in frame, thus, it handles to obtain object reference frame, video frame to be decoded by carrying out image element interpolation to intermediate reference frame Estimation can be carried out according to the higher object reference frame of resolution ratio, to improve the accuracy of estimation, promote solution The quality of code video.
Current reference frame is sampled according to determining sample mode, and according to the resolution information of video frame to be decoded Processing, obtains middle reference frame, can be directly using middle reference frame as object reference frame.
Decoding end can according to determining sample mode, according to the resolution information of video frame to be decoded to current reference frame into Row sampling processing obtains middle reference frame.Image element interpolation processing is carried out to intermediate reference frame, to obtain object reference frame.
Coding side setting can be handled to obtain object reference frame according to middle reference frame in respective encoding and decoding rule When used image element interpolation mode.In decoding, configuration information is can be read in decoding end, is carried out with determining to intermediate reference frame Corresponding image element interpolation mode is handled, image element interpolation mode used by decoding end should be and coding side keeps one It causes.
When coding side encodes input video frame using the coding framework of adaptive resolution, by image element interpolation The corresponding image element interpolation mode information of mode is added in the corresponding coded data of input video frame, for example, a point pixel is inserted Value mode information is added to corresponding sequence header information, video frame group header information or frame header information.Decoding end into When row decoding, it can be read from corresponding sequence header information, video frame group header information or frame header information and pixel is divided to insert Value mode information determines the mode that image element interpolation is carried out to intermediate reference frame according to the image element interpolation mode information of reading, To be handled intermediate reference frame to obtain object reference frame, so as to be decoded according to object reference frame to coded data To reconstruction video frame.
The resolution ratio of video frame to be decoded and video frame to be encoded is consistent, the resolution ratio of obtained object reference frame It is consistent, therefore, sampling processing is carried out to current reference frame according to video frame to be decoded corresponding resolution information, is obtained Between reference frame, image element interpolation processing carried out to intermediate reference frame, the step of obtaining object reference frame be consistent in coding side , details are not described herein for the embodiment of the present invention.
By carrying out sampling processing to current reference frame, middle reference frame is obtained, then a point pixel is carried out to intermediate reference frame Interpolation processing obtains object reference frame.By carrying out image element interpolation processing to intermediate reference frame, further improve to be decoded Images match degree between video frame and the frame to be referred to substantially increases the pixel precision of estimation, reduces prediction residual, Improve the quality of decoding image.
According to sample mode, and according to the resolution information of video frame to be decoded, sampling processing is carried out to current reference frame, The step of obtaining corresponding object reference frame includes: the resolution information and current reference frame according to video frame to be decoded Resolution information determines and carries out the corresponding oversampling ratio of sampling processing to current reference frame;According to sample mode and oversampling ratio, Sampling processing is carried out to current reference frame, obtains corresponding object reference frame.
Specifically, decoding end can obtain the resolution information of video frame to be decoded and the resolution ratio letter of current reference frame Breath.According to the resolution information of video frame to be decoded and the resolution information of current reference frame, determine to current reference frame into The corresponding oversampling ratio of row sampling processing.Wherein, carrying out the corresponding oversampling ratio of sampling processing to current reference frame should meet: right After current reference frame carries out sampling processing, object reference frame, point of the resolution ratio of object reference frame and video frame to be decoded are obtained Resolution is consistent.
In one embodiment, it is handled when video frame to be decoded under full resolution mode is referred to using down-sampling mode When current reference frame, the up-sampling ratio for carrying out up-sampling reconstruction to current reference frame specifically be can be using at down-sampling mode The inverse of down-sampling ratio corresponding to the current reference frame of reason.Up-sampling direction can be vertical up-sampling, level up-samples, Vertically and horizontally one of up-sampling.
In one embodiment, when the video frame to be decoded handled using down-sampling mode is referred to using at down-sampling mode The current reference frame of reason, and the down-sampling ratio of video frame to be decoded be greater than current reference frame down-sampling ratio when, to current Reference frame carry out up-sampling reconstruction up-sampling ratio need to meet by up-sampling rebuild after object reference frame resolution ratio and The condition that the resolution ratio of video frame to be decoded is consistent.For example, the resolution ratio of the video frame under full resolution mode is 12M* 12N, the resolution ratio for the video frame to be decoded for using 1/2 down-sampling mode to handle are handled for 6M*6N using 1/6 down-sampling mode Current reference frame resolution ratio be 2M*2N.At this point, 3 times of up-sampling treatments can be carried out to current reference frame, object reference is obtained Frame, the resolution ratio of object reference frame are 6M*6N.
It is right when the video frame to be decoded handled using down-sampling mode refers to the current reference frame under full resolution mode The down-sampling ratio that current reference frame carries out down-sampling reconstruction specifically can be the video to be decoded handled using down-sampling mode Down-sampling ratio corresponding to frame.Down-sampling direction can be vertical down-sampling, horizontal down sample, vertically and horizontally in down-sampling One kind.
When the video frame to be decoded handled using down-sampling mode refers to the current reference frame handled using down-sampling mode, And the down-sampling ratio of video frame to be decoded be less than current reference frame down-sampling ratio when, to current reference frame carry out down-sampling The down-sampling ratio of reconstruction need to meet the resolution ratio of the object reference frame after rebuilding by down-sampling and point of video frame to be decoded The condition that resolution is consistent.For example, the resolution ratio of the video frame under full resolution mode is 12M*12N, using 1/6 down-sampling The resolution ratio for the video frame to be decoded that mode is handled is 2M*2N, using the resolution for the current reference frame that 1/2 down-sampling mode is handled Rate is 6M*6N.At this point, 1/3 down-sampling processing can be carried out to current reference frame, object reference frame, point of object reference frame are obtained Resolution is 2M*2N.
When oversampling ratio information is added to frame header information, video frame group header information or sequence header information by coding side When middle, decoding end, can be directly from the oversampling ratio information from corresponding position in read head information when being decoded.Decoding end The oversampling ratio that sampling processing is carried out to current reference frame is determined according to oversampling ratio information.
According to the resolution information of video frame to be decoded and the resolution information of current reference frame, to determine to current Reference frame carries out the corresponding oversampling ratio of sampling processing, and then according to determining oversampling ratio, samples to current reference frame Processing, available suitable object reference frame, such as the consistent object reference frame of resolution ratio with video frame to be decoded, with side Just subsequent Video coding is carried out.
Video frame coding/decoding method further include: the current coding mode information according to entrained by coded data determines view to be decoded The corresponding current decoding mode of frequency frame;According to current decoding mode, treat at the corresponding reconstruction video frame of decoding video frame Reason obtains decoding video frame.
Each encoded video frame corresponding with coded data can carry current coding mode information, and decoding end can be according to current Coding mode information determines the corresponding current decoding mode of current decoding video frame.Decoding end can be right according to current decoding mode Video frame is rebuild to be handled to obtain decoding video frame.
Decoding end can obtain current coding mode information entrained by coded data from the head information of coded data, according to Current coding mode information determines the corresponding current decoding mode of video frame to be decoded.Decoding end is obtaining video frame pair to be decoded After the reconstruction video frame answered, it can handle according to current decoding mode video frame is rebuild, obtain decoding video frame.Head letter Breath specifically can be the frame header information of coded data, indicate the corresponding input video frame of current encoded data in when institute encoded The processing mode of use.For example, when the marker in the frame header information of coded data for determining processing mode is 0, table Show that input video frame is all made of full resolution processing mode when encoded, then decoding end is decoded coded data Rebuilding video frame is the corresponding decoding video frame of video frame to be decoded;When the marker for determining processing mode is 1, table Show that input video frame uses down-sampling processing mode when encoded, decoding end can match according to the down-sampling processing mode Processing mode obtained reconstruction video frame is further processed, obtain decoding video frame.Being further processed such as is up-sampling Processing.
In one embodiment, the corresponding decoding frame of video frame to be decoded can be determined from the head information of coded data. Specifically, decoding end can obtain the corresponding input view of current encoded data from the corresponding sequence header information of coded data Each input video frame used coding framework when encoded in frequency frame sequence, so that it is determined that matching view to be decoded The decoding frame of frequency frame.For example, when the marker in the sequence header information of coded data for determining used coding framework When being 0, each input video frame is all made of the coding framework of constant resolution when being encoded in expression input video frame sequence, Then decoding end can be used the decoding frame of constant resolution coded data is decoded to obtain video frame to be decoded it is corresponding heavy Build video frame;When the marker for determining used coding framework is 1, each input view in input video frame sequence is indicated Frequency frame is all made of the coding framework of adaptive resolution when being encoded, and the decoding frame of adaptive resolution just can be used in decoding end Frame is decoded to obtain to coded data rebuilds sequence of frames of video.
When decoding end is decoded coded data using the decoding frame of adaptive resolution, can also be calculated according to decision Method determines the corresponding processing mode of current video frame to be decoded.The decision making algorithm should with used by coding side to input video Used decision making algorithm matches when frame is encoded.
When decoding end determines that current encoded data is carried out by down-sampling processing mode from the head information of coded data Coding obtains, then down-sampling percent information or Downsapling method information used by from the beginning decoding end can also obtain in information, And using the reconstruction with the up-sampling ratio, top sampling method of down-sampling percent information or Downsapling method information matches to obtaining Video frame carries out up-sampling treatment, obtains decoding video frame.For example, the corresponding oversampling ratio of down-sampling percent information is 1/2, then Decoding end needs to up-sample ratios and with the top sampling methods of Downsapling method information matches to rebuilding video frame according to 2 times Up-sampling treatment is carried out, decoding video frame is obtained.Decoding end can be from sequence header information, video frame group header information and frame Any of header information gets the corresponding down-sampling percent information of current encoded data or Downsapling method information.
The current decoding mode of determination video frame to be decoded that can be adaptive, so as to be directed to different scenes, adaptively The suitable resolution ratio of selection be decoded.According to current decoding mode corresponding with current coding mode, decoding video is treated The corresponding reconstructed frame of frame is handled to obtain decoding video frame, can be for the code stream using adaptive change pattern-coding, certainly Adjustment reference frame resolution ratio is adapted to, is decoded, the code stream of adaptive change pattern-coding is suitable for different scenes selection The code stream that is encoded of resolution ratio, so that the decoding provided to high quality graphic quality code stream is supported.
The step of rebuilding video frame is obtained, the following contents is specifically included:
Obtain the resolution information of video frame to be decoded and current reference frame.
Specifically, resolution information is the information for indicating resolution sizes.Server is obtaining video frame to be encoded and is working as After preceding reference frame, the resolution information of video frame to be encoded and the resolution information of current reference frame are extracted respectively.
The sample mode of current reference frame is determined according to resolution information.
Wherein, sample mode is the mode that sampling processing is carried out to video frame, can specifically include oversampling ratio and/or adopts Quadrat method.In the present embodiment, the sample mode of sampling processing is specifically carried out to current reference frame.Wherein, to current reference It includes that up-sampling treatment or down-sampling processing are carried out to current reference frame that frame, which carries out sampling processing,.
Server believes resolution ratio represented by the resolution information of video frame to be decoded and the resolution ratio of current reference frame The represented resolution ratio of breath is compared, and when the resolution ratio of video frame to be decoded is greater than the resolution ratio of current reference frame, is determined The sample mode of current reference frame is down-sampling processing mode;When the resolution ratio of video frame to be decoded is less than point of current reference frame When resolution, determine that the sample mode of current reference frame is up-sampling treatment mode.
Coding side or decoding end can be according to the local hardware information and/or view to be encoded for the equipment for executing method for video coding The image feature information of frequency frame determines the sample mode corresponding to video frame to be encoded.Wherein, local hardware information is to execute The relevant information of hardware of Video coding/video frame coding/decoding method computer equipment, can specifically include CPU, memory, mainboard Or the relevant information of driver etc..
The method sampled to current reference frame can be according to execution Video coding or the equipment of the decoded method of video As the processor ability of terminal or server obtains.The corresponding method of sampling of the equipment strong for processor processing capacity is complicated Degree is high, and the corresponding method of sampling complexity of the weak equipment of processor processing capacity is low.Processor processing capacity can be set and adopt The corresponding relationship of quadrat method obtains processor processing capacity when being encoded, and is obtained pair according to processor processing capacity The method of sampling answered.
The method sampled to current reference frame can also be according to the image of video frame to be encoded or video frame to be decoded Characteristic information determines.Wherein, image feature information refers to information relevant to the picture material of video frame, including in image Appearance, image motion information, image texture information, such as edge.Image feature information reflects the corresponding scene of video frame, details Complexity, motion intense degree etc..For being sampled to current reference frame more than image feature information and complicated video frame When the high method of sampling of method of sampling complexity, few for image feature information and simple video frame, to current may be selected The method of sampling complexity low method of sampling may be selected when reference frame is sampled.Can be set the content of video frame to be encoded with The corresponding relationship of the method for sampling can predefine the image feature information of video frame to be encoded when encoding to video frame, The corresponding method of sampling is obtained according to the image feature information of video frame to be encoded.
It, can be with comprehensive consideration coding side or decoding end when determining the sample mode to current reference frame progress sampling processing Hardware information and image feature information, to select current most suitable sample mode.
According to the resolution information of sample mode and video frame to be decoded, sampling processing is carried out to current reference frame, is obtained Object reference frame.
Server carries out current reference frame after determining the sample mode of current reference frame, according to determining sample mode Sampling processing, so that the resolution information of the resolution ratio for the object reference frame that sampling processing obtains and video frame to be encoded indicated Resolution ratio is identical.
Up-sampling treatment is to amplify to image, for example interpolated value method can be used, on the basis of original image pixel On new element is inserted into using suitable interpolation algorithm between pixel.Wherein, the resolution information institute of video frame to be encoded The resolution ratio of expression, which is greater than resolution ratio represented by the resolution information of current reference frame, specifically may is that under full resolution mode Video frame to be encoded refer to the current reference frame handled using down-sampling mode;Alternatively, using down-sampling mode handle to Encoded video frame refers to the current reference frame handled using down-sampling mode, and the down-sampling ratio of video frame to be encoded is greater than and works as The down-sampling ratio of preceding reference frame.
Determine that corresponding to the sample mode that video frame to be encoded is configured includes: according to local hardware information and/or wait compile The image feature information of code video frame, determines the sample mode that up-sampling treatment is carried out to current reference frame.
The resolution ratio represented by the resolution information of video frame to be encoded is greater than the resolution information institute of current reference frame When the resolution ratio of expression, up-sampling treatment is carried out to current reference frame.Wherein, up-sampling treatment is carried out to current reference frame to adopt Sample loading mode can be determined according to the image feature information of local hardware information and/or video frame to be encoded.For example, for processing The corresponding top sampling method complexity of the strong equipment of device processing capacity is high, the corresponding up-sampling of the weak equipment of processor processing capacity Method complexity is low.Also for example, for being up-sampled to current reference frame more than image feature information and complicated video frame When the high method of sampling of method of sampling complexity, few for image feature information and simple video frame, to current may be selected The method of sampling complexity low method of sampling may be selected when reference frame is up-sampled.Alternatively, comprehensive consideration executes Video coding The local hardware information of equipment and the characteristics of image of video frame to be encoded carry out, to select current most suitable up-sampling side Formula.
The resolution ratio represented by the resolution information of video frame to be encoded is greater than the resolution information institute of current reference frame When the resolution ratio of expression, up-sampling treatment is carried out to current reference frame.Specifically, can be according to the sample mode of configuration, and root According to the resolution information of video frame to be encoded, up-sampling treatment is carried out to current reference frame, to obtain and video frame to be encoded The consistent object reference frame of resolution ratio.
The resolution ratio represented by the resolution information of video frame to be encoded is less than the resolution information institute of current reference frame When the resolution ratio of expression, current reference frame is carried out down according to sample mode, and according to the resolution information of video frame to be encoded Sampling processing obtains corresponding object reference frame.
The resolution ratio represented by the resolution information of video frame to be encoded is less than the resolution information institute of current reference frame When the resolution ratio of expression, down-sampling processing is carried out to current reference frame.Specifically, it can be handled according to use down-sampling mode Downsapling method corresponding to video frame to be encoded carries out corresponding down-sampling processing to current reference frame, with obtain with wait compile The consistent object reference frame of resolution ratio of code video frame.
The resolution ratio represented by the resolution information of video frame to be encoded is less than the resolution information institute of current reference frame When the resolution ratio of expression, down-sampling processing can not be carried out to current reference frame.Directly point pixel is carried out to current reference frame to insert Value processing, to obtain object reference frame.
The resolution ratio represented by the resolution information of video frame to be encoded is equal to the resolution information institute of current reference frame When the resolution ratio of expression, sampling processing can not be carried out to current reference frame.Image element interpolation directly is carried out to current reference frame Processing, to obtain object reference frame.
According to sample mode, and according to the resolution information of video frame to be encoded, sampling processing is carried out to current reference frame, The step of obtaining corresponding object reference frame includes: the resolution information and current reference frame according to video frame to be encoded Resolution information determines and carries out the corresponding oversampling ratio of sampling processing to current reference frame;According to sample mode and oversampling ratio, Sampling processing is carried out to current reference frame, obtains corresponding object reference frame.
Specifically, coding side can obtain the resolution information of video frame to be encoded and the resolution ratio letter of current reference frame Breath.According to the resolution information of video frame to be encoded and the resolution information of current reference frame, determine to current reference frame into The corresponding oversampling ratio of row sampling processing.Wherein, carrying out the corresponding oversampling ratio of sampling processing to current reference frame should meet: right After current reference frame carries out sampling processing, object reference frame, point of the resolution ratio of object reference frame and video frame to be encoded are obtained Resolution is consistent.
It is right when the video frame to be encoded under full resolution mode refers to the current reference frame handled using down-sampling mode The up-sampling ratio that current reference frame carries out up-sampling reconstruction specifically can be the current reference frame handled using down-sampling mode The inverse of corresponding down-sampling ratio.Up-sampling direction can be vertical up-sampling, horizontal up-sampling, vertically and horizontally on adopt One of sample.
When the video frame to be encoded handled using down-sampling mode refers to the current reference frame handled using down-sampling mode, And the down-sampling ratio of video frame to be encoded be greater than current reference frame down-sampling ratio when, current reference frame is up-sampled The up-sampling ratio of reconstruction need to meet the resolution ratio of the object reference frame after rebuilding by up-sampling and point of video frame to be encoded The condition that resolution is consistent.
It is right when the video frame to be encoded handled using down-sampling mode refers to the current reference frame under full resolution mode The down-sampling ratio that current reference frame carries out down-sampling reconstruction specifically can be the video to be encoded handled using down-sampling mode Down-sampling ratio corresponding to frame.Down-sampling direction can be vertical down-sampling, horizontal down sample, vertically and horizontally in down-sampling One kind.
When the video frame to be encoded handled using down-sampling mode refers to the current reference frame handled using down-sampling mode, And the down-sampling ratio of video frame to be encoded be less than current reference frame down-sampling ratio when, to current reference frame carry out down-sampling The down-sampling ratio of reconstruction need to meet the resolution ratio of the object reference frame after rebuilding by down-sampling and point of video frame to be encoded The condition that resolution is consistent.
The corresponding oversampling ratio information of oversampling ratio can also be added to the corresponding coded number of input video frame by coding side In, corresponding oversampling ratio information in coded data is can be read when being decoded processing in decoding end, to determine to current ginseng Examine the oversampling ratio that frame carries out sampling processing.
Specifically, oversampling ratio when oversampling ratio information is used to describe to current reference frame progress sampling processing, can be with The flag bit of description oversampling ratio information is added in coded data.The value of specific flag bit can according to need setting.It adopts Sample percent information can be frame header information, video frame group header information or sequence header information in the point of addition of coded data Any of, oversampling ratio information can be determined in the point of addition of coded data according to the sphere of action of sampling processing.It adopts Sample percent information can be determined according to the resolution information of video frame to be encoded and the resolution information of current reference frame.
In above-described embodiment, according to the resolution information of video frame to be encoded and the resolution information of current reference frame, The corresponding oversampling ratio of sampling processing is carried out to current reference frame to determine, and then according to determining oversampling ratio, to current ginseng It examines frame and carries out sampling processing, available suitable object reference frame, such as the consistent mesh of resolution ratio with video frame to be encoded Reference frame is marked, carries out subsequent Video coding to facilitate.
Sampling processing is carried out to current reference frame according to sample mode, and according to the resolution information of video frame to be encoded, Obtain middle reference frame;Image element interpolation processing is carried out to intermediate reference frame, obtains object reference frame.
Wherein, image element interpolation is to obtain a point pixel scale by the reference data interpolation of pixel whole in middle reference frame The process of reference data.
Current reference frame is sampled according to determining sample mode, and according to the resolution information of video frame to be encoded Processing, obtains middle reference frame, can be directly using middle reference frame as object reference frame.
In one embodiment, when being encoded using the coding framework of adaptive resolution to input video frame, also The corresponding image element interpolation mode information of image element interpolation mode can be added in the corresponding coded data of input video frame.Point Picture element interpolation mode information can be corresponding sequence header information, video frame group header information in the point of addition of coded data And any of frame header information, image element interpolation mode information can be according to dividing pixel in the point of addition of coded data The corresponding sphere of action of interpolation method determines.Image element interpolation mode information can be added to the corresponding coded number of input video frame According to frame header information in, indicate input video frame when encoded corresponding current reference frame use image element interpolation mode believe It ceases corresponding image element interpolation mode and carries out image element interpolation processing.
In above-described embodiment, by carrying out sampling processing to current reference frame, middle reference frame is obtained, then to middle reference Frame carries out image element interpolation processing, obtains object reference frame.By carrying out image element interpolation processing to intermediate reference frame, further The images match degree between video frame to be encoded and the frame to be referred to is improved, the pixel precision of estimation is substantially increased, Reduce prediction residual, improves the quality of coded image.
Sampling processing is carried out to current reference frame according to sample mode, and according to the resolution information of video frame to be encoded, The step of obtaining corresponding object reference frame include: according to sample mode, according to the resolution information of video frame to be encoded and Estimation pixel precision carries out sampling processing to current reference frame, obtains corresponding object reference frame.
Estimation pixel precision is the unit length of the corresponding motion vector of encoding block in video frame to be encoded.Coding It end, can be according to the estimation pixel precision of acquisition by encoding block pair when treating the encoding block in encoded video frame and being encoded The unit length for the motion vector answered is refined, and the motion vector obtained in this way is more fine and accurate, it is then desired to according to The estimation pixel precision of acquisition carries out sampling processing to current reference frame and obtains object reference frame, then according to object reference frame Calculate corresponding first motion vector of each encoding block in video frame to be encoded, based on first motion vector encoded to obtain to The corresponding coded data of encoded video frame.
The resolution information that current reference frame can be obtained, according to video frame to be encoded use image element interpolation mode, with And the resolution information of video frame to be encoded, current reference frame resolution information and the corresponding movement of video frame to be encoded estimate Meter pixel precision determination carries out which kind of sampling processing method, the corresponding oversampling ratio of sampling processing and pixel to current reference frame Interpolation precision.The size of estimation pixel precision can according to need setting.
It can be the corresponding estimation picture of video frame configuration to be encoded according to the image feature information of video frame to be encoded Plain precision, image feature information such as size of the video frame to be encoded, texture information, movement velocity etc. can integrate a variety of figures As characteristic information determines the corresponding estimation pixel precision of video frame to be encoded.Image data entrained by video frame to be encoded More complicated, image information is abundanter, and corresponding estimation pixel precision is higher.For example, when carrying out inter-prediction to P frame, Higher estimation pixel precision can be used and calculate the corresponding motion vector of each encoding block in P frame, and interframe is being carried out to B frame When prediction, lower estimation pixel precision can be used and calculate the corresponding motion vector of each encoding block in B frame.
Current reference frame is sampled according to the resolution information of video frame to be encoded and estimation pixel precision Processing, obtaining corresponding object reference frame includes: the resolution information and estimation pixel essence according to video frame to be encoded Picture element interpolation precision is calculated in degree;Image element interpolation processing directly is carried out to current reference frame according to picture element interpolation precision, is obtained To corresponding object reference frame.
Specifically, picture element interpolation precision is that the corresponding pixel precision of image element interpolation is carried out to current reference frame.When dividing picture Plain interpolation method is direct image element interpolation mode, and expression can directly carry out image element interpolation to current reference frame and handle to obtain mesh Mark reference frame.Therefore pixel can be calculated according to the resolution information and estimation pixel precision of video frame to be encoded Interpolation precision.The ratio that the resolution information of current reference frame and the resolution information of video frame to be encoded can be calculated, according to Ratio and estimation pixel precision obtain picture element interpolation precision.
When the resolution ratio of current reference frame is greater than the resolution ratio of video frame to be encoded, partially divide pixel in current reference frame The data of point can be directly multiplexed, and be can be used as and corresponding with estimation pixel precision divided pixel corresponding data.That is, When the resolution ratio of current reference frame is greater than the resolution ratio of video frame to be encoded, current reference frame can not be carried out at down-sampling Reason, directly progress image element interpolation processing.For example, the resolution ratio of video frame to be encoded is M*N, the resolution ratio of current reference frame is 2M*2N, if estimation pixel precision is 1/2, picture element interpolation precision is 1, then current reference frame can join directly as target Examine frame;If estimation pixel precision is 1/4, then it is 1/2 that picture element interpolation precision, which is calculated, it can be to current reference frame with 1/ 2 picture element interpolation precision carry out image element interpolation and handle to obtain object reference frame.
In one embodiment, represented by the resolution information of video frame to be encoded resolution ratio and current reference frame When resolution ratio is identical, then image element interpolation processing is directly carried out to current reference frame according to estimation pixel precision, obtained pair The object reference frame answered.
Handled to obtain video frame to be encoded to input video frame by differentiating processing mode entirely, and current reference frame When resolution ratio is also former differentiate, then the resolution ratio of video frame to be encoded and the resolution ratio of current reference frame are identical.Alternatively, under passing through Sample mode is handled to obtain video frame to be encoded to input video frame, and current reference frame frame be also using it is identical using than What the coded data that encodes of down-sampling mode of example was rebuild, then the resolution ratio and current reference frame of video frame to be encoded Resolution ratio it is identical.It is inserted it is possible to be directly based upon estimation pixel precision and directly carry out point pixel to current reference frame Value handles to obtain object reference frame, also, image element interpolation handles corresponding picture element interpolation precision and estimation pixel precision It is identical.
When the resolution ratio represented by the resolution information of video frame to be encoded is less than the resolution ratio of current reference frame, then root Down-sampling processing is carried out to current reference frame according to the resolution information of video frame to be encoded, middle reference frame is obtained, is then based on The corresponding estimation pixel precision of video frame to be encoded carries out image element interpolation processing to intermediate reference frame, obtains object reference Frame.For example: it is handled by carrying out down-sampling according to down-sampling processing mode to the input video frame that resolution ratio is 2M*2N The video frame to be encoded for being M*N to resolution ratio, and the resolution ratio of current reference frame is 2M*2N (full resolution processing mode), then It carries out down-sampling according to 1/2 oversampling ratio to current reference frame to handle to obtain the middle reference frame that resolution ratio is M*N, if obtaining The corresponding estimation pixel precision of video frame to be encoded be 1/2, then to intermediate reference frame according to estimation pixel essence Identical picture element interpolation precision is spent, i.e. 1/2 image element interpolation precision carries out image element interpolation processing, obtains object reference frame;If The corresponding estimation pixel precision of video frame to be encoded obtained is 1/4, then to intermediate reference frame according to 1/4 image element interpolation Precision carries out image element interpolation processing, obtains object reference frame.
In one embodiment, the resolution ratio represented by the resolution information of video frame to be encoded is greater than current reference frame Resolution ratio when, then according to the resolution information of video frame to be encoded to current reference frame carry out up-sampling treatment, obtain centre Reference frame is then based on the corresponding estimation pixel precision of video frame to be encoded and carries out at image element interpolation to intermediate reference frame Reason, obtains object reference frame.For example, the resolution ratio of video frame to be encoded is 2M*2N, the resolution ratio of current reference frame is 1/2M* 1/2N then needs to be that 4 pairs of current reference frames progress up-sampling treatments obtain and video frame resolution to be encoded according to oversampling ratio Identical middle reference frame continues to obtained middle reference frame if estimation pixel precision is 1/2 according to 1/2 pixel Interpolation precision carries out image element interpolation processing, obtains object reference frame;If estimation pixel precision be 1/4, continue to The middle reference frame arrived carries out image element interpolation processing according to 1/4 picture element interpolation precision, obtains object reference frame.
Decoding video frame is treated according to object reference frame to be decoded, and obtains the corresponding reconstruction video of video frame to be decoded Frame.
Specifically, rebuilding video frame is the video frame that decoding and rebuilding obtains.It is appreciated that corresponding point of the reconstruction video frame Resolution information is corresponding with the resolution information of the video frame to be encoded in cataloged procedure.If image during coding Information is there is no loss, then it is identical for rebuilding video frame with video frame to be encoded, if image information during coding There are losses, then it is corresponding with penalty values with the difference of video frame to be encoded to rebuild video frame.Coded data is decoded be The corresponding resolution information of video frame to be decoded carries out.Decoding may include in prediction, inverse transformation, inverse quantization and entropy decoding At least one, with specific reference to coding process determine.In decoding, according to the resolution information of video frame to be decoded to current The corresponding position of each reference block of reference frame, each to be decoded piece of corresponding location information of frame to be decoded, current reference frame At least one of information and motion vector are handled, processing side when processing method therein and coding side are decoded Method is matched.Such as the corresponding current reference frame of available video frame to be decoded, according to corresponding point of video frame to be decoded Resolution information handles current reference frame, obtains object reference frame, obtains target ginseng according to the motion vector information of carrying Block is examined, to be decoded piece of corresponding predicted value is obtained according to target reference block, and according to the prediction residual and prediction in coded data Value obtains rebuilding video frame.
It when decoding end is decoded, is decoded according to the corresponding resolution information of video frame to be decoded.Worked as After preceding reference frame, reference block corresponding with the encoding block of video frame to be encoded can be obtained from current reference frame, according to reference Block is decoded encoding block.Sampling processing can also be carried out to current reference frame according to video frame to be decoded, obtained corresponding Object reference frame, from object reference frame obtain with to be decoded piece of corresponding target reference block of video frame to be decoded, according to mesh Mark reference block is decoded encoding block, obtains the corresponding reconstruction video frame of video frame to be decoded.
When coding side has carried out transformation to location information, then corresponding location information is acquired in decoding process When, it needs to convert the location information accordingly, with the consistent of the target reference block that keeps coding side and decoding end to obtain Property.
It, can be according to target motion vectors list when the motion vector information carried in coded data is target motion vectors Bit resolution information resolution information corresponding with video frame to be decoded converts target motion vectors, obtains to be decoded The first motion vector under the corresponding resolution information of video frame obtains to be decoded piece of corresponding target according to the first motion vector Reference block.
When the motion vector information carried in coded data is motion vector difference, current to be decoded piece of acquisition corresponding Initial predicted motion vector, to each to be decoded piece of corresponding motion vector difference and predicted motion vector under equal resolution into Row processing, obtain corresponding to be decoded piece corresponding to and the first motion vector under the resolution ratio of video frame to be decoded, according to First motion vector obtains to be decoded piece of corresponding target reference block.
It can be the target prediction motion vector under target resolution by initial predicted motion vector transform, it is pre- according to target It surveys motion vector and motion vector difference obtains target motion vectors, then target motion vectors are transformed into video frame to be decoded Resolution ratio under the first motion vector.It can also be by initial predicted motion vector transform under the resolution ratio of video frame to be decoded Predicted motion vector, motion vector difference is transformed to the motion vector difference under the resolution ratio of video frame to be decoded, according to Motion vector difference under the resolution ratio of video frame to be decoded and the predicted motion vector under the resolution ratio of video frame to be decoded Obtain the first motion vector.
Decoding end can determine that third is sweared according to the corresponding resolution information of video frame to be decoded and first resolution information Change of variable parameter, first resolution information include the resolution ratio of target motion vectors unit resolution rate information or current reference frame Information;Each to be decoded piece of corresponding target motion vectors in video frame to be decoded are obtained according to coded data;It is sweared according to third Change of variable parameter and target motion vectors obtain each to be decoded piece of corresponding target reference block in video frame to be decoded;According to Target reference block is decoded coded data, obtains the corresponding reconstruction video frame of video frame to be decoded.
Third vector parameter is for converting the location information or motion vector that obtain motion vector.Third Vector parameters can be the ratio between first resolution information and the resolution information of frame to be decoded, third vector parameters and the One vector parameters are corresponding.It, can be by target when being converted using third vector parameters on target motion vector Under motion vector transform to the corresponding resolution ratio of frame to be decoded, corresponding motion vector, then third vector parameters can be The inverse of one vector parameters.When being converted using third vector parameter to the corresponding location information of motion vector, such as The first vector parameter is for converting first location information in fruit coding side, then due to be decoded piece and encoding block Location information is identical, therefore third vector parameter is identical as the first vector parameter.If the first vector in coding side Transformation parameter is for converting second location information, due to being calculated according to target motion vectors and first location information The positional value arrived is to carry out transformed positional value to second location information to according to the first vector parameter in coding side, Therefore third vector parameter is the inverse of the first vector parameter.
When carrying target motion vectors in coded data, target motion vectors are read from coded data.Work as coded number According to middle carrying be motion vector difference when, then target prediction motion vector can be calculated, according to motion vector difference and mesh Mark predicted motion vector obtains target motion vectors.
After decoding end obtains third vector parameter, according to third vector parameter to obtained motion vector or The corresponding location information of motion vector is converted, and the corresponding location information of target reference block is obtained, to obtain object reference Block.
After obtaining target reference block, according to carrying to be decoded piece pre- in the pixel value of target reference block and coded data Residual error is surveyed, the pixel value for rebuilding each image block of video frame is obtained, obtains rebuilding video frame.
Determine that third vector is joined according to the corresponding resolution information of video frame to be decoded and first resolution information Several steps includes: to determine third according to the resolution information of the corresponding resolution information of video frame to be decoded and current reference frame Vector parameter;It is obtained according to third vector parameter and target motion vectors each to be decoded in video frame to be decoded The step of block corresponding target reference block includes: to obtain current to be decoded piece of corresponding first location information;According to first position Information, third vector parameter and target motion vectors obtain current to be decoded piece of corresponding target reference block.
Target reference block pair can be obtained according to first location information, third vector parameter and target motion vectors The second location information answered obtains target reference block according to second location information.Due to coding and decoded correspondence, if compiled The first vector parameter is for converting first location information in code end, then due to be decoded piece and the position of encoding block Information is identical, therefore third vector parameter is identical as the first vector parameter.If the first vector in coding side Parameter is for converting second location information, due to what is be calculated according to target motion vectors and first location information Positional value is to carry out transformed positional value to second location information to according to the first vector parameter in coding side, therefore Third vector parameter is the inverse of the first vector parameter.
In one embodiment, it is determined according to the corresponding resolution information of video frame to be decoded and first resolution information The step of third vector parameter includes: according to the corresponding resolution information of video frame to be decoded and target motion vectors unit Resolution information determines third vector parameter;It is obtained according to third vector parameter and target motion vectors to be decoded The step of each to be decoded piece of corresponding target reference block includes: to be become according to target motion vectors and third vector in video frame It changes parameter and obtains the first motion vector;Current to be decoded piece of corresponding target reference block is obtained according to the first motion vector.
Specifically, third vector parameter is according to the corresponding resolution information of video frame to be decoded and target movement arrow Measure what unit resolution rate information determined, for transforming to target motion vectors corresponding the under the corresponding resolution ratio of band decoding frame One motion vector.It, can be by third vector parameter and target motion vectors phase after obtaining third vector parameter Multiply, using obtained product as the first motion vector.It is appreciated that according to third vector parameter and target motion vectors It obtains this process of the first motion vector and present encoding block is obtained according to the first vector parameter and the first motion vector Corresponding target motion vectors are inverse process.
In one embodiment, when what is carried in coded data is motion vector difference, then according to coded data obtain to The step of each to be decoded piece of corresponding target motion vectors includes: to obtain view to be decoded according to coded data in decoding video frame Current to be decoded piece of corresponding motion vector difference in frequency frame;Obtain current to be decoded piece of corresponding initial predicted motion vector; According to the corresponding current motion vector unit resolution rate information of initial predicted motion vector and target motion vectors unit resolution rate Information obtains the second vector coefficient;It is currently decoded according to initial predicted motion vector and the second vector coefficient The corresponding target prediction motion vector of block;Target motion vectors are obtained according to target prediction motion vector and motion vector difference.
In one embodiment, with block to be encoded be with to be decoded piece in cataloged procedure due to decoding it is corresponding, initially in advance It is identical to survey motion vector acquisition rule, therefore current to be decoded piece of corresponding initial motion predictive vector and current block to be encoded pair The initial predicted motion vector answered is consistent, and the method for obtaining target prediction motion vector is referred to the side in cataloged procedure Method specifically repeats no more.Target motion vectors be target prediction motion vector and motion vector difference and.
In the present embodiment, can flexible choice correspond to the corresponding current reference frame of frame to be decoded sample mode, with right Current reference frame carries out corresponding sampling processing, and then obtains object reference frame.Further according to object reference frame treat decoding frame into Row decoding obtains rebuilding video frame.Due to can be with the sample mode of flexible choice current reference frame, to be carried out to current reference frame Sampling reconstruction adjusts current reference frame resolution ratio, even if current reference frame is different from the current resolution ratio of frame to be decoded, can also make For reference frame, the service efficiency of reference frame is improved, so that the accuracy of inter-prediction can be improved, reduces prediction residual, in turn Improve the quality of decoding image.
The step of obtaining decoding video frame sequence, which specifically includes the following contents: according to expression resolution ratio relationship Identification information determines and rebuilds video frame sample mode;According to video frame sample mode is rebuild, carried out at sampling to video frame is rebuild Reason, obtains decoding video frame;Decoding video frame sequence is obtained according to decoding video frame.
The identification information of resolution ratio relationship is the corresponding relationship of the resolution ratio between mark video frame to be encoded and reference frame. Decoding end determines the resolution ratio relationship between video frame to be encoded and reference frame according to the identification information of resolution ratio relationship.Decode section The resolution information that video frame to be encoded is extracted from resolution ratio relationship, according to the resolution ratio for the video frame to be encoded extracted Information, which determines, rebuilds video frame sample mode, carries out sampling processing to video frame is rebuild, obtains decoding video frame.Decode section according to Timestamp in decoding video frame arranges decoding video frame to obtain decoding video frame sequence.
Decoding end extracts video frame resolution information to be encoded from resolution ratio relationship.When the video to be encoded extracted When frame resolution information is down-sampling video frame to be encoded, then decoding end determines that rebuilding video frame sample mode is up-sampling treatment Mode carries out up-sampling treatment to video frame is rebuild according to up-sampling treatment mode, obtains decoding video frame.
When the video frame resolution information to be encoded extracted video frame to be encoded for former resolution ratio, then it is direct to decode section To rebuild video frame as decoding video frame.
According to video frame sample mode is rebuild, sampling processing is carried out to video frame is rebuild, it includes: true for obtaining decoding video frame Determine the scope of application of resolution ratio relationship;The scope of application includes frame sequence range and frame group range;According to reconstruction video frame sampling side Formula, reconstruction video frame corresponding to the scope of application carry out sampling processing, obtain the corresponding decoding video frame of the scope of application.
The scope of application of resolution ratio relationship is to be applicable in the video frame range of resolution ratio relationship, and being applicable in can be frame sequence range Or frame group range.
When resolution ratio relationship the scope of application be frame sequence range, determine the reconstruction video frame within the scope of frame sequence, according to Video frame sample mode is rebuild, sampling processing is carried out to the reconstruction video frame within the scope of frame sequence, is obtained within the scope of frame sequence Decoding video frame generates decoding video frame sequence according to decoding video frame.
The scope of application is frame group range;According to reconstruction video frame sample mode, reconstruction video frame corresponding to the scope of application Sampling processing is carried out, obtaining the corresponding decoding video frame of the scope of application includes: according to reconstruction video frame sample mode, to frame group model It encloses corresponding reconstruction video frame and carries out sampling processing, obtain the corresponding decoding video frame of frame group range.It is obtained according to decoding video frame Decoding video frame sequence includes: to generate decoding video frame group according to the corresponding decoding video frame of frame group range;According to the solution of generation Code video frame group constitutes decoding video frame sequence.
When resolution ratio relationship the scope of application be frame group range, the reconstruction video frame within the scope of frame group is determined, according to reconstruction Video frame sample mode carries out sampling processing to the reconstruction video frame within the scope of frame group, obtains the decoding video within the scope of frame group Frame constructs decoding video according to the decoding video frame within the scope of each frame group to obtain the decoding video frame within the scope of each frame group Frame sequence.The corresponding reconstruction video frame sample mode of reconstruction video frame within the scope of different frame groups can be different.Rebuild video Frame sampling mode includes rebuilding video frame up-sampling mode and reconstruction video frame down-sampling mode.
According to the scope of application of resolution ratio relationship, according to reconstruction video frame sample mode to the reconstruction video in the scope of application Frame carries out sampling processing, obtains decoding video frame, to obtain sequence of frames of video according to decoding video frame, improves resolution ratio pass The decoding quality of decoding video frame in the scope of application of system.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection of the invention Range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.

Claims (1)

1. a kind of video frame coding/decoding method, which is characterized in that the described method includes:
Obtain the coded data of video frame to be decoded;
According to the identification information for indicating resolution ratio relationship in the coded data, the resolution ratio determination side of current reference frame is determined Formula;
According to the resolution ratio method of determination, the corresponding current reference frame of the video frame to be decoded is generated;
Obtain the resolution information of the video frame to be decoded and the current reference frame;
The sample mode of the current reference frame is determined according to the resolution information: when the resolution ratio of the video frame to be decoded When resolution ratio represented by information is less than resolution ratio represented by the resolution information of the current reference frame, determine described current The sample mode of reference frame is down-sampling processing mode;The resolution ratio represented by the resolution information of the video frame to be decoded When resolution ratio represented by the resolution information greater than the current reference frame, determine that the sample mode of the current reference frame is Up-sampling treatment mode;
According to the resolution information of the sample mode and the video frame to be decoded, the current reference frame is carried out at sampling Reason, obtains object reference frame;
The video frame to be decoded is decoded according to the object reference frame, it is corresponding heavy to obtain the video frame to be decoded Build video frame;
According to the identification information for indicating resolution ratio relationship, determines and rebuild video frame sample mode;
Determine the scope of application of the resolution ratio relationship;The scope of application includes frame sequence range and frame group range;
According to the reconstruction video frame sample mode, reconstruction video frame corresponding to the scope of application carries out sampling processing, obtains To the corresponding decoding video frame of the scope of application;
Decoding video frame sequence is obtained according to the decoding video frame.
CN201811342314.4A 2018-11-13 2018-11-13 A kind of video frame coding/decoding method Pending CN109618154A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811342314.4A CN109618154A (en) 2018-11-13 2018-11-13 A kind of video frame coding/decoding method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811342314.4A CN109618154A (en) 2018-11-13 2018-11-13 A kind of video frame coding/decoding method

Publications (1)

Publication Number Publication Date
CN109618154A true CN109618154A (en) 2019-04-12

Family

ID=66003084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811342314.4A Pending CN109618154A (en) 2018-11-13 2018-11-13 A kind of video frame coding/decoding method

Country Status (1)

Country Link
CN (1) CN109618154A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572673A (en) * 2019-09-27 2019-12-13 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, storage medium and electronic device
CN112771830A (en) * 2019-11-29 2021-05-07 深圳市大疆创新科技有限公司 Data transmission method, device, system and storage medium
US20220092739A1 (en) * 2020-09-21 2022-03-24 Shanghai United Imaging Healthcare Co., Ltd. Systems and methods for image processing

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110572673A (en) * 2019-09-27 2019-12-13 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, storage medium and electronic device
CN110572673B (en) * 2019-09-27 2024-04-09 腾讯科技(深圳)有限公司 Video encoding and decoding method and device, storage medium and electronic device
CN112771830A (en) * 2019-11-29 2021-05-07 深圳市大疆创新科技有限公司 Data transmission method, device, system and storage medium
US20220092739A1 (en) * 2020-09-21 2022-03-24 Shanghai United Imaging Healthcare Co., Ltd. Systems and methods for image processing
US11935211B2 (en) * 2020-09-21 2024-03-19 Shanghai United Imaging Healthcare Co., Ltd. Systems and methods for image processing

Similar Documents

Publication Publication Date Title
EP3211894B1 (en) Method and apparatus for performing graph-based prediction by using optimization function
CN108848376A (en) Video coding, coding/decoding method, device and computer equipment
CN108769682A (en) Video coding, coding/decoding method, device, computer equipment and storage medium
CN109618159A (en) A kind of self-adaptive encoding method based on resolution ratio corresponding relationship
CN109618154A (en) A kind of video frame coding/decoding method
CN108028945A (en) The apparatus and method of conversion are performed by using singleton coefficient update
CN109600615A (en) A method of video is decoded based on motion information
CN109618160A (en) A kind of method for video coding calculated based on motion information and residual information
US10666960B2 (en) Method and device for performing graph-based transform using generalized graph parameter
US11593968B2 (en) Coefficient context modeling in video coding
CN108182712B (en) Image processing method, device and system
Niu et al. Edge-based perceptual image coding
CN109618168A (en) It is a kind of based on divide pixel value difference handle video encoding/decoding method
Antonio et al. Learning-based compression of visual objects for smart surveillance
WO2020053688A1 (en) Rate distortion optimization for adaptive subband coding of regional adaptive haar transform (raht)
CN109660804A (en) A kind of video frame coding/decoding method based on model selection
CN109618167A (en) A kind of image encoding method based on interpolation processing
CN109495740A (en) A method of image is encoded based on environmental information
CN109600614A (en) A kind of video frame reconstruction method based on down-sampling
CN109862358A (en) A kind of picture frame coding/decoding method based on environmental information
US20250234022A1 (en) Neural network-based coding and decoding
Fryza A Complete Video Coding Chain Based on Multi-Dimensional Discrete Cosine Transform.
WO2025153943A1 (en) Neural network-based coding and decoding
CN119731698A (en) Rate distortion optimization for time-varying texture grid compression
HK40070666A (en) Deep loop filtering by temporal deformable convolution

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190412

WD01 Invention patent application deemed withdrawn after publication