WO2019100712A1 - 视频编码方法、计算机设备和存储介质 - Google Patents

视频编码方法、计算机设备和存储介质 Download PDF

Info

Publication number
WO2019100712A1
WO2019100712A1 PCT/CN2018/092688 CN2018092688W WO2019100712A1 WO 2019100712 A1 WO2019100712 A1 WO 2019100712A1 CN 2018092688 W CN2018092688 W CN 2018092688W WO 2019100712 A1 WO2019100712 A1 WO 2019100712A1
Authority
WO
WIPO (PCT)
Prior art keywords
image frame
current
quantization parameter
frame
obtaining
Prior art date
Application number
PCT/CN2018/092688
Other languages
English (en)
French (fr)
Inventor
毛煦楠
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to JP2019563158A priority Critical patent/JP6906637B2/ja
Priority to EP18880220.1A priority patent/EP3716624A4/en
Priority to KR1020197035254A priority patent/KR102263979B1/ko
Publication of WO2019100712A1 publication Critical patent/WO2019100712A1/zh
Priority to US16/450,705 priority patent/US10944970B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/124Quantisation
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/114Adapting the group of pictures [GOP] structure, e.g. number of B-frames between two anchor frames
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame 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/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/187Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a scalable video layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/463Embedding additional information in the video signal during the compression process by compressing encoding parameters before transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/573Motion compensation with multiple frame prediction using two or more reference frames in a given prediction direction
    • 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/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • H04N19/31Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability in the temporal domain

Definitions

  • the present application relates to the field of video coding, and in particular to a video coding method, apparatus, computer device and storage medium.
  • the encoding rate of the image can be adjusted by the quantization parameter (QP) of the video adjustment encoder, so that a stable code rate and a smaller video can be guaranteed under the limitation of the video transmission bandwidth. Delay.
  • the quantization parameter of each image frame the quantization parameter of the current image frame needs to be calculated according to the set code rate control model, the calculation complexity is large, and the video coding efficiency is low.
  • a video encoding method, computer device, and storage medium are provided.
  • a video encoding method comprising:
  • the computer device obtains a current image frame to be encoded
  • the computer device encodes the current image frame based on the current quantization parameter.
  • a computer device comprising a memory and a processor, the memory storing computer readable instructions, the computer readable instructions being executed by the processor such that the processor performs the following steps:
  • the current image frame is encoded according to the current quantization parameter.
  • One or more non-volatile storage media storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the following steps:
  • the current image frame is encoded according to the current quantization parameter.
  • FIG. 1A is an application environment diagram of a video encoding method provided in an embodiment
  • FIG. 1B is an application environment diagram of a video encoding method provided in an embodiment
  • 2A is a flowchart of a video encoding method in an embodiment
  • 2B is a schematic diagram of a temporal layered B frame coding structure in an embodiment
  • FIG. 3 is a flowchart of obtaining a current quantization parameter offset corresponding to a current image frame according to a current layer in an embodiment
  • FIG. 4 is a flowchart of obtaining reference quantization parameters corresponding to a reference image frame of a current image frame in an embodiment
  • FIG. 5 is a flow chart of encoding a current image frame according to a current quantization parameter in one embodiment
  • FIG. 6 is a flow chart of a video encoding method in an embodiment
  • FIG. 7 is a flow chart of a video encoding method in an embodiment
  • FIG. 8 is a flowchart of obtaining a current quantization parameter corresponding to a current image frame according to a reference quantization parameter and a current quantization parameter offset according to an embodiment
  • Figure 9 is a block diagram showing the structure of a video encoding apparatus in an embodiment
  • FIG. 10 is a structural block diagram of a current quantization parameter obtaining module in an embodiment
  • FIG. 11 is a structural block diagram of a reference quantization parameter acquisition module in an embodiment
  • FIG. 12 is a structural block diagram of an encoding module in an embodiment
  • Figure 13 is a block diagram showing the structure of a video encoding apparatus in an embodiment
  • Figure 14 is a block diagram showing the structure of a video encoding apparatus in an embodiment
  • 15 is a structural block diagram of a current offset obtaining module in an embodiment
  • Figure 16 is a block diagram showing the internal structure of a computer device in an embodiment.
  • Figure 17 is a block diagram showing the internal structure of a computer device in one embodiment.
  • FIG. 1A is an application environment diagram of a video encoding method provided in an embodiment.
  • video encoding since the content of each frame in the video image is different and the complexity is different, the number of bits of each frame of the encoding is constant. The changes, and the transmission channel is constantly changing, so you need to set the encoder buffer to balance the encoding bit rate and bandwidth.
  • the video image sequence is input to the video encoder 1
  • the coded stream encoded by the video encoder 1 is input to the encoder buffer 2 for buffering and transmitted through the network.
  • the code rate controller 3 adjusts the quantization parameter on the video encoder according to the set rate control model to control the code rate obtained by the video encoder for video encoding, and prevents the encoder buffer 2 from overflowing or underflowing.
  • the video coding method in the embodiment of the present application may be applied to a computer device.
  • the computer device may be an independent physical server or a terminal, or may be a server cluster composed of multiple physical servers, and may be a cloud server, a cloud database, a cloud storage, and the like.
  • Cloud server for basic cloud computing services such as CDN.
  • the terminal can be a smart phone, a tablet, a laptop, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto.
  • the terminal 110 or the server 120 may perform video encoding by an encoder or video decoding by a decoder.
  • the terminal 110 or the server 120 may also perform video encoding by running a video encoding program by the processor, or performing video decoding by running a video decoding program by the processor.
  • the server 120 may directly transmit the encoded data to the processor for decoding, or may store it in the database for subsequent decoding.
  • the encoded data may be directly sent to the terminal 110 through the output interface, or the encoded data may be stored in a database for subsequent transmission.
  • the encoded data refers to encoding the image frame. The data obtained.
  • a video encoding method is proposed.
  • the present embodiment is mainly applied to the foregoing computer device by using the method, and may specifically include the following steps:
  • Step S202 Acquire a current image frame to be encoded.
  • the video is composed of a sequence of images. Each image can be considered as one frame.
  • the current image frame refers to the image frame that is currently encoded.
  • the video image sequence is input to the video encoder, and the video encoder acquires the image frame to be encoded according to a preset order for encoding.
  • Step S204 Acquire a current layer where the current image frame is located in the image group in which the image frame is located, and the image group includes a plurality of image frames.
  • a group of pictures refers to a group of consecutive images, which can form a group of consecutive images in a sequence of video images to facilitate random access editing.
  • Images in an image group The number of frames may be set according to actual needs, for example, may be 8.
  • the image group may include three types of frames: I frame, P frame, and B frame, where I frame is an intra prediction frame, and P frame is a one-way frame.
  • the prediction frame can be predicted by inter-frame prediction.
  • the B-frame is a bi-directional prediction frame, which can be referenced by referring to the previous image frame or the subsequent image frame.
  • the current layer refers to the layer in which the current image frame is located in the image group.
  • the layered coding structure may be preset, and the layer of the image frame in the image group is obtained according to the layered coding structure.
  • the layered coding structure refers to dividing the image frame in the image group into multiple layers for coding, and different layers may be used. Corresponding to different coding qualities, the specific layering method can be set according to actual needs or application scenarios. For example, layering according to the time sequence of image frames in the image group, Time layered B frame coding structure (hierarchical B structure).
  • the layered coding structure sets the number of layers, the image frames corresponding to each layer, and the reference relationship between image frames.
  • the upper layer image frames can be referred to the lower layer image frames. Encoding.
  • Hierarchical coding structure hierarchical coding structure
  • the number of middle layers can be set according to actual needs.
  • the image group can be divided into 2 layers, 3 layers or 4 layers.
  • the coding order of the image frames in the image group is obtained according to the layered coding structure, and the image is obtained.
  • the image frames in the group are encoded, and after the current image frame is obtained, the current layer corresponding to the current image frame can be obtained according to the layered coding structure.
  • one image group includes 8 image frames
  • the B-frame of the image group is divided into 3 layers: B0 layer, B1 layer, and B2 layer, wherein B0 layer Including the 4th B frame, the B1 layer includes the 2nd and 6th B frames, the remaining B frame image frames belong to the B2 layer, the start of the arrow represents the reference frame image, and the direction of the arrow indicates the encoding according to the reference frame.
  • the image frames are sorted according to the display order of the image frames, and the time-layered B-frame coding structure is as shown in FIG. 2B.
  • a high-level image frame may be encoded with reference to a lower layer image frame.
  • a reference frame of an image frame of a B0 layer is a P frame at both ends.
  • the image frame of the B2 layer can be encoded with reference to the image frame of the B1 layer.
  • the time layered B frame coding structure is not limited to a three layer coding structure, and may be, for example, a two layer, four layer, or the like coding structure.
  • Step S206 Obtain a current quantization parameter offset corresponding to the current image frame according to the current layer, and image frames of different layers in the image group correspond to different quantization parameter offsets.
  • quantization is needed to reduce the amount of data, and the value of the residual residual cosine transform of the prediction residual is mapped to a smaller value, for example, A smaller value is obtained by dividing by the quantization step size.
  • the quantization parameter is the sequence number of the quantization step size, and the corresponding quantization step size can be found according to the quantization parameter.
  • the quantization parameter is small, most of the details of the image frame are preserved, and the corresponding code rate is high. If the quantization parameter is large, the corresponding code rate is low, but the image distortion is large and the quality is not high. That is, the relationship between the quantization parameter and the code rate is negatively correlated.
  • the basic method of rate control in the encoding process is to control the code rate corresponding to the image by adjusting the quantization parameter.
  • the quantization parameter offset refers to the quantization parameter offset value of the encoded image frame relative to its reference frame.
  • the image frames of different layers in the image group correspond to different quantization parameter offsets, and the offsets of the quantization parameters corresponding to the image frames of different layers may be preset, and may be set according to actual needs.
  • the quantization parameter offsets of the first to third layers may be 0.42, 0.8, and 1.2, respectively.
  • the upper layer image frame can be encoded with reference to the lower layer image frame, so the upper layer image frame is less referenced, and the lower layer image frame is referenced more frequently, so the higher layer corresponding quantization parameter can be set.
  • the shift amount is larger than the quantization parameter offset of the lower layer. That is, the correspondence between the level of the image frame and the offset of the quantization parameter is a positive correlation to improve the compression efficiency of the video coding.
  • Step S208 Acquire a reference quantization parameter corresponding to a reference image frame of the current image frame.
  • the reference frame is used to predict the encoded image frame, and the method for selecting the reference frame may be set according to actual needs.
  • the reference image frame is a reference frame selected from a list of candidate reference frames of the current image frame.
  • the reference frame can be selected, for example, based on spatial similarity or the like.
  • taking the current image frame as a B frame that is, a bidirectional prediction frame
  • each B frame has two candidate reference frame sequences
  • the first image frame of the two candidate reference frame sequences can be respectively taken as a reference image. frame.
  • the reference quantization parameter may be an encoding quantization parameter when the reference image frame is encoded.
  • the reference quantization parameter may also be obtained by combining the coding quantization parameter corresponding to the reference image frame and the corresponding quantization parameter offset.
  • the reference quantization parameter is the quantization quantization parameter corresponding to the reference image frame minus the quantization parameter offset corresponding to the reference image frame.
  • the reference quantization parameter may be an average of the quantization parameters in the reference image frame.
  • Step S210 Obtain a current quantization parameter corresponding to the current image frame according to the reference quantization parameter and the current quantization parameter offset.
  • the current quantization parameter corresponding to the current image frame is obtained by combining the reference quantization parameter and the current quantization parameter offset.
  • the current quantization parameter may be the sum of the reference quantization parameter and the current quantization parameter offset.
  • the current quantization parameter can also be obtained by combining the frame distance of the reference image frame with the current image frame. For example, the weight corresponding to the frame distance is set, and the influence value corresponding to the reference image frame is obtained according to the weight corresponding to the reference image frame and the coded quantization parameter of the reference image frame, and the current quantization parameter is obtained according to the influence value and the current quantization parameter offset.
  • Step S212 encoding the current image frame according to the current quantization parameter.
  • the corresponding relationship between the quantization parameter and the quantization step size is preset, so that the corresponding quantization step size can be obtained according to the current quantization parameter, and the current image frame is quantized according to the quantization step size.
  • the Round(x) function refers to rounding off the quantized values.
  • the correspondence between the quantization parameter and the quantization step size can be set as needed.
  • the quantization step has a total of 52 values, which is an integer between 0 and 51.
  • the quantization step has a value between 0 and 39. The integer is incremented, and the quantization step size increases as the quantization parameter increases. Each time the quantization parameter is increased by 6, the quantization step size is doubled. It can be understood that when the quantization parameter in the correspondence between the quantization parameter and the quantization step is an integer, the current quantization parameter may be rounded, and the rounding method may be rounding off an integer.
  • the above video encoding method can be used for compression of video files, such as compression of WeChat small videos.
  • the current layer in which the current image frame is located is obtained, and then the quantization parameter offset corresponding to the current image frame is obtained according to the current layer, and the reference image of the current image frame is obtained.
  • a reference quantization parameter corresponding to the frame obtaining a current quantization parameter corresponding to the current image frame according to the reference quantization parameter and the quantization parameter offset, thereby encoding the current image frame according to the current quantization parameter, because the current image frame to be encoded is located
  • the quantization parameter offset corresponding to the current layer and the coding quantization parameter corresponding to the reference image frame obtain the current quantization parameter corresponding to the current image frame, the computational complexity is small, and the quantization parameter offset is flexibly changed according to the needs of different layer image frames.
  • the coding efficiency is high.
  • the current image frame is a bidirectional prediction frame
  • the step of obtaining the current quantization parameter offset corresponding to the current image frame according to the current layer includes:
  • Step S302 Acquire a quantization offset parameter between the preset image frame of the current layer and the unidirectional prediction frame.
  • quantization offset parameters corresponding to unidirectional prediction frames may be set for different layers of each hierarchical coding structure.
  • the quantization parameter offset is calculated according to the quantization offset parameter, and the quantization parameter offset is positively correlated with the quantization offset parameter.
  • the formula for obtaining the quantization offset by the quantization offset parameter may be obtained according to the correspondence between the quantization step size and the quantization parameter. For example, for the current luminance coding, the quantization step has a total of 52 values, which is an integer between 0 and 51. And the quantization parameter has a correlation with the quantization step size, and the quantization parameter increases as the quantization step size increases.
  • the quantization parameter When the quantization parameter is increased by 6, the quantization parameter is doubled, and the quantization parameter offset is based on 2
  • the logarithm of the quantized offset parameter is the product of 6.
  • the specific value of the quantization offset parameter can be preset according to needs or experience.
  • the quantization offset parameter between the unidirectional prediction frame and the unidirectional prediction frame is smaller than the quantization parameter corresponding to the high-level bidirectional prediction frame, so that the quantization offset parameter is greater than 1.
  • the quantization offset parameters corresponding to the B0 layer, the B1 layer, and the B2 layer may be 1.05, 1.10, and 1.15, respectively.
  • Step S304 obtaining a current quantization parameter offset corresponding to the current image frame according to the quantization offset parameter.
  • the current quantization parameter offset corresponding to the current image frame may be obtained according to the obtained quantization offset parameter and the corresponding calculation formula.
  • the specific calculation formula can be obtained according to the correspondence between the quantization step size and the quantization parameter.
  • the step of acquiring the reference quantization parameter corresponding to the reference image frame of the current image frame in step S208 includes:
  • Step S402 acquiring a reference frame type of the reference image frame and an encoding quantization parameter of the reference image frame.
  • the reference frame type may include an I frame, a B frame, and a P frame.
  • the type of reference frame can be set as needed or set by different video coding standards. For example, in some video coding standards such as H26.3, B frames cannot be used as reference frames. In some video coding standards, a B frame can be used as a reference frame.
  • the coded quantization parameter of the reference picture frame refers to the quantization parameter used when encoding the reference picture frame.
  • Step S404 obtaining a reference quantization parameter corresponding to the reference image frame according to the reference frame type and the coding quantization parameter.
  • the coding quantization parameter corresponding to the reference image frame may be adjusted according to different reference frame types to obtain a reference quantization parameter.
  • the coded quantization parameter corresponding to the reference image frame may be used as a reference quantization parameter.
  • the reference quantization parameter can be obtained by combining the quantization parameter offset and the coding quantization parameter.
  • the reference quantization parameter is obtained by subtracting the quantization parameter offset corresponding to the reference frame from the coding quantization parameter corresponding to the reference image frame.
  • the method for obtaining the current quantization parameter according to the reference quantization parameter of the reference image frame and the current quantization parameter offset provided by the embodiment of the present application may be used.
  • the current quantization parameter of the current image frame may be calculated without using the method provided in the embodiment of the present application, for example, the current image frame is a P frame, and the current image is calculated according to the code rate control model.
  • the current quantization parameter corresponding to the frame controls the code rate to avoid large error in the code rate.
  • the rate control model can adopt RM8 (reference mode 8) and VM8 (verification mode 8), etc., and is not limited.
  • the current quantization parameter corresponding to the current image frame may be calculated by using a rate control model, and the quantization parameter offset of the P frame relative to the I frame may also be set, and then the quantization corresponding to the P frame may be used.
  • the parameter and the quantization parameter offset of the P frame relative to the I frame obtain the current quantization parameter corresponding to the current image frame.
  • the quantization parameter corresponding to the I frame is the coding quantization parameter corresponding to the P frame minus the quantization parameter offset of the P frame relative to the I frame, that is, the I frame is smaller than the quantization parameter corresponding to the P frame, and the I frame corresponds to The coding accuracy is high and the image distortion is small.
  • the quantization parameter corresponding to the P frame closest to the I frame may be selected minus the quantization parameter offset of the P frame relative to the I frame.
  • the current image frame is a bidirectional prediction frame
  • the step of obtaining the reference quantization parameter corresponding to the reference image frame according to the reference frame type and the coding quantization parameter includes: when the reference frame type is a bidirectional prediction frame, acquiring the reference image frame at The layer in which the image group is located.
  • the reference quantization parameter offset corresponding to the reference image frame is obtained according to the layer in which the reference image frame is located in the image group. And determining a reference quantization parameter corresponding to the reference image frame according to the coding quantization parameter and the reference quantization parameter offset corresponding to the reference image frame.
  • the reference quantization parameter offset refers to a quantization parameter offset corresponding to a layer where the reference image frame is located.
  • the quantization parameter offset is obtained according to the current layer corresponding to the image frame, and the corresponding current quantization parameter is obtained according to the quantization parameter offset and the reference quantization parameter of the reference image frame, and therefore, if reference is made.
  • the coded quantization parameter corresponding to the reference image frame is also obtained by using the quantization parameter offset corresponding to the layer in which it is located and the reference quantization parameter corresponding to the reference image frame.
  • the reference image frame is a bidirectionally predicted frame
  • the reference quantization parameter corresponding to the reference image frame is obtained according to the coded quantization parameter of the reference image frame and the reference quantization parameter offset corresponding to the reference image frame.
  • the reference quantization parameter is the difference between the encoded quantization parameter and the reference quantization parameter offset. Specifically, it can be set as needed.
  • the step of encoding the current image frame according to the current quantization parameter includes:
  • Step S502 obtaining a current quantization step size corresponding to the current image frame according to the current quantization parameter.
  • the quantization step corresponding to the current quantization parameter is obtained as the current quantization step according to the correspondence between the quantization parameter and the quantization step.
  • Step S504 encoding the current image frame according to the current quantization step size, to obtain a current code rate corresponding to the current image frame.
  • the code rate refers to the number of data bits transmitted per unit time.
  • the current code rate refers to the code rate corresponding to the current image frame code encoded by the current quantization step size.
  • the rate unit can be the number of bits transmitted per second. The higher the rate, the faster the data is transmitted. Encoding according to the current quantization step size, and obtaining the current code rate corresponding to the current image frame after encoding.
  • the current image frame is a bidirectional predicted frame.
  • the video encoding method further includes the following steps:
  • Step S602 acquiring a preset quantization offset parameter of the image frame of the current layer and the unidirectional prediction frame.
  • the quantization parameter offset is calculated based on the quantization offset parameter. Since the current quantization parameter of the current image frame is obtained according to the current quantization parameter offset of the current image frame, the code rate corresponding to the current image frame may be corrected according to the quantization offset parameter when the image complexity parameter is calculated, and the correction is obtained. The subsequent code rate then calculates the corresponding image complexity parameter to improve the accuracy of the image complexity parameter.
  • Step S604 obtaining a corresponding complexity update value according to the current code rate corresponding to the current image frame and the quantization offset parameter.
  • the image complexity parameter is used to indicate the complexity of the image frame.
  • the image complexity parameter is a parameter in the rate control model that is used to calculate the quantization step size of the image frame.
  • the larger the image complexity parameter the more complex the information such as image texture and the higher the bit rate is required for transmission.
  • the complexity update value is used to update the image complexity parameter to be able to dynamically update the complexity parameters of the image.
  • Step S606 obtaining an updated image complexity parameter according to the image complexity parameter and the complexity update value corresponding to the forward image frame of the current image frame.
  • the image complexity parameter corresponding to the forward image frame refers to an image complexity parameter updated after the forward image frame is encoded.
  • a forward image frame refers to an image frame that is encoded before the current image frame. It can be the previous image frame to be able to update the image complexity parameter in time, and of course other forward image frames, which can be set as needed.
  • the image complexity parameter corresponding to the forward image frame is updated by using the complexity update value, and the updated image complexity parameter is obtained, thereby updating the image complexity parameter in the rate control model.
  • the complexity update value is derived from the corrected code rate corresponding to the current image frame and the current quantization step size.
  • the updated image complexity parameter may be the sum of the image complexity parameter and the complexity update value corresponding to the forward image frame of the current image frame, and is expressed as follows:
  • the order of the current image frame is the jth frame
  • the previous frame of the forward direction is the j-1 frame
  • the complexity parameter after encoding the j-1th image frame is cplxsum j-1
  • the bit j is the jth frame
  • the code rate corresponding to the current image frame, Scale j is the current quantization step size corresponding to the jth frame. If the current image frame is divided into multiple coding units, and each coding unit corresponds to one quantization step, Scale j may be the current image frame corresponding to The average quantization step size.
  • pbFactor_i represents the quantization offset parameter of the i-th bidirectional prediction frame and the unidirectional prediction frame.
  • the pre_param j is a pre-analysis parameter of the j-th frame, and may be the SAD (Sum of Absolute Difference) corresponding to the j-th frame, that is, the current image frame, and the SAD refers to the absolute error sum of the predicted value and the actual value of the current image frame.
  • SAD Sud of Absolute Difference
  • the video encoding method further includes the following steps:
  • Step S702 Acquire a frame type corresponding to the encoded backward image frame corresponding to the current image frame.
  • the backward image frame refers to an image frame that is encoded after the current image frame. It can be the next image frame, and of course other backward image frames, which can be set as needed.
  • the types of frames may include I frames, B frames, and P frames.
  • Step S704 when the backward image frame is a non-bidirectional prediction frame, obtain a quantization parameter corresponding to the backward image frame according to the preset code rate control model and the updated image complexity parameter.
  • the non-bidirectional prediction frame includes an I frame and a P frame.
  • the P frame may obtain the quantization parameter corresponding to the backward image frame according to the preset code rate control model and the updated image complexity parameter.
  • the image complexity parameter in the rate control model is the model parameter. Therefore, the code rate control model is updated by using the updated image complexity parameter, and the quantization parameter corresponding to the backward image frame is obtained according to the code rate control model.
  • the rate control model can be set as needed. For example, it may be a TM5 (test mode 5) algorithm. Since the quantization parameter of the backward image frame is calculated by using the rate control model when the backward image frame is a non-bidirectionally predicted frame, the error of the video bit rate may not be excessively large as the image frame increases.
  • the reference image frame is multiple.
  • the step S210 is to obtain the current quantization parameter corresponding to the current image frame according to the reference quantization parameter and the current quantization parameter offset.
  • Step S802 acquiring a frame distance between each reference image frame and a current image frame.
  • the frame distance may be represented by the number of frames in which the image frame is spaced from the image frame, or may be represented by the time difference of the display time between the image frame and the image frame.
  • the number of frames in which an image frame is spaced from an image frame can be represented by a difference in display order between image frames. For example, if the reference image frame is the second frame of the image group and the current image frame is the sixth frame of the same image group, the frame distance is 4.
  • the reference image frame may be two, for example, two reference image frames of the B frame.
  • Step S804 calculating a first quantization parameter corresponding to the current image frame according to a frame distance between each reference image frame and the current image frame and a corresponding reference quantization parameter.
  • a scaling factor corresponding to the frame distance may be set, and then the first quantization parameter corresponding to the image frame is obtained according to the scaling factor and the corresponding reference quantization parameter.
  • the weight corresponding to the current reference image frame may be obtained according to the frame distance between the current reference image frame and the current image frame, and then the current image frame correspondingly obtained according to the weight corresponding to each reference image frame and the corresponding reference quantization parameter.
  • the frame distance and the weight may be negatively correlated, such that the quantization parameter corresponding to the reference image frame that is closer to the current image frame has a greater influence on the quantization parameter of the current image frame.
  • the weight may be the reciprocal of the frame distance.
  • the current image frame is a bidirectional prediction frame
  • the first reference frame and the current image frame are separated by n 1 frame
  • the reference quantization parameter of the first reference image frame is equal to qp 1
  • the second The reference image frame and the current image frame distance are n 2 frames
  • the reference quantization parameter of the second reference image frame is equal to qp 2 .
  • the first quantization parameter is equal to the weighted average of the reference quantization parameter and the weight of the two reference image frames
  • the weight of the quantization parameter of the first reference image frame is the second reference image frame The ratio of the frame distance to the current image frame to the total frame distance.
  • the weight of the quantization parameter of the second reference image frame is the ratio of the frame distance of the first reference image frame and the current image frame to the total frame distance, according to the frame distance between each reference image frame and the current image frame and the corresponding reference
  • the first quantization parameter corresponding to the current image frame calculated by the quantization parameter may be as shown in formula (1).
  • Step S806 obtaining a current quantization parameter corresponding to the current image frame according to the first quantization parameter corresponding to the current image frame and the current quantization parameter offset.
  • the current quantization parameter corresponding to the current image frame is obtained by combining the first quantization parameter and the current quantization parameter offset.
  • the current quantization parameter may be the sum of the first quantization parameter and the current quantization parameter offset.
  • the current image frame is a bi-predictive frame and the reference image frame is two.
  • Step S210 that is, obtaining the current quantization parameter corresponding to the current image frame according to the reference quantization parameter and the current quantization parameter offset, further comprising determining whether the reference image frame is an I frame. In one embodiment, if one of the reference image frames is referenced If the reference image frame is an I frame and the other reference image frame is a P frame, steps S802 to 806 are not performed, and the reference quantization parameter corresponding to the reference image frame of the P frame and the current quantization parameter offset are obtained according to the frame type. The current quantization parameter corresponding to the current image frame.
  • the reference quantization parameter and the sum of the current quantization parameter offsets obtain the current quantization parameter corresponding to the current image frame.
  • the second quantization parameter may be obtained according to the coding quantization parameter of the two reference image frames, and then according to the second quantization parameter and the preset value. And get the current quantization parameters.
  • the second quantization parameter may be the mean of the coded quantization parameters of the two reference image frames.
  • the preset value can be set according to actual needs. For example, the preset value may be a quantization parameter offset of the P frame relative to the I frame.
  • the image group includes 8 image frames, the 8 image frame types are the first 7 B frames, and the last one is a P frame, and the reference relationship is shown in FIG. 2B as an example.
  • the video coding method provided by the example is explained.
  • the reference relationship of FIG. 2B and the reference image frame of the current image frame are encoded prior to the current image frame.
  • the first image frame encoded in the image group is the last image frame, so the last image frame of the image group is acquired. Since the current image frame is a P frame, the quantization parameter of the last image frame of the image group is calculated according to the set code rate control model and the target code rate, and the image frame is encoded according to the calculated quantization parameter.
  • the fourth image frame of the image group is obtained, and the fourth image frame is obtained as a B frame, and is a B0 layer, so the quantization parameter offset corresponding to the B0 layer is obtained.
  • the reference quantization parameter of the reference image frame of the non-I frame is added to the offset of the quantization parameter corresponding to the B0 layer to obtain the fourth The coded quantization parameter corresponding to the image frame, that is, the current quantization parameter. If the two reference frames of the fourth image frame are all I frames, calculate the mean value of the reference quantization parameters corresponding to the two reference image frames, and add the mean value to the offset of the set P frame relative to the quantization parameter of the I frame. And adding the quantization parameter offset corresponding to the B0 layer, obtaining the coding quantization parameter corresponding to the fourth image frame.
  • the frame distances of the two reference image frames and the fourth image frame are respectively obtained, and the weight corresponding to the reference image frame is calculated according to the frame distance, and then A weighted average value is obtained according to the weight corresponding to each image frame and the corresponding reference quantization parameter, and the obtained weighted average value is added to the quantization parameter offset corresponding to the B0 layer to obtain a coded quantization parameter corresponding to the fourth image frame.
  • the second image frame is sequentially acquired, and the sixth image frame, the first image frame, the third image frame, the fifth image frame, and the seventh image frame are encoded, and the encoding process can refer to the fourth
  • the flow of the image frames performed in steps 2 to 6 will not be described here.
  • the quantization parameter corresponding to the last image frame of the next image group is calculated according to the code rate control model and the image complexity parameter corresponding to the seventh image frame.
  • the various steps in the various embodiments of the present application are not necessarily performed in the order indicated by the steps. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in the embodiments may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be executed at different times, and the execution of these sub-steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of the other steps.
  • a video encoding apparatus which may specifically include:
  • the current frame obtaining module 902 is configured to acquire a current image frame to be encoded.
  • the current layer obtaining module 904 is configured to acquire a current layer where the current image frame is located in the image group in which the image frame is located, and the image group includes a plurality of image frames.
  • the current offset obtaining module 906 is configured to obtain the current quantization parameter offset corresponding to the current image frame according to the current layer, and the image frames of different layers in the image group correspond to different quantization parameter offsets.
  • the reference quantization parameter obtaining module 908 is configured to acquire a reference quantization parameter corresponding to the reference image frame of the current image frame.
  • the current quantization parameter obtaining module 910 is configured to obtain a current quantization parameter corresponding to the current image frame according to the reference quantization parameter and the current quantization parameter offset.
  • the encoding module 912 is configured to encode the current image frame according to the current quantization parameter.
  • the reference image frame is multiple
  • the current quantization parameter obtaining module 910 includes:
  • the frame distance obtaining unit 910A is configured to acquire a frame distance between each reference image frame and the current image frame.
  • the parameter calculation unit 910B is configured to calculate, according to a frame distance between each reference image frame and the current image frame, and a corresponding reference quantization parameter, a first quantization parameter corresponding to the current image frame.
  • the current quantization parameter obtaining unit 910C is configured to obtain a current quantization parameter corresponding to the current image frame according to the first quantization parameter corresponding to the current image frame and the current quantization parameter offset.
  • the parameter calculation unit 910B is configured to: obtain a weight corresponding to the current reference image frame according to a frame distance between the current reference image frame and the current image frame, where the frame distance and the weight are negatively correlated. Obtaining a first quantization parameter corresponding to the current image frame according to the weight corresponding to each reference image frame and the corresponding reference quantization parameter.
  • the reference quantization parameter acquisition module 908 includes:
  • the reference frame information obtaining unit 908A is configured to acquire a reference frame type of the reference image frame and an encoding quantization parameter of the reference image frame.
  • the reference quantization parameter obtaining unit 908B is configured to obtain a reference quantization parameter corresponding to the reference image frame according to the reference frame type and the encoding quantization parameter.
  • the current image frame is a bidirectionally predicted frame
  • the reference quantization parameter obtaining unit 908B is configured to: when the reference frame type is a bidirectionally predicted frame, acquire a layer in which the reference image frame is located in the image group in which it is located.
  • the reference quantization parameter offset corresponding to the reference image frame is obtained according to the layer in which the reference image frame is located in the image group. And determining a reference quantization parameter corresponding to the reference image frame according to the coding quantization parameter and the reference quantization parameter offset corresponding to the reference image frame.
  • the encoding module 912 includes:
  • the step size obtaining unit 912A is configured to obtain a current quantization step size corresponding to the current image frame according to the current quantization parameter.
  • the encoding unit 912B is configured to encode the current image frame according to the current quantization step size to obtain a current code rate corresponding to the current image frame.
  • the current image frame is a bidirectional predicted frame
  • the apparatus further includes:
  • the offset parameter obtaining module 1302 is configured to acquire a quantization offset parameter between the preset image frame of the current layer and the unidirectional prediction frame.
  • the update value obtaining module 1304 is configured to obtain a corresponding complexity update value according to the current code rate corresponding to the current image frame and the quantization offset parameter.
  • the updating module 1306 is configured to obtain the updated image complexity parameter according to the image complexity parameter corresponding to the forward image frame of the current image frame and the complexity update value.
  • the apparatus further includes:
  • the frame type obtaining module 1402 is configured to acquire a frame type corresponding to the encoded backward image frame corresponding to the current image frame.
  • the post-vectorization parameter obtaining module 1404 is configured to obtain, according to the preset code rate control model and the updated image complexity parameter, a quantization parameter corresponding to the backward image frame when the backward image frame is a non-bidirectional prediction frame.
  • the current offset yielding module 906 includes:
  • the offset parameter obtaining unit 906A is configured to acquire a quantization offset parameter between the preset image frame of the current layer and the unidirectional prediction frame.
  • the current offset obtaining unit 906B is configured to obtain a current quantization parameter offset corresponding to the current image frame according to the quantization offset parameter.
  • Figure 16 is a diagram showing the internal structure of a computer device in one embodiment.
  • the computer device may specifically be the terminal 110 in FIG. 1B.
  • the computer device includes the computer device including a processor, a memory, a network interface, an input device, and a display screen connected by a system bus.
  • the memory comprises a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the computer device stores an operating system and can also store computer readable instructions that, when executed by the processor, cause the processor to implement a video encoding method.
  • the internal memory can also store computer readable instructions that, when executed by the processor, cause the processor to perform a video encoding method.
  • the display screen of the computer device may be a liquid crystal display or an electronic ink display screen
  • the input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball or a touchpad provided on the computer device casing, and It can be an external keyboard, trackpad or mouse.
  • Figure 17 is a diagram showing the internal structure of a computer device in one embodiment.
  • the computer device may specifically be the server 120 of Figure 1B.
  • the computer device includes the computer device including a processor, a memory, and a network interface connected by a system bus.
  • the memory includes a nonvolatile storage medium and an internal memory.
  • the non-volatile storage medium of the computer device stores an operating system and can also store computer readable instructions that, when executed by the processor, cause the processor to implement a video encoding method.
  • the internal memory can also store computer readable instructions that, when executed by the processor, cause the processor to perform a video encoding method.
  • FIGS. 16 and 17 are merely block diagrams of the partial structures related to the solution of the present application, and do not constitute a limitation of the computer device to which the solution of the present application is applied, the specific computer.
  • the device may include more or fewer components than shown in the figures, or some components may be combined, or have different component arrangements.
  • the video encoding device can be implemented in the form of a computer readable instruction that can be executed on a computer device as shown in FIGS. 16 and 17.
  • the program modules constituting the video encoding device may be stored in a memory of the computer device, such as the current frame obtaining module 902, the current layer obtaining module 904, the current offset obtaining module 906, and the reference quantization parameter obtaining module 908 shown in FIG.
  • the current quantization parameter is obtained by a module 910 and an encoding module 912.
  • the computer readable instructions formed by the various program modules cause the processor to perform the steps in the video encoding method of various embodiments of the present application described in this specification.
  • the computer device shown in FIGS. 16 and 17 can acquire the current image frame to be encoded by the current frame acquisition module 902 in the video encoding device as shown in FIG.
  • the current layer in the image group in which the current image frame is located is acquired by the current layer acquisition module 904, and the image group includes a plurality of image frames.
  • the current offset obtaining module 906 obtains the current quantization parameter offset corresponding to the current image frame according to the current layer.
  • the reference quantization parameter corresponding to the reference image frame of the current image frame is obtained by referring to the quantization parameter acquisition module.
  • the current quantization parameter obtaining module 910 obtains the current quantization parameter corresponding to the current image frame according to the reference quantization parameter and the current quantization parameter offset.
  • the current image frame is encoded by the encoding module 912 based on the current quantization parameter.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Abstract

本申请涉及一种视频编码方法、计算机设备和存储介质,包括:获取待编码的当前图像帧;获取当前图像帧在所在的图像组中所处的当前层,图像组包括多个图像帧;根据当前层得到当前图像帧对应的当前量化参数偏移量,图像组中不同层的图像帧对应不同的量化参数偏移量;获取当前图像帧的参考图像帧对应的参考量化参数;根据参考量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数;根据当前量化参数对当前图像帧进行编码。

Description

视频编码方法、计算机设备和存储介质
本申请要求于2017年11月21日提交中国专利局,申请号为2017111661957,申请名称为“视频编码方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及视频编码领域,特别是涉及视频编码方法、装置、计算机设备和存储介质。
背景技术
随着多媒体技术和网络技术的飞速发展和广泛应用,人们在日常生活和生产活动大量使用视频信息。为了减少视频的传输数据量或者存储数据量,需要对视频进行编码。
进行视频编码时,可以通过视频调节编码器的量化参数(Quantization Parameter,QP)来对图像的编码码率进行调整,使得在视频传输带宽的限制下能够保证较稳定的码率和较小的视频延时。目前,对于每一个图像帧的量化参数,需要根据设置的码率控制模型对当前图像帧的量化参数进行计算,计算复杂度大,视频编码效率低。
发明内容
根据本申请提供的各种实施例,提供一种视频编码方法、计算机设备和存储介质。
一种视频编码方法,所述方法包括:
计算机设备获取待编码的当前图像帧;
所述计算机设备获取所述当前图像帧在所在的图像组中所处的当前层,所 述图像组包括多个图像帧;
所述计算机设备根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量,所述图像组中不同层的图像帧对应不同的量化参数偏移量;
所述计算机设备获取所述当前图像帧的参考图像帧对应的参考量化参数;
所述计算机设备根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数;及
所述计算机设备根据所述当前量化参数对所述当前图像帧进行编码。
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如下步骤:
获取待编码的当前图像帧;
获取所述当前图像帧在所在的图像组中所处的当前层,所述图像组包括多个图像帧;
根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量,所述图像组中不同层的图像帧对应不同的量化参数偏移量;
获取所述当前图像帧的参考图像帧对应的参考量化参数;
根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数;及
根据所述当前量化参数对所述当前图像帧进行编码。
一个或多个存储有计算机可读指令的非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如下步骤:
获取待编码的当前图像帧;
获取所述当前图像帧在所在的图像组中所处的当前层,所述图像组包括多个图像帧;
根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量,所述图像组中不同层的图像帧对应不同的量化参数偏移量;
获取所述当前图像帧的参考图像帧对应的参考量化参数;
根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧 对应的当前量化参数;及
根据所述当前量化参数对所述当前图像帧进行编码。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1A为一个实施例中提供的视频编码方法的应用环境图;
图1B为一个实施例中提供的视频编码方法的应用环境图;
图2A为一个实施例中视频编码方法的流程图;
图2B为一个实施例中时间分层B帧编码结构的示意图;
图3为一个实施例中根据当前层得到当前图像帧对应的当前量化参数偏移量的流程图;
图4为一个实施例中获取当前图像帧的参考图像帧对应的参考量化参数的流程图;
图5为一个实施例中根据当前量化参数对当前图像帧进行编码的流程图;
图6为一个实施例中视频编码方法的流程图;
图7为一个实施例中视频编码方法的流程图;
图8为一个实施例中根据参考量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数的流程图;
图9为一个实施例中视频编码装置的结构框图;
图10为一个实施例中当前量化参数得到模块的结构框图;
图11为一个实施例中参考量化参数获取模块的结构框图;
图12为一个实施例中编码模块的结构框图;
图13为一个实施例中视频编码装置的结构框图;
图14为一个实施例中视频编码装置的结构框图;
图15为一个实施例中当前偏移量得到模块的结构框图;
图16为一个实施例中计算机设备的内部结构框图;及
图17为一个实施例中计算机设备的内部结构框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但除非特别说明,这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。
图1A为一个实施例中提供的视频编码方法的应用环境图,在进行视频编码时,由于视频图像中每一帧的内容不同,复杂度也不同,因此编码每一帧图像比特数都是不断的变化的,而传输信道也在不断的变化,因此,需要设置编码器缓冲区来平衡编码比特率以及带宽。如图1所示,当要对视频进行编码时,将视频图像序列输入到视频编码器1,经过视频编码器1进行编码后的码流输入到编码器缓冲区2进行缓冲后通过网络进行传输,码率控制器3根据设置的码率控制模型调整视频编码器上的量化参数以控制视频编码器进行视频编码得到的码率,防止编码器缓冲区2上溢或下溢。
本申请实施例的视频编码方法可以应用于计算机设备中,计算机设备可以是独立的物理服务器或终端,也可以是多个物理服务器构成的服务器集群,可以是提供云服务器、云数据库、云存储和CDN等基础云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱以及智能手表等,但并不局限于此。
如图1B所示,终端110或服务器120可以通过编码器进行视频编码,或者通过解码器进行视频解码。终端110或服务器120也可以通过处理器运行视频编码程序进行视频编码,或者通过处理器运行视频解码程序进行视频解码。服 务器120通过输入接口接收到终端110发送的编码数据后,可直接传递至处理器进行解码,也可存储至数据库中等待后续解码。服务器120在通过处理器对图像帧进行编码得到编码数据后,可直接通过输出接口发送至终端110,也可将编码数据存储至数据库中等待后续传递,其中,编码数据是指对图像帧进行编码得到的数据。
如图2A所示,在一个实施例中,提出了一种视频编码方法,本实施例主要以该方法应用于上述的计算机设备来举例说明,具体可以包括以下步骤:
步骤S202,获取待编码的当前图像帧。
具体地,视频是由图像序列组成的。每一张图像可以视为一帧。当前图像帧指当前需要进行编码的图像帧。当要对视频进行编码时,将视频图像序列输入到视频编码器中,视频编码器根据预设的顺序获取待编码的图像帧进行编码。
步骤S204,获取当前图像帧在所在的图像组中所处的当前层,图像组包括多个图像帧。
具体地,图像组((Group Of Picture、GOP)是指一组连续的图像,可以将视频图像序列中连续的几幅图像组成一个小组,以方便进行随机存取编辑。一个图像组中的图像帧的个数具体可以根据实际需要进行设置,例如可以为8。图像组中可以包括I帧、P帧和B帧三种类型的帧。其中I帧为帧内预测帧,P帧为单向预测帧,可以采用帧间预测方式进行预测。B帧为双向预测帧,可以参考前面的图像帧也可以参考后面的图像帧进行预测。当前层是指当前图像帧在图像组中所处的层,可以预先设置分层编码结构,根据分层编码结构得到图像帧在图像组中所处的层。分层编码结构指将图像组中的图像帧分为多个层进行编码,不同的层可以对应不同的编码质量,具体的分层方法可以根据实际需要或者应用场景进行设定。例如根据图像帧在图像组中的时间顺序进行分层,得到时间分层B帧编码结构(hierarchical B结构)。分层编码结构设定了层的数量、各个层对应的图像帧以及图像帧之间的参考关系,高层的图像帧可以参考低层的图像帧进行编码。因此在编码时,可以针对低层的图像帧给予更多的纠错保护或者传输优先级,从而达到动态地适应网络带宽变化或者提高编码效率的目的。分层编码结构中,分层编码结构中层的数量具体可以根据实际需要设置, 例如,图像组可以分为2层、3层或者4层。确定分层编码结构后,根据分层编码结构得到图像组中图像帧的编码顺序,对图像组中的图像帧进行编码,得到当前图像帧后,可以根据分层编码结构得到当前图像帧对应的当前层。
以预设的分层编码结构为时间分层B帧编码结构为例,一个图像组包括8个图像帧,图像组的B帧分为3层:B0层、B1层以及B2层,其中B0层包括第4个B帧,B1层包括第2以及第6个B帧,剩余的B帧图像帧所属的层级为B2层,箭头的起点表示参考帧图像,箭头的指向表示根据参考帧进行编码的图像帧,并根据图像帧的显示顺序进行排序,则该时间分层B帧编码结构如图2B所示。在分层编码结构中,高层的图像帧可以参考低层的图像帧进行编码,例如,B0层的图像帧的参考帧为两端的P帧。B2层的图像帧可以参考B1层的图像帧进行编码。可以理解,时间分层B帧编码结构并不限于三层编码结构,例如可以是两层、四层等编码结构。
步骤S206,根据当前层得到当前图像帧对应的当前量化参数偏移量,图像组中不同层的图像帧对应不同的量化参数偏移量。
具体地,图像帧进行预测得到的预测残差在进行变换后,需要进行量化以达到降低数据量的目的,量化时将预测残差进行离散余弦变换后的值映射成较小的数值,例如可以通过除以量化步长得到一个较小的值。量化参数是量化步长的序号,根据量化参数可以查找到对应的量化步长。量化参数小,则图像帧的大部分的细节都会被保留,对应的码率高。量化参数大,则对应的码率低,但图像失真较大、质量不高。即量化参数和码率成负相关的关系,在编码过程中码率控制的基本方法就是通过调整量化参数,控制图像对应的码率。量化参数偏移量指编码的图像帧相对于其参考帧的量化参数偏移值。图像组中不同层的图像帧对应不同的量化参数偏移量,不同层的图像帧对应的量化参数偏移量可以是预先设置的,具体可以根据实际需要进行设置。例如第一层至第三层的量化参数偏移量可以分别为0.42、0.8以及1.2。由于在分层编码结构中,高层的图像帧可以参考低层的图像帧进行编码,故高层的图像帧被参考次数较少,低层的图像帧被参考次数多,因此可以设置高层对应的量化参数偏移量比低层的量化参数偏移量大。即图像帧的层级与量化参数偏移量的对应关系为正相关 关系,以提高视频编码的压缩效率。
步骤S208,获取当前图像帧的参考图像帧对应的参考量化参数。
具体地,参考帧用于对编码的图像帧进行预测,参考帧的选取方法可以根据实际需要进行设置。参考图像帧是从当前图像帧的候选参考帧列表中选取出来的参考帧。参考帧例如可以基于空间相似度等进行选择。在一个实施例中,以当前图像帧为B帧即双向预测帧为例,每一个B帧有两个候选参考帧序列,可以分别取两个候选参考帧序列的第一个图像帧作为参考图像帧。参考量化参数可以是参考图像帧进行编码时的编码量化参数。在一个实施例中,还可以结合参考图像帧对应的编码量化参数以及对应的量化参数偏移量得到参考量化参数。例如,参考量化参数为参考图像帧对应的编码量化参数减去该参考图像帧对应的量化参数偏移量。在一个实施例中,若参考图像帧中有多个编码量化参数,例如各个编码单元对应一个量化参数,则参考量化参数可以是参考图像帧中量化参数的平均值。
步骤S210,根据参考量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数。
具体地,结合参考量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数。在一个实施例中,当前量化参数可以是参考量化参数与当前量化参数偏移量的和。在一个实施例中,当当前图像帧是双向预测帧时,由于参考图像帧有两个,因此还可以结合参考图像帧与当前图像帧的帧距离得到当前量化参数。例如,设置帧距离对应的权重,根据参考图像帧对应的权重以及参考图像帧的编码量化参数得到该参考图像帧对应的影响值,再根据影响值以及当前量化参数偏移量得到当前量化参数。
步骤S212,根据当前量化参数对当前图像帧进行编码。
具体地,预先设置有量化参数与量化步长的对应关系,因此可以根据当前量化参数获取到对应的量化步长,根据量化步长对当前图像帧进行量化编码。例如,一般而言,量化的原理用公式表示如下:FQ=round(y/Qstep)。其中,y为量化之前图像帧对应的值,Qstep为量化步长,FQ为y的量化值。Round(x)函数指将量化后的值进行四舍五入取偶。量化参数与量化步长的对应关系具体 可以根据需要进行设置。例如,在目前的视频编码标准中,对于亮度编码而言,量化步长共有52个值,为0~51之间的整数,对于色度编码,量化步长的取值为0~39之间的整数,且量化步长随着量化参数的增加而增加,每当量化参数增加6,量化步长便增加一倍。可以理解,当量化参数与量化步长的对应关系中量化参数均为整数时,可以对当前量化参数进行取整,取整方法可以是四舍五入取整数。
上述视频编码方法可以用于视频文件的压缩,例如微信小视频的压缩。当要对当前图像帧进行编码时,获取当前图像帧在所在的图像组中所处的当前层,然后根据当前层得到当前图像帧对应的量化参数偏移量,并获取当前图像帧的参考图像帧对应的参考量化参数,根据参考量化参数以及量化参数偏移量得到当前图像帧对应的当前量化参数,由此根据当前量化参数对当前图像帧进行编码,由于通过待编码的当前图像帧所处的当前层对应的量化参数偏移量以及参考图像帧对应的编码量化参数得到当前图像帧对应的当前量化参数,计算复杂度小,而且适应不同层图像帧的需要灵活改变量化参数偏移量,编码效率高。
在一个实施例中,如图3所示,当前图像帧为双向预测帧,根据当前层得到当前图像帧对应的当前量化参数偏移量的步骤包括:
步骤S302,获取预设的当前层的图像帧与单向预测帧之间的量化偏移参数。
具体地,可以为各个分层编码结构的不同层设置与单向预测帧之间对应的量化偏移参数。量化参数偏移量是根据量化偏移参数计算得到的,量化参数偏移量与量化偏移参数呈正相关关系。可以根据量化步长与量化参数的对应关系得到由量化偏移参数得到量化偏移量的公式,例如对于目前的亮度编码而言,量化步长共有52个值,为0~51之间的整数,且量化参数与量化步长具有相关性,量化参数随着量化步长的增加而增加,每当量化参数增加6,量化参数便增加一倍而言,量化参数偏移量为以2为底的量化偏移参数的对数与6的乘积。用公式表示如下:pbOffset_i=6*log 2(pbFactor_i)表示其中,PbOffset_i表示第i层对应的量化参数偏移量,PbFactor_i表示第i层对应的量化偏移参数。量化偏移参数具体数值可以根据需要或者经验预先设置。由于高层的图像帧被参考的次数少,因此图像帧的层级与量化参数偏移量的对应关系为正相关关系,处于 高层的图像帧对应的量化参数大,码率也低。在一个实施例中,由于分层编码结构中单向预测帧所处的层比双向预测帧所处的层低,故可以以单向预测帧为参考,设置双向预测帧中不同层的图像帧与单向预测帧之间的量化偏移参数,低层的单向预测帧对应的量化参数比高层的双向预测帧对应的量化参数小能达到提高编码效率,因此量化偏移参数大于1。在一个实施例中,B0层、B1层以及B2层对应的量化偏移参数可以分别为1.05、1.10、以及1.15。
步骤S304,根据量化偏移参数得到当前图像帧对应的当前量化参数偏移量。
具体地,得到量化偏移参数后,可以根据得到的量化偏移参数以及对应的计算公式得到当前图像帧对应的当前量化参数偏移量。具体的计算公式可以根据量化步长与量化参数的对应关系得到。
在一个实施例中,如图4所示,步骤S208即获取当前图像帧的参考图像帧对应的参考量化参数的步骤包括:
步骤S402,获取参考图像帧的参考帧类型以及参考图像帧的编码量化参数。
具体地,参考帧类型可以包括I帧、B帧以及P帧。参考帧的类型具体可以根据需要设置或者由不同的视频编码标准设置。例如一些视频编码标准如H26.3中,B帧不能作为参考帧。而在一些视频编码标准中,B帧能够作为参考帧。参考图像帧的编码量化参数是指对参考图像帧进行编码时采用的量化参数。
步骤S404,根据参考帧类型以及编码量化参数得到参考图像帧对应的参考量化参数。
具体地,可以根据参考帧类型的不同,对参考图像帧对应的编码量化参数进行调整得到参考量化参数。例如对于I帧以及P帧,可以将参考图像帧对应的编码量化参数作为参考量化参数。对于B帧,由于B帧有多个层,不同层对应的量化参数偏移量不同,因此可以结合量化参数偏移量以及编码量化参数得到参考量化参数。例如,当参考图像帧为B帧时,将参考图像帧对应的编码量化参数减去参考帧对应的量化参数偏移量得到参考量化参数。
在一个实施例中,当当前图像帧为B帧即双向预测帧时,可以采用本申请实施例提供的根据参考图像帧的参考量化参数以及当前量化参数偏移量得到当前量化参数的方法。而当当前图像帧为I帧以及P帧时,则可以不采用本申请实 施例提供的方法计算当前图像帧的当前量化参数,例如当前图像帧为P帧,根据码率控制模型计算得到当前图像帧对应的当前量化参数,以控制码率,避免码率误差大。码率控制模型可以采用RM8(reference mode 8)以及VM8(verification mode 8)等,具体不做限制。而当当前图像帧为I帧时,可以采用码率控制模型计算得到当前图像帧对应的当前量化参数,也可以设置P帧相对于I帧的量化参数偏移量,然后根据P帧对应的量化参数以及P帧相对于I帧的量化参数偏移量得到当前图像帧对应的当前量化参数。在一个实施例中,I帧对应的量化参数为P帧对应的编码量化参数减去P帧相对于I帧的量化参数偏移量,即I帧比P帧对应的量化参数小,I帧对应的编码精度高,图像失真度小。可以选择与I帧最近的P帧对应的编码量化参数减去P帧相对于I帧的量化参数偏移量。
在一个实施例中,当前图像帧为双向预测帧,根据参考帧类型以及编码量化参数得到参考图像帧对应的参考量化参数的步骤包括:当参考帧类型为双向预测帧时,获取参考图像帧在所在的图像组中所处的层。根据参考图像帧在图像组中所处的层得到参考图像帧对应的参考量化参数偏移量。根据编码量化参数以及参考图像帧对应的参考量化参数偏移量得到述参考图像帧对应的参考量化参数。
具体地,参考量化参数偏移量指参考图像帧所在层对应的量化参数偏移量。由于图像帧为双向预测帧时,需要根据图像帧对应的当前层得到量化参数偏移量,并根据量化参数偏移量以及参考图像帧的参考量化参数得到对应的当前量化参数,因此,若参考图像帧为双向预测帧时,参考图像帧对应的编码量化参数也是利用本身所在的层对应的量化参数偏移量以及其参考图像帧对应的参考量化参数得到的。因此当参考图像帧为双向预测帧时,需要获取参考图像帧在图像组所处的层,并根据参考图像帧在图像组中所处的层得到参考图像帧对应的参考量化参数偏移量。然后根据参考图像帧的编码量化参数以及参考图像帧对应的参考量化参数偏移量得到述参考图像帧对应的参考量化参数。例如,参考量化参数为编码量化参数与参考量化参数偏移量的差。具体可以根据需要进行设置。
在一个实施例中,如图5所示,根据当前量化参数对当前图像帧进行编码的步骤包括:
步骤S502,根据当前量化参数得到当前图像帧对应的当前量化步长。
具体地,得到当前量化参数后,根据量化参数与量化步长的对应关系得到当前量化参数对应的量化步长作为当前量化步长。
步骤S504,根据当前量化步长对当前图像帧进行编码,得到当前图像帧对应的当前码率。
具体地,码率是指单位时间传送的数据位数。当前码率是指以当前量化步长对当前图像帧编码进行编码后对应的码率。码率单位可以为每秒传输的比特数,码率越高,传送数据速度越快。根据当前量化步长进行编码,得到编码后当前图像帧对应的当前码率。
在一个实施例中,当前图像帧为双向预测帧,如图6所示,视频编码方法还包括以下步骤:
步骤S602,获取预设的当前层的图像帧与单向预测帧的量化偏移参数。
具体地,量化参数偏移量是根据量化偏移参数计算得到的。由于当前图像帧的当前量化参数是根据当前图像帧的当前量化参数偏移量得到的,所以在计算图像复杂度参数时可以根据量化偏移参数对当前图像帧对应的码率进行矫正,得到矫正后的码率再计算对应的图像复杂度参数,以提高图像复杂度参数的准确性。
步骤S604,根据当前图像帧对应的当前码率以及量化偏移参数得到对应的复杂度更新值。
具体地,图像复杂度参数用于表示图像帧的复杂程度。图像复杂度参数是码率控制模型中的一个参数,用于计算图像帧的量化步长。图像复杂度参数越大,则说明图像纹理等信息越复杂,需要较高的码率进行传输。复杂度更新值用于对图像复杂度参数进行更新,以能够动态地更新图像的复杂度参数。
步骤S606,根据当前图像帧的前向图像帧对应的图像复杂度参数以及复杂度更新值得到更新后的图像复杂度参数。
具体地,前向图像帧对应的图像复杂度参数指前向图像帧编码后更新得到 的图像复杂度参数。前向图像帧指在当前图像帧之前进行编码的图像帧。可以是上一图像帧,以能够及时更新图像复杂度参数,当然也可以是其他前向图像帧,具体可以根据需要进行设置。利用复杂度更新值对前向图像帧对应的图像复杂度参数进行更新,得到更新后的图像复杂度参数,从而对码率控制模型中的图像复杂度参数进行更新。
在一个实施中,复杂度更新值根据当前图像帧对应的矫正码率以及当前量化步长得到。更新后的图像复杂度参数可以是当前图像帧的前向图像帧对应的图像复杂度参数与复杂度更新值的和,用公式表示如下:
Figure PCTCN2018092688-appb-000001
其中,设当前图像帧的顺序为第j帧,前向的上一帧为j-1帧,编码第j-1图像帧之后的复杂度参数为cplxsum j-1,Bit j是第j帧即当前图像帧对应的码率,Scale j是第j帧对应的当前量化步长,若当前图像帧分为多个编码单元,各个编码单元对应一个量化步长,则Scale j可以是当前图像帧对应的平均量化步长。pbFactor_i表示第i层双向预测帧与单向预测帧的量化偏移参数。pre_param j是第j帧的预分析参数,可以为第j帧即当前图像帧对应的SAD(Sum of Absolute Difference,绝对误差和),SAD指当前图像帧的预测值与实际值的绝对误差和。
在一个实施例中,如图7所示,视频编码方法还包括以下步骤:
步骤S702,获取当前图像帧对应的的编码在后的后向图像帧对应的帧类型。
具体地,后向图像帧指在当前图像帧之后进行编码的图像帧。可以是下一图像帧,当然也可以是其他后向图像帧,具体可以根据需要进行设置。帧的类型可以包括包括I帧、B帧以及P帧。
步骤S704,当后向图像帧为非双向预测帧时,根据预设的码率控制模型以及更新后的图像复杂度参数得到后向图像帧对应的量化参数。
具体地,非双向预测帧包括I帧和P帧,当然也可以是P帧才根据预设的 码率控制模型以及更新后的图像复杂度参数得到后向图像帧对应的量化参数。码率控制模型中图像复杂度参数为模型参数,因此利用更新后的图像复杂度参数更新码率控制模型,根据码率控制模型得到后向图像帧对应的量化参数。码率控制模型具体可以根据需要进行设置。例如可以是TM5(test mode 5)算法。由于在后向图像帧为非双向预测帧时采用码率控制模型计算后向图像帧的量化参数,因此可以使得视频码率的误差不会随着图像帧的增多而过大。
在一个实施例中,参考图像帧为多个,如图8所示,步骤S210即根据参考量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数的步骤包括:
步骤S802,获取各个参考图像帧与当前图像帧之间的帧距离。
具体地,帧距离可以用图像帧与图像帧间隔的帧数表示,也可以用图像帧与图像帧之间的显示时间的时间差表示。图像帧与图像帧间隔的帧数可以用图像帧之间的显示顺序差表示。例如,若参考图像帧为图像组的第2帧,当前图像帧为同一个图像组的第6帧,则帧距离为4。参考图像帧可以为2个,例如,B帧的参考图像帧为2个。
步骤S804,根据各个参考图像帧与当前图像帧之间的帧距离以及对应的参考量化参数计算得到当前图像帧对应的第一量化参数。
具体地,可以设置帧距离对应的比例系数,然后根据比例系数以及对应的参考量化参数得到图像帧对应的第一量化参数。在一个实施例中,可以根据当前参考图像帧与当前图像帧之间的帧距离得到当前参考图像帧对应的权重,然后根据各个参考图像帧对应的权重以及对应的参考量化参数得到当前图像帧对应的第一量化参数。帧距离与权重可以为负相关关系,使得离当前图像帧距离近的参考图像帧对应的量化参数对当前图像帧的量化参数影响大。在一个实施例中,权重可以是帧距离的倒数。
例如,以当前图像帧为双向预测帧,参考图像帧有两个,第一个参考帧和当前图像帧距离为n 1帧,第一个参考图像帧的参考量化参数等于qp 1,第二个参考图像帧和当前图像帧距离为n 2帧,第二个参考图像帧的参考量化参数等于qp 2。 其中n 1和n 2都是正整数,则第一量化参数等于两个参考图像帧的参考量化参数与权重的加权平均值,其中第一个参考图像帧的量化参数的权重为第二参考图像帧和当前图像帧的帧距离与总的帧距离的比例。第二个参考图像帧的量化参数的权重为第一参考图像帧和当前图像帧的帧距离与总的帧距离的比例,根据各个参考图像帧与当前图像帧之间的帧距离以及对应的参考量化参数计算得到当前图像帧对应的第一量化参数可以如公式(1)所示。
Figure PCTCN2018092688-appb-000002
步骤S806,根据当前图像帧对应的第一量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数。
具体地,结合第一量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数。在一个实施例中,当前量化参数可以是第一量化参数与当前量化参数偏移量的和。
在一个实施例中,当前图像帧为双向预测帧,参考图像帧为两个。步骤S210即根据参考量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数的步骤还包括判断参考图像帧是否为I帧,在一个实施例中,若参考图像帧中的其中一个参考图像帧为I帧,另一个参考图像帧为P帧,则不执行步骤S802~806,并根据帧类型为P帧的参考图像帧对应的参考量化参数以及当前量化参数偏移量的和得到当前图像帧对应的当前量化参数。在一个实施例中,若参考图像帧中的其中一个参考图像帧为I帧,另一个参考图像帧为B帧,则不执行步骤S802~806,并根据帧类型为B帧的参考图像帧对应的参考量化参数以及当前量化参数偏移量的和得到当前图像帧对应的当前量化参数。在一个实施例中,若参考图像帧中的两个图像帧均为I帧,则可以根据两个参考图像帧的编码量化参数的得到第二量化参数,再根据第二量化参数以及预设数值的和得到当前量化参数。第二量化参数可以是两个参考图像帧的编码量化参数的均值。预设数值可以根据实际需要进行设置。例如,预设数值可以为P帧相对于I帧的量化参数偏移量。
以下以时间分层B帧编码结构,图像组包括8个图像帧,8个图像帧的类型为前7个为B帧,最后一个为P帧,参考关系如图2B所示为例,对本实施例提供的视频编码方法进行说明。
1、由图2B的参考关系以及当前图像帧的参考图像帧先于当前图像帧进行编码可知,图像组中第一个进行编码的图像帧为最后一个图像帧,因此获取图像组最后一个图像帧,由于当前图像帧为P帧,因此根据设置的码率控制模型以及目标码率计算图像组最后一个图像帧的量化参数,根据计算得到的量化参数对该图像帧进行编码。
2、获取图像组的第4个图像帧,得到第4个图像帧为B帧,且为B0层,因此获取B0层对应的量化参数偏移量。
3、获取第4个图像帧的2个参考图像帧,得到这2个参考图像帧对应的编码量化参数以及帧类型,若参考图像帧是B帧,则获取参考图像帧所处的层对应的量化参数偏移量,计算参考图像帧对应的编码量化参数与量化参数偏移量的差值,得到每个参考图像帧对应的参考量化参数。若参考图像帧是I帧或者P帧,将参考图像帧对应的编码量化参数作为参考量化参数。
4、若第4个图像帧的2个参考帧中有一个是I帧,则将非I帧的参考图像帧的参考量化参数与B0层对应的量化参数偏移量相加,得到第4个图像帧对应的编码量化参数,即当前量化参数。若第4个图像帧的2个参考帧中都是I帧,则计算两个参考图像帧对应的参考量化参数的均值,均值与设置的P帧相对于I帧的量化参数偏移量相加,再加上与B0层对应的量化参数偏移量,得到第4个图像帧对应的编码量化参数。若若第4个图像帧的2个参考帧中都不是I帧,则获取这两个参考图像帧分别与第4个图像帧的帧距离,根据帧距离计算得到参考图像帧对应的权重,然后根据各个图像帧对应的权重以及对应的参考量化参数得到加权平均值,将得到的加权平均值与B0层对应的量化参数偏移量相加得到第4个图像帧对应的编码量化参数。
5、根据第4个图像帧对应的编码量化参数对第4个图像帧进行编码。
6、获取第4个图像帧对应的码率以及B0层对应的量化偏移参数,计算得 到第4个图像帧对应的图像复杂度参数,并利用第4个图像帧对应的图像复杂度参数更新码率控制模型中的图像复杂度参数。
7、依次获取第2个图像帧,第6个图像帧、第1个图像帧、第3个图像帧、第5个图像帧、第7个图像帧进行编码,编码的流程可以参照第4个图像帧的在步骤2~6所执行的流程,在此不再赘述。
8、根据获取下一图像组的最后一个图像帧,即P帧,根据码率控制模型以及第7个图像帧对应的图像复杂度参数计算得到下一图像组的最后一个图像帧对应的量化参数。
应该理解的是,本申请各实施例中的各个步骤并不是必然按照步骤标号指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,各实施例中至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
如图9所示,在一个实施例中,提供了一种视频编码装置,具体可以包括:
当前帧获取模块902,用于获取待编码的当前图像帧。
当前层获取模块904,用于获取当前图像帧在所在的图像组中所处的当前层,图像组包括多个图像帧。
当前偏移量得到模块906,用于根据当前层得到当前图像帧对应的当前量化参数偏移量,图像组中不同层的图像帧对应不同的量化参数偏移量。
参考量化参数获取模块908,用于获取当前图像帧的参考图像帧对应的参考量化参数。
当前量化参数得到模块910,用于根据参考量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数。
编码模块912,用于根据当前量化参数对当前图像帧进行编码。
如图10所示,在一个实施例中,参考图像帧为多个,当前量化参数得到模块910包括:
帧距离获取单元910A,用于获取各个参考图像帧与当前图像帧之间的帧距离。
参数计算单元910B,用于根据各个参考图像帧与当前图像帧之间的帧距离以及对应的参考量化参数计算得到当前图像帧对应的第一量化参数。
当前量化参数得到单元910C,用于根据当前图像帧对应的第一量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数。
在一个实施例中,参数计算单元910B用于:根据当前参考图像帧与当前图像帧之间的帧距离得到当前参考图像帧对应的权重,其中帧距离与权重为负相关关系。根据各个参考图像帧对应的权重以及对应的参考量化参数得到当前图像帧对应的第一量化参数。
如图11所示,在一个实施例中,参考量化参数获取模块908包括:
参考帧信息获取单元908A,用于获取参考图像帧的参考帧类型以及参考图像帧的编码量化参数。
参考量化参数获取单元908B,用于根据参考帧类型以及编码量化参数得到参考图像帧对应的参考量化参数。
在一个实施例中,当前图像帧为双向预测帧,参考量化参数获取单元908B用于:当参考帧类型为双向预测帧时,获取参考图像帧在所在的图像组中所处的层。根据参考图像帧在图像组中所处的层得到参考图像帧对应的参考量化参数偏移量。根据编码量化参数以及参考图像帧对应的参考量化参数偏移量得到述参考图像帧对应的参考量化参数。
如图12所示,在一个实施例中,编码模块912包括:
步长得到单元912A,用于根据当前量化参数得到当前图像帧对应的当前量化步长。
编码单元912B,用于根据当前量化步长对当前图像帧进行编码,得到当前图像帧对应的当前码率。
如图13所示,在一个实施例中,当前图像帧为双向预测帧,装置还包括:
偏移参数获取模块1302,用于获取预设的当前层的图像帧与单向预测帧之间的量化偏移参数。
更新值得到模块1304,用于根据当前图像帧对应的当前码率以及量化偏移参数得到对应的复杂度更新值。
更新模块1306,用于根据当前图像帧的前向图像帧对应的图像复杂度参数以及复杂度更新值得到更新后的图像复杂度参数。
如图14所示,在一个实施例中,装置还包括:
帧类型获取模块1402,用于获取当前图像帧对应的的编码在后的后向图像帧对应的帧类型。
后向量化参数获取模块1404,用于当后向图像帧为非双向预测帧时,根据预设的码率控制模型以及更新后的图像复杂度参数得到后向图像帧对应的量化参数。
如图15所示,在一个实施例中,当前偏移量得到模块906包括:
偏移参数获取单元906A,用于获取预设的当前层的图像帧与单向预测帧之间的量化偏移参数。
当前偏移量得到单元906B,用于根据量化偏移参数得到当前图像帧对应的当前量化参数偏移量。
图16示出了一个实施例中计算机设备的内部结构图。该计算机设备具体可以是图1B中的终端110。如图16所示,该计算机设备包括该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、输入装置和显示屏。其中,存储器包括非易失性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器实现视频编码方法。该内存储器中也可储存有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行视频编码方法。计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。
图17示出了一个实施例中计算机设备的内部结构图。该计算机设备具体可以是图1B中的服务器120。如图17所示,该计算机设备包括该计算机设备包括通过系统总线连接的处理器、存储器以及网络接口。其中,存储器包括非易失 性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器实现视频编码方法。该内存储器中也可储存有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行视频编码方法。
本领域技术人员可以理解,图16中以及17示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,本申请提供的视频编码装置可以实现为一种计算机可读指令的形式,计算机可读指令可在如图16以及图17所示的计算机设备上运行。计算机设备的存储器中可存储组成该视频编码装置的各个程序模块,比如,图9所示的当前帧获取模块902、当前层获取模块904、当前偏移量得到模块906、参考量化参数获取模块908、当前量化参数得到模块910以及编码模块912。各个程序模块构成的计算机可读指令使得处理器执行本说明书中描述的本申请各个实施例的视频编码方法中的步骤。
例如,图16以及图17所示的计算机设备可以通过如图9所示的视频编码装置中的当前帧获取模块902获取待编码的当前图像帧。通过当前层获取模块904获取当前图像帧在所在的图像组中所处的当前层,图像组包括多个图像帧。通过当前偏移量得到模块906根据当前层得到当前图像帧对应的当前量化参数偏移量。通过参考量化参数获取模块获取当前图像帧的参考图像帧对应的参考量化参数。通过当前量化参数得到模块910根据参考量化参数以及当前量化参数偏移量得到当前图像帧对应的当前量化参数。通过编码模块912根据当前量化参数对当前图像帧进行编码。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存 储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (30)

  1. 一种视频编码方法,所述方法包括:
    计算机设备获取待编码的当前图像帧;
    所述计算机设备获取所述当前图像帧在所在的图像组中所处的当前层,所述图像组包括多个图像帧;
    所述计算机设备根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量,所述图像组中不同层的图像帧对应不同的量化参数偏移量;
    所述计算机设备获取所述当前图像帧的参考图像帧对应的参考量化参数;
    所述计算机设备根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数;
    所述计算机设备根据所述当前量化参数对所述当前图像帧进行编码。
  2. 根据权利要求1所述的方法,其特征在于,所述参考图像帧为多个,所述计算机设备根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数的步骤包括:
    所述计算机设备获取所述各个参考图像帧与所述当前图像帧之间的帧距离;
    所述计算机设备根据所述各个参考图像帧与所述当前图像帧之间的帧距离以及对应的参考量化参数计算得到所述当前图像帧对应的第一量化参数;
    所述计算机设备根据所述当前图像帧对应的第一量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数。
  3. 根据权利要求2所述的方法,其特征在于,所述计算机设备根据所述各个参考图像帧与所述当前图像帧之间的帧距离以及对应的参考量化参数计算得到所述当前图像帧对应的第一量化参数的步骤包括:
    所述计算机设备根据当前参考图像帧与所述当前图像帧之间的帧距离得到所述当前参考图像帧对应的权重,其中帧距离与权重为负相关关系;
    所述计算机设备根据所述各个参考图像帧对应的权重以及对应的参考量化参数得到所述当前图像帧对应的第一量化参数。
  4. 根据权利要求1所述的方法,其特征在于,所述计算机设备获取所述当前图像帧的参考图像帧对应的参考量化参数的步骤包括:
    所述计算机设备获取所述参考图像帧的参考帧类型以及所述参考图像帧的编码量化参数;
    所述计算机设备根据所述参考帧类型以及所述编码量化参数得到所述参考图像帧对应的参考量化参数。
  5. 根据权利要求4所述的方法,其特征在于,所述当前图像帧为双向预测帧,所述计算机设备根据所述参考帧类型以及所述编码量化参数得到所述参考图像帧对应的参考量化参数的步骤包括:
    当所述参考帧类型为双向预测帧时,所述计算机设备获取所述参考图像帧在所在的图像组中所处的层;
    所述计算机设备根据所述参考图像帧在图像组中所处的层得到所述参考图像帧对应的参考量化参数偏移量;
    所述计算机设备根据所述编码量化参数以及所述参考图像帧对应的参考量化参数偏移量得到述参考图像帧对应的参考量化参数。
  6. 根据权利要求1所述的方法,其特征在于,所述计算机设备根据所述当前量化参数对所述当前图像帧进行编码的步骤包括:
    所述计算机设备根据所述当前量化参数得到所述当前图像帧对应的当前量化步长;
    所述计算机设备根据所述当前量化步长对所述当前图像帧进行编码,得到所述当前图像帧对应的当前码率。
  7. 根据权利要求6所述的方法,其特征在于,所述当前图像帧为双向预测帧,所述方法还包括:
    所述计算机设备获取预设的所述当前层的图像帧与单向预测帧之间的量化偏移参数;
    所述计算机设备根据所述当前图像帧对应的当前码率以及所述量化偏移参数得到对应的复杂度更新值;
    所述计算机设备根据所述当前图像帧的前向图像帧对应的图像复杂度参数 以及所述复杂度更新值得到更新后的图像复杂度参数。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    所述计算机设备获取所述当前图像帧对应的的编码在后的后向图像帧对应的帧类型;
    所述计算机设备当所述后向图像帧为非双向预测帧时,根据预设的码率控制模型以及所述更新后的图像复杂度参数得到所述后向图像帧对应的量化参数。
  9. 根据权利要求1所述的方法,其特征在于,所述计算机设备根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量的步骤包括:
    所述计算机设备获取预设的所述当前层的图像帧与单向预测帧之间的量化偏移参数;
    所述计算机设备根据所述量化偏移参数得到所述当前图像帧对应的当前量化参数偏移量。
  10. 根据权利要求1所述的方法,其特征在于,图像帧的层级与量化参数偏移量的对应关系为正相关关系。
  11. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如下步骤:
    获取待编码的当前图像帧;
    获取所述当前图像帧在所在的图像组中所处的当前层,所述图像组包括多个图像帧;
    根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量,所述图像组中不同层的图像帧对应不同的量化参数偏移量;
    获取所述当前图像帧的参考图像帧对应的参考量化参数;
    根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数;
    根据所述当前量化参数对所述当前图像帧进行编码。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述参考图像帧为 多个,所述根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数包括:
    获取所述各个参考图像帧与所述当前图像帧之间的帧距离;
    根据所述各个参考图像帧与所述当前图像帧之间的帧距离以及对应的参考量化参数计算得到所述当前图像帧对应的第一量化参数;
    根据所述当前图像帧对应的第一量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数。
  13. 根据权利要求12所述的计算机设备,其特征在于,所述根据所述各个参考图像帧与所述当前图像帧之间的帧距离以及对应的参考量化参数计算得到所述当前图像帧对应的第一量化参数包括:
    根据当前参考图像帧与所述当前图像帧之间的帧距离得到所述当前参考图像帧对应的权重,其中帧距离与权重为负相关关系;
    根据所述各个参考图像帧对应的权重以及对应的参考量化参数得到所述当前图像帧对应的第一量化参数。
  14. 根据权利要求11所述的计算机设备,其特征在于,所述计算机设备获取所述当前图像帧的参考图像帧对应的参考量化参数包括:
    获取所述参考图像帧的参考帧类型以及所述参考图像帧的编码量化参数;
    根据所述参考帧类型以及所述编码量化参数得到所述参考图像帧对应的参考量化参数。
  15. 根据权利要求14所述的计算机设备,其特征在于,所述当前图像帧为双向预测帧,所述根据所述参考帧类型以及所述编码量化参数得到所述参考图像帧对应的参考量化参数包括:
    当所述参考帧类型为双向预测帧时,获取所述参考图像帧在所在的图像组中所处的层;
    根据所述参考图像帧在图像组中所处的层得到所述参考图像帧对应的参考量化参数偏移量;
    根据所述编码量化参数以及所述参考图像帧对应的参考量化参数偏移量得到述参考图像帧对应的参考量化参数。
  16. 根据权利要求11所述的计算机设备,其特征在于,所述根据所述当前量化参数对所述当前图像帧进行编码包括:
    根据所述当前量化参数得到所述当前图像帧对应的当前量化步长;
    根据所述当前量化步长对所述当前图像帧进行编码,得到所述当前图像帧对应的当前码率。
  17. 根据权利要求16所述的计算机设备,其特征在于,所述当前图像帧为双向预测帧,所述计算机可读指令还使得所述处理器执行如下步骤:
    获取预设的所述当前层的图像帧与单向预测帧之间的量化偏移参数;
    根据所述当前图像帧对应的当前码率以及所述量化偏移参数得到对应的复杂度更新值;
    根据所述当前图像帧的前向图像帧对应的图像复杂度参数以及所述复杂度更新值得到更新后的图像复杂度参数。
  18. 根据权利要求17所述的计算机设备,其特征在于,所述计算机可读指令还使得所述处理器执行如下步骤:
    获取所述当前图像帧对应的的编码在后的后向图像帧对应的帧类型;
    当所述后向图像帧为非双向预测帧时,根据预设的码率控制模型以及所述更新后的图像复杂度参数得到所述后向图像帧对应的量化参数。
  19. 根据权利要求11所述的计算机设备,其特征在于,所述根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量包括:
    获取预设的所述当前层的图像帧与单向预测帧之间的量化偏移参数;
    根据所述量化偏移参数得到所述当前图像帧对应的当前量化参数偏移量。
  20. 根据权利要求11所述的计算机设备,其特征在于,图像帧的层级与量化参数偏移量的对应关系为正相关关系。
  21. 一个或多个存储有计算机可读指令的非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如下步骤:
    获取待编码的当前图像帧;
    获取所述当前图像帧在所在的图像组中所处的当前层,所述图像组包括多个图像帧;
    根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量,所述图像组中不同层的图像帧对应不同的量化参数偏移量;
    获取所述当前图像帧的参考图像帧对应的参考量化参数;
    根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数;
    根据所述当前量化参数对所述当前图像帧进行编码。
  22. 根据权利要求21所述的计算机存储介质,其特征在于,所述参考图像帧为多个,所述根据所述参考量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数包括:
    获取所述各个参考图像帧与所述当前图像帧之间的帧距离;
    根据所述各个参考图像帧与所述当前图像帧之间的帧距离以及对应的参考量化参数计算得到所述当前图像帧对应的第一量化参数;
    根据所述当前图像帧对应的第一量化参数以及所述当前量化参数偏移量得到所述当前图像帧对应的当前量化参数。
  23. 根据权利要求22所述的计算机存储介质,其特征在于,所述根据所述各个参考图像帧与所述当前图像帧之间的帧距离以及对应的参考量化参数计算得到所述当前图像帧对应的第一量化参数包括:
    根据当前参考图像帧与所述当前图像帧之间的帧距离得到所述当前参考图像帧对应的权重,其中帧距离与权重为负相关关系;
    根据所述各个参考图像帧对应的权重以及对应的参考量化参数得到所述当前图像帧对应的第一量化参数。
  24. 根据权利要求21所述的计算机存储介质,其特征在于,所述计算机存储介质获取所述当前图像帧的参考图像帧对应的参考量化参数包括:
    获取所述参考图像帧的参考帧类型以及所述参考图像帧的编码量化参数;
    根据所述参考帧类型以及所述编码量化参数得到所述参考图像帧对应的参考量化参数。
  25. 根据权利要求24所述的计算机存储介质,其特征在于,所述当前图像帧为双向预测帧,所述根据所述参考帧类型以及所述编码量化参数得到所述参 考图像帧对应的参考量化参数包括:
    当所述参考帧类型为双向预测帧时,获取所述参考图像帧在所在的图像组中所处的层;
    根据所述参考图像帧在图像组中所处的层得到所述参考图像帧对应的参考量化参数偏移量;
    根据所述编码量化参数以及所述参考图像帧对应的参考量化参数偏移量得到述参考图像帧对应的参考量化参数。
  26. 根据权利要求21所述的计算机存储介质,其特征在于,所述根据所述当前量化参数对所述当前图像帧进行编码包括:
    根据所述当前量化参数得到所述当前图像帧对应的当前量化步长;
    根据所述当前量化步长对所述当前图像帧进行编码,得到所述当前图像帧对应的当前码率。
  27. 根据权利要求26所述的计算机存储介质,其特征在于,所述当前图像帧为双向预测帧,所述计算机可读指令还使得所述处理器执行如下步骤:
    获取预设的所述当前层的图像帧与单向预测帧之间的量化偏移参数;
    根据所述当前图像帧对应的当前码率以及所述量化偏移参数得到对应的复杂度更新值;
    根据所述当前图像帧的前向图像帧对应的图像复杂度参数以及所述复杂度更新值得到更新后的图像复杂度参数。
  28. 根据权利要求27所述的计算机存储介质,其特征在于,所述计算机可读指令还使得所述处理器执行如下步骤:
    获取所述当前图像帧对应的的编码在后的后向图像帧对应的帧类型;
    当所述后向图像帧为非双向预测帧时,根据预设的码率控制模型以及所述更新后的图像复杂度参数得到所述后向图像帧对应的量化参数。
  29. 根据权利要求21所述的计算机存储介质,其特征在于,所述根据所述当前层得到所述当前图像帧对应的当前量化参数偏移量包括:
    获取预设的所述当前层的图像帧与单向预测帧之间的量化偏移参数;
    根据所述量化偏移参数得到所述当前图像帧对应的当前量化参数偏移量。
  30. 根据权利要求21所述的计算机存储介质,其特征在于,图像帧的层级与量化参数偏移量的对应关系为正相关关系。
PCT/CN2018/092688 2017-11-21 2018-06-25 视频编码方法、计算机设备和存储介质 WO2019100712A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2019563158A JP6906637B2 (ja) 2017-11-21 2018-06-25 ビデオ符号化方法、コンピュータ機器、及びコンピュータ・プログラム
EP18880220.1A EP3716624A4 (en) 2017-11-21 2018-06-25 VIDEO CODING PROCESS, COMPUTER DEVICE, AND STORAGE MEDIA
KR1020197035254A KR102263979B1 (ko) 2017-11-21 2018-06-25 비디오 인코딩 방법, 컴퓨터 장치 및 저장 매체
US16/450,705 US10944970B2 (en) 2017-11-21 2019-06-24 Video coding method, computer device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711166195.7 2017-11-21
CN201711166195.7A CN109819253B (zh) 2017-11-21 2017-11-21 视频编码方法、装置、计算机设备和存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/450,705 Continuation US10944970B2 (en) 2017-11-21 2019-06-24 Video coding method, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2019100712A1 true WO2019100712A1 (zh) 2019-05-31

Family

ID=66600324

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/092688 WO2019100712A1 (zh) 2017-11-21 2018-06-25 视频编码方法、计算机设备和存储介质

Country Status (7)

Country Link
US (1) US10944970B2 (zh)
EP (1) EP3716624A4 (zh)
JP (1) JP6906637B2 (zh)
KR (1) KR102263979B1 (zh)
CN (1) CN109819253B (zh)
MA (1) MA50876A (zh)
WO (1) WO2019100712A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019193182A (ja) * 2018-04-27 2019-10-31 富士通株式会社 符号化装置、符号化方法、及び符号化プログラム

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110536134B (zh) * 2019-09-27 2022-11-04 腾讯科技(深圳)有限公司 视频编码、解码方法和装置、存储介质及电子装置
CN111988611B (zh) * 2020-07-24 2024-03-05 北京达佳互联信息技术有限公司 量化偏移信息的确定方法、图像编码方法、装置及电子设备
CN112165620A (zh) * 2020-09-24 2021-01-01 北京金山云网络技术有限公司 视频的编码方法及装置、存储介质、电子设备
CN112165618B (zh) * 2020-09-27 2022-08-16 北京金山云网络技术有限公司 一种视频编码方法、装置、设备和计算机可读存储介质
CN112203096A (zh) * 2020-09-30 2021-01-08 北京金山云网络技术有限公司 视频编码方法、装置、计算机设备和存储介质
WO2023050072A1 (en) * 2021-09-28 2023-04-06 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Methods and systems for video compression
CN113938689B (zh) * 2021-12-03 2023-09-26 北京达佳互联信息技术有限公司 量化参数确定方法和装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102577379A (zh) * 2009-10-05 2012-07-11 汤姆逊许可证公司 用于视频编码和译码中的嵌入量化参数调节的方法和装置
CN102714725A (zh) * 2010-01-06 2012-10-03 杜比实验室特许公司 用于多层视频编码应用的高性能码率控制
GB2499874A (en) * 2012-03-02 2013-09-04 Canon Kk Scalable video coding methods
CN104871539A (zh) * 2012-12-18 2015-08-26 索尼公司 图像处理装置和图像处理方法
CN104954793A (zh) * 2015-06-18 2015-09-30 电子科技大学 一种GOP级的QP-Offset设置方法

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8135063B2 (en) * 2006-09-08 2012-03-13 Mediatek Inc. Rate control method with frame-layer bit allocation and video encoder
US8331438B2 (en) * 2007-06-05 2012-12-11 Microsoft Corporation Adaptive selection of picture-level quantization parameters for predicted video pictures
CN100562118C (zh) * 2007-07-03 2009-11-18 上海富瀚微电子有限公司 一种视频编码的码率控制方法
CN101917614B (zh) * 2010-06-03 2012-07-04 北京邮电大学 一种基于h.264分层b帧编码结构的码率控制方法
KR20120096863A (ko) * 2011-02-23 2012-08-31 한국전자통신연구원 고효율 비디오 부호화의 계층적 부호화 구조를 위한 비트율 제어 기법
US10298939B2 (en) * 2011-06-22 2019-05-21 Qualcomm Incorporated Quantization in video coding
CN102420987A (zh) * 2011-12-01 2012-04-18 上海大学 基于分层b帧结构的码率控制的自适应比特分配方法
CN105519108B (zh) * 2012-01-09 2019-11-29 华为技术有限公司 量化矩阵编码的加权预测方法和装置
GB2506594B (en) * 2012-09-28 2016-08-17 Canon Kk Method and devices for encoding an image of pixels into a video bitstream and decoding the corresponding video bitstream
US9978156B2 (en) * 2012-10-03 2018-05-22 Avago Technologies General Ip (Singapore) Pte. Ltd. High-throughput image and video compression
US9510002B2 (en) * 2013-09-09 2016-11-29 Apple Inc. Chroma quantization in video coding
KR101789954B1 (ko) * 2013-12-27 2017-10-25 인텔 코포레이션 차세대 비디오 코딩을 위한 콘텐츠 적응적 이득 보상된 예측
US9661329B2 (en) * 2014-04-30 2017-05-23 Intel Corporation Constant quality video coding
US10397574B2 (en) * 2014-05-12 2019-08-27 Intel Corporation Video coding quantization parameter determination suitable for video conferencing
CN105872545B (zh) * 2016-04-19 2019-03-29 电子科技大学 一种随机接入视频编码中层次化时域率失真优化方法
CN106961603B (zh) * 2017-03-07 2018-06-15 腾讯科技(深圳)有限公司 帧内编码帧码率分配方法和装置
CN107197251B (zh) * 2017-06-27 2019-08-13 中南大学 一种新视频编码标准的基于分层b帧的帧间模式快速选择方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102577379A (zh) * 2009-10-05 2012-07-11 汤姆逊许可证公司 用于视频编码和译码中的嵌入量化参数调节的方法和装置
CN102714725A (zh) * 2010-01-06 2012-10-03 杜比实验室特许公司 用于多层视频编码应用的高性能码率控制
GB2499874A (en) * 2012-03-02 2013-09-04 Canon Kk Scalable video coding methods
CN104871539A (zh) * 2012-12-18 2015-08-26 索尼公司 图像处理装置和图像处理方法
CN104954793A (zh) * 2015-06-18 2015-09-30 电子科技大学 一种GOP级的QP-Offset设置方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3716624A4

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019193182A (ja) * 2018-04-27 2019-10-31 富士通株式会社 符号化装置、符号化方法、及び符号化プログラム
JP7125594B2 (ja) 2018-04-27 2022-08-25 富士通株式会社 符号化装置、符号化方法、及び符号化プログラム
JP7343817B2 (ja) 2018-04-27 2023-09-13 富士通株式会社 符号化装置、符号化方法、及び符号化プログラム

Also Published As

Publication number Publication date
JP6906637B2 (ja) 2021-07-21
KR102263979B1 (ko) 2021-06-10
US10944970B2 (en) 2021-03-09
CN109819253A (zh) 2019-05-28
KR20200002032A (ko) 2020-01-07
JP2020520197A (ja) 2020-07-02
EP3716624A1 (en) 2020-09-30
US20190320175A1 (en) 2019-10-17
EP3716624A4 (en) 2021-06-09
MA50876A (fr) 2020-09-30
CN109819253B (zh) 2022-04-22

Similar Documents

Publication Publication Date Title
WO2019100712A1 (zh) 视频编码方法、计算机设备和存储介质
US10827182B2 (en) Video encoding processing method, computer device and storage medium
US11563974B2 (en) Method and apparatus for video decoding
US11412229B2 (en) Method and apparatus for video encoding and decoding
WO2018161868A1 (zh) 帧内编码帧码率分配方法、计算机设备和存储介质
US11206405B2 (en) Video encoding method and apparatus, video decoding method and apparatus, computer device, and storage medium
US11172220B2 (en) Video encoding method, and storage medium thereof
US11070817B2 (en) Video encoding method, computer device, and storage medium for determining skip status
CN110166771B (zh) 视频编码方法、装置、计算机设备和存储介质
CN102113328B (zh) 确定用于比较运动补偿视频编码中的图像块的度量的方法和系统
WO2018161845A1 (zh) 视频编码的码率分配、编码单元码率分配方法及计算机设备
US11949879B2 (en) Video coding method and apparatus, computer device, and storage medium
US20150172680A1 (en) Producing an Output Need Parameter for an Encoder
JPWO2008111454A1 (ja) 量子化制御方法及び装置、そのプログラム並びにプログラムを記録した記録媒体
JP7431752B2 (ja) ビデオ符号化、ビデオ復号化方法、装置、コンピュータ装置及びコンピュータプログラム
US11303916B2 (en) Motion compensation techniques for video
WO2022021422A1 (zh) 视频编码方法、编码器、系统以及计算机存储介质
TWI510050B (zh) 量化控制裝置及方法,以及量化控制程式
KR101035746B1 (ko) 동영상 인코더와 동영상 디코더에서의 분산적 움직임 예측 방법
Mys et al. Decoder-driven mode decision in a block-based distributed video codec
TWI543587B (zh) 速率控制方法及系統
KR20130032807A (ko) 동영상 부호화 장치 및 방법
US20130243084A1 (en) Bit rate regulation module and method for regulating bit rate
CN115190309B (zh) 视频帧处理方法、训练方法、装置、设备及存储介质
US20240129473A1 (en) Probability estimation in multi-symbol entropy coding

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18880220

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019563158

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 20197035254

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2018880220

Country of ref document: EP

Effective date: 20200622