WO2019071984A1 - 视频转码方法、计算机设备及存储介质 - Google Patents

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

Info

Publication number
WO2019071984A1
WO2019071984A1 PCT/CN2018/093318 CN2018093318W WO2019071984A1 WO 2019071984 A1 WO2019071984 A1 WO 2019071984A1 CN 2018093318 W CN2018093318 W CN 2018093318W WO 2019071984 A1 WO2019071984 A1 WO 2019071984A1
Authority
WO
WIPO (PCT)
Prior art keywords
quantization parameter
initial
coding unit
current
frame
Prior art date
Application number
PCT/CN2018/093318
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 JP2019561246A priority Critical patent/JP6881819B2/ja
Priority to KR1020197035404A priority patent/KR102291570B1/ko
Priority to EP18866688.7A priority patent/EP3697095A4/en
Publication of WO2019071984A1 publication Critical patent/WO2019071984A1/zh
Priority to US16/436,570 priority patent/US10951905B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • 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/136Incoming video signal characteristics or properties
    • 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/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/154Measured or subjectively estimated visual quality after decoding, e.g. measurement of distortion
    • 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/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/192Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive
    • H04N19/194Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive involving only two passes
    • 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/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/196Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding being specially adapted for the computation of encoding parameters, e.g. by averaging previously computed encoding parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display

Definitions

  • the present application relates to the field of computer processing technologies, and in particular, to a video transcoding method, a computer device, and a storage medium.
  • Video transcoding refers to converting a video stream that has been compression-coded into another video stream to accommodate different network bandwidths, different terminal processing capabilities, and different user requirements.
  • the essence of transcoding is a process of decoding and re-encoding first, so the same video coding standard may not be followed before and after transcoding.
  • the traditional client uploads the compressed video to the server, and the server needs to transcode the received video.
  • the traditional video transcoding method has high bandwidth cost.
  • a video transcoding method a computer device, and a storage medium are proposed.
  • a video transcoding method includes:
  • the computer device encodes the current coding unit according to the target coding quantization parameter.
  • a computer device comprising a memory and one or more processors, the memory storing computer readable instructions computer readable instructions, the computer readable instructions being executable by the one or more processors Having the one or more processors perform the following steps:
  • the current coding unit is encoded according to the target coding quantization parameter.
  • One or more non-transitory computer readable storage media storing computer executable instructions, which when executed by one or more processors, cause the one or more processors to perform the following steps : obtaining an initial quantization parameter corresponding to the initial coding unit when encoding the initial compressed video;
  • the current coding unit is encoded according to the target coding quantization parameter.
  • FIG. 1 is an application environment diagram of a video transcoding method in an embodiment
  • FIG. 2 is a flow chart of a video transcoding method in an embodiment
  • FIG. 3 is a flowchart of a method for determining a current reference quantization parameter corresponding to a current coding unit in an embodiment
  • FIG. 4 is a flowchart of a method for determining a current reference quantization parameter corresponding to a current coding unit in another embodiment
  • FIG. 5 is a flow chart of a method for determining a target code quantization parameter in an embodiment
  • FIG. 6 is a flowchart of a method for classifying a current video frame according to a frame average quantization parameter corresponding to a current video frame in an embodiment
  • FIG. 7 is a schematic flow chart of video transcoding in an embodiment
  • FIG. 8 is a schematic flowchart of encoding a coding unit in an embodiment
  • FIG. 9 is a flow chart of a video transcoding method in still another embodiment.
  • Figure 10 is a block diagram showing the structure of a video transcoding device in an embodiment
  • Figure 11 is a block diagram showing the structure of a determining module in an embodiment
  • FIG. 12 is a structural block diagram of a video transcoding device in another embodiment
  • Figure 13 is a block diagram showing the structure of a video transcoding device in still another embodiment.
  • Figure 14 is a diagram showing the internal structure of a computer device in an embodiment.
  • FIG. 1 is an application environment diagram of a video transcoding method in an embodiment.
  • the video transcoding method is applied to a video transcoding system. It can be applied to the server in the video transcoding system, and can also be applied to the terminal in the video transcoding system.
  • the video transcoding system includes a first terminal 110, a server 120, and a second terminal 130.
  • the first terminal 110 and the server 120 are connected through a network, and the server 120 and the second terminal 130 are connected through a network.
  • the first terminal 110 and the second terminal 130 may specifically be a desktop terminal or a mobile terminal, and the mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a notebook computer, and the like.
  • the server 120 can be implemented by a stand-alone server or a server cluster composed of a plurality of servers.
  • the first terminal compresses the original video to obtain an initial compressed video, and then uploads the initial compressed video to the server 120.
  • the server 120 obtains an initial coding unit corresponding to the initial compressed video.
  • the initial quantization parameter is determined, and then the current reference quantization parameter corresponding to the current coding unit in the current video frame is determined according to the initial quantization parameter corresponding to the initial coding unit, and then the quantization parameter to be encoded corresponding to the current coding unit is determined, and then the corresponding coding unit corresponding to the current coding unit is determined.
  • the amplitude of the difference between the coded quantization parameter and the corresponding current reference quantization parameter is increased, the quantization parameter to be encoded corresponding to the current coding unit is increased according to the gap width, the target coding quantization parameter is obtained, and the current coding unit is coded according to the target coding quantization parameter. Finally, the target compressed video obtained after transcoding can be sent to the second terminal 130.
  • the above video transcoding method can be directly applied to the terminal 110 or 130.
  • the terminal 110 or 130 obtains an initial quantization parameter corresponding to the initial coding unit when the initial compressed video is encoded, and then determines a current reference quantization parameter corresponding to the current coding unit in the current video frame according to the initial quantization parameter corresponding to the initial coding unit, and then determines that the current coding unit corresponds to the current coding unit.
  • the quantization parameter to be encoded is then determined, and the difference between the quantization parameter to be encoded corresponding to the current coding unit and the corresponding current reference quantization parameter is determined, and the quantization parameter to be encoded corresponding to the current coding unit is increased according to the gap size, and the target coding quantization parameter is obtained. And encoding the current coding unit according to the target coding quantization parameter.
  • a video transcoding method is provided.
  • the video transcoding method can be applied to both the server and the terminal. This embodiment is mainly illustrated by the method being applied to the server 120 in FIG. 1 described above. Referring to FIG. 2, the video transcoding method specifically includes the following steps:
  • Step S202 Acquire an initial quantization parameter corresponding to an initial coding unit when encoding the initial compressed video.
  • the quantization parameter is a parameter used to measure the quantization step size, which can affect the image quality.
  • the quantization parameter QP is the sequence number of the quantization step Qstep, and the value is 0-51.
  • the quantization parameter QP takes a minimum value of 0, it means that the quantization is the finest.
  • the quantization parameter QP takes the maximum value of 51, it means that the quantization is the coarsest.
  • the quantization parameter is positively correlated with the compression ratio, that is, the smaller the quantization parameter is, the smaller the corresponding compression ratio is, and the larger the quantization parameter is, the higher the corresponding compression ratio is.
  • the compression ratio here refers to the ratio of the size before compression to the size after compression.
  • the video is composed of one video frame, and each video frame contains coding units, and each coding unit corresponds to one quantization parameter.
  • each coding unit corresponds to one quantization parameter.
  • the initial compressed video is relative to the current video transcoding, and the video before transcoding is referred to as the initial compressed video.
  • the initial coding unit refers to a coding unit included in the initial compressed video
  • the initial quantization parameter refers to a quantization parameter corresponding to the initial coding unit.
  • the coding unit is a unit constituting a video frame, and the coding unit may be a coding block in a video frame, or may be a coding stripe in a video frame, and the coding stripe includes a plurality of coding blocks, because the coding block in the coding stripe
  • the corresponding quantization parameters are the same, so the coded stripe can be regarded as a coding unit, which corresponds to a quantization parameter.
  • the initial compressed video is obtained, and the initial compressed video is decoded to obtain an initial decoded frame.
  • the initial decoded frame refers to the decoded video frame obtained by decoding the initial compressed video, and obtains initial quantization corresponding to each initial coding unit. parameter.
  • Step S204 Determine, according to an initial quantization parameter corresponding to the initial coding unit, a current reference quantization parameter corresponding to the current coding unit in the current video frame.
  • the current video frame refers to a video frame to be currently encoded
  • the current coding unit refers to a coding unit in the current video frame.
  • the current reference quantization parameter is a reference value used to measure the quantization parameter to be encoded corresponding to the current coding unit.
  • the essence of video transcoding is a process of decoding and then re-encoding. In order to transcode the initial compressed video, firstly, the initial compressed video needs to be decoded to obtain an initial decoded frame, and then the initial decoded frame is used as the current video frame to be encoded, so as to facilitate subsequent re-encoding.
  • the target initial coding unit that matches the current coding unit is obtained, because the decoded initial decoded frame is used as the current to be coded.
  • the video frame is then re-encoded, so the initial decoded frame has a one-to-one correspondence with the current video frame to be encoded.
  • the specification of the initial coding unit in the initial decoded frame and the specification of the current coding unit in the current video frame to be encoded may be the same or different.
  • the current coding unit may be a coding block or a coding strip. Regardless of whether the specifications of the two are the same, there is a corresponding matching relationship between the current coding unit and the initial coding unit. For example, if the current coding unit is a coding strip and the initial coding unit is a coding block, then there are multiple corresponding initial coding units that match the current coding unit.
  • a target initial coding unit that matches the current coding unit is acquired, and then a current reference quantization parameter corresponding to the current coding unit is calculated according to an initial quantization parameter corresponding to the target initial coding unit.
  • the current reference quantization parameter may be obtained by subtracting a value from the initial quantization parameter corresponding to the target initial coding unit.
  • the target initial decoding frame corresponding to the current video frame is obtained, the initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame is obtained, and the initial quantization parameters corresponding to the initial coding units are sorted according to the size. Sorting the result, and determining a current reference quantization parameter corresponding to the current coding unit according to the ranking result.
  • Step S206 determining a quantization parameter to be encoded corresponding to the current coding unit.
  • the current coding unit to be encoded is obtained, and the quantization parameter to be encoded corresponding to the current coding unit is calculated. Since the encoding depends on the quantization parameter corresponding to the coding unit, before encoding, it is first necessary to calculate the quantization parameter to be encoded corresponding to the coding unit. The calculation of the quantization parameter to be encoded is related to factors such as image complexity and target code rate. The specific calculation can be calculated by the rate control algorithm, or the adaptive quantization parameter calculation method can be used. Of course, other algorithms can also be used for calculation. The calculation of the coding quantization parameter is not limited here.
  • Step S208 determining a difference width between a current reference quantization parameter corresponding to the current coding unit and a corresponding quantization parameter to be coded, and increasing a quantization parameter to be coded corresponding to the current coding unit according to the gap size, to obtain a target coding quantization parameter.
  • the gap magnitude refers to the magnitude of the difference between the current reference quantization parameter corresponding to the current coding unit and the quantization parameter to be encoded. According to the calculated gap magnitude, the quantization parameter to be encoded corresponding to the current coding unit is correspondingly increased and adjusted, and the target coding quantization parameter is obtained.
  • the target coded quantization parameter refers to the resulting quantized parameter that is ultimately used for encoding.
  • the current reference quantization parameter reflects the magnitude of the quantization parameter employed in encoding the initial coding unit, and the quantization parameter reflects the fineness of the image. Since the original compressed video is decoded not by the original video but by the already compressed video, if the quality of the already compressed video is not good, even if the encoding is performed with a relatively small quantization parameter, the encoding cannot be further improved. Video quality, but will waste the bit rate. Therefore, by using the current reference quantization parameter as a reference value, the difference between the current reference quantization parameter and the quantization parameter to be encoded is calculated. When the difference amplitude is relatively large, the quantization parameter to be encoded is relatively small, and the coding quantization parameter can be corresponding according to the gap magnitude.
  • the magnitude of the quantization parameter increase adjustment is positively correlated with the magnitude of the gap, and the larger the gap is, the larger the adjustment parameter of the corresponding quantization parameter is.
  • Step S210 encoding the current coding unit according to the target coding quantization parameter.
  • the target coded quantization parameter is a final coded quantization parameter corresponding to the current coding unit.
  • the current coding unit is encoded according to the adjusted target coding quantization parameter, and the corresponding compressed video is obtained. Since the calculated quantization parameter to be encoded is adjusted and adjusted, it is beneficial to ensure subjective quality. Improve the compression ratio of the video, reduce the corresponding code rate, and save the corresponding bandwidth cost.
  • the current video frame to be transcoded is identified. If the current video frame contains the target content (for example, the content including the face), the current quantization parameter to be encoded is not adjusted and adjusted.
  • the video transcoding method by acquiring an initial quantization parameter corresponding to an initial coding unit when encoding the initial compressed video, determining a current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter, and then according to the to-be-coded quantization parameter corresponding to the current coding unit, The gap between the current reference quantization parameters is increased, the quantization parameter to be encoded is increased and adjusted, the target coding quantization parameter is obtained, and finally the current coding unit is coded according to the target quantization parameter.
  • increasing the adjustment of the coding quantization parameter is beneficial to improve the compression efficiency and thus reduce the bandwidth cost.
  • the step S204 of determining the current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit is obtained by acquiring the current coding unit in the current video frame, and the step S204 includes:
  • Step S204A Acquire a target initial decoded frame that matches the current video frame.
  • the initial decoded frame refers to a video frame obtained by decoding the initial compressed video.
  • the target initial decoded frame refers to the initial decoded frame that matches the current video frame.
  • the current video frame refers to the video frame currently to be encoded.
  • the server receives the initial compressed video, decodes the initial compressed video, obtains an initial decoded frame, and then re-encodes the video by using the initial decoded frame as the video frame to be encoded. Therefore, the video frame to be encoded has a one-to-one correspondence with the initial decoded frame.
  • the matching relationship between the video frame to be encoded and the initial decoded frame may be customized.
  • the initial decoded frame corresponding to the current video frame may be directly used as the target initial decoded frame.
  • the current video frame may also be matched with multiple initial decoded frames, for example, the current video frame and the corresponding initial decoded frame and the decoded frame adjacent to the initial decoded frame are used as matching target initial decoding frames.
  • the initial decoded frame obtained by decoding the initial compressed video has 6 frames, which are 1, 2, 3, 4, 5, and 6, respectively.
  • the current video frame to be encoded is 3, and the target initial decoding frame that matches the current video frame 3 can be obtained according to a pre-customized rule.
  • the corresponding initial decoding frame 3 can be directly set as the matching target initial decoding frame. It is also possible to set the initial decoded frames 2, 3 and 4 together as the target initial decoded frame.
  • Step S204B Acquire a target initial coding unit that is matched by the current coding unit in the target initial decoding frame.
  • the current coding unit refers to a coding unit currently to be encoded, and the current coding unit is included in the current video frame. Obtaining a target initial coding unit that the current coding unit matches in the target initial decoded frame.
  • the matching relationship between the coding unit to be coded and the original coding unit can also be customized.
  • an initial coding unit in the target initial decoded frame may be used as the target initial coding unit that matches the current coding unit.
  • a plurality of initial decoding units in the target initial decoded frame may also be used together as a target initial encoding unit that matches the current coding unit.
  • the initial coding unit corresponding to the current coding unit position in the target initial decoded frame may be used as the target initial coding unit that matches the current coding unit.
  • Step S204C Determine a current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the target initial coding unit.
  • the current reference quantization parameter is a criterion for measuring the quantization parameter to be encoded corresponding to the current coding unit, and then the quantization parameter to be encoded is adjusted according to the current reference quantization parameter. Specifically, the initial quantization parameter corresponding to the target initial coding unit is obtained, and then the current reference quantization parameter corresponding to the current coding unit is calculated according to the initial quantization parameter. In an embodiment, it is assumed that an initial quantization parameter of an initial decoding frame corresponding to a current video frame cannot be obtained. Since quantization parameters of adjacent frames are relatively close, an initial quantization parameter corresponding to an adjacent frame may be acquired as a corresponding initial quantization parameter. And then determine the current reference quantization parameter corresponding to the current coding unit. In one embodiment, the initial quantization parameter may be subtracted from a certain predetermined value to obtain a current reference quantization parameter corresponding to the current coding unit.
  • the step S204 of determining the current reference unit in the current video frame and determining the current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit includes:
  • Step S204a Acquire a target initial decoded frame that matches the current video frame.
  • the initial decoded frame refers to a video frame obtained by decoding the initial compressed video.
  • the target initial decoded frame refers to the initial decoded frame that matches the current video frame.
  • the current video frame refers to the video frame currently to be encoded.
  • the server receives the initial compressed video, decodes the initial compressed video, obtains an initial decoded frame, and then re-encodes the video by using the initial decoded frame as the video frame to be encoded. Therefore, the video frame to be encoded has a one-to-one correspondence with the initial decoded frame.
  • the matching relationship between the video frame to be encoded and the initial decoded frame may be customized.
  • the initial decoded frame corresponding to the current video frame may be directly used as the target initial decoded frame.
  • the current video frame may also be matched with a plurality of initial decoded frames, for example, the current video frame is used as a matching target initial decoding frame together with the corresponding initial decoded frame and the decoded frame adjacent to the initial decoded frame.
  • the initial decoded frame obtained by decoding the initial compressed video has 6 frames, which are 1, 2, 3, 4, 5, and 6, respectively.
  • the current video frame to be encoded is 3, and the target initial decoding frame that matches the current video frame 3 can be obtained according to a pre-customized rule.
  • the corresponding initial decoding frame 3 can be directly set as the matching target initial decoding frame. It is also possible to set the initial decoded frames 2, 3 and 4 together as the target initial decoded frame of the match.
  • Step S204b Acquire an initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame.
  • each initial decoding frame includes a plurality of initial coding units, and after obtaining the matched target initial decoding frame, the initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame needs to be acquired.
  • Step S204c Sort the initial quantization parameters corresponding to the respective initial coding units according to the size to obtain a ranking result, and determine a current reference quantization parameter corresponding to the current coding unit according to the ranking result.
  • each initial quantization parameter is sorted according to the size of the initial quantization parameter, and a corresponding sorting result is obtained, where the ordering may be from large to small. It can also be from small to large.
  • the current reference quantization parameter corresponding to the current coding unit is then determined according to the ranking result.
  • the sorted second to last small quantization parameter may be used as the current reference quantization parameter corresponding to the current coding unit.
  • the first 10% initial quantization parameter may be obtained, then the average of the 10% initial quantization parameters is calculated, and the calculated average is taken as the current reference quantization parameter corresponding to the current coding unit.
  • the step of determining a current reference quantization parameter corresponding to the current coding unit according to the ranking result comprises: using a minimum initial quantization parameter in the ranking result as a current reference quantization parameter corresponding to the current coding unit.
  • the smallest initial quantization parameter in the sorting result is used as the current reference quantization parameter corresponding to the current coding unit, and the smaller the quantization parameter, the higher the fineness of the representative, so The minimum value in the result is used as the current reference quantization parameter, which is advantageous for subsequent adjustment and adjustment of the quantization parameter to be encoded according to the current reference quantization parameter, so as to increase the corresponding compression ratio and save bandwidth cost.
  • the step of determining the current reference coding parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit is performed by acquiring the current coding unit in the current video frame, and acquiring an initial video coding standard corresponding to the initial compressed video, and acquiring The current video coding standard corresponding to the current video frame; determining a mapping relationship of the quantization parameter according to the initial video coding standard and the current video coding standard; and obtaining the current reference quantization parameter according to the initial quantization parameter and the mapping relationship corresponding to the initial coding unit.
  • the original quantization parameter needs to be mapped to the quantization parameter in the current video coding standard corresponding to the current video frame.
  • f i F (S 1 , S 2 )
  • S 1 is the initial compressed video coding standard
  • S 2 is the current video coding standard.
  • determining a difference width between a current reference quantization parameter corresponding to a current coding unit and a corresponding quantization parameter to be coded, and increasing a quantization parameter to be coded corresponding to the current coding unit according to the gap size includes:
  • step S208A it is determined whether the gap width is greater than a preset threshold. If yes, the process proceeds to step S208B, and if no, the process proceeds to step S208D.
  • the gap magnitude refers to the magnitude of the difference between the current reference quantization parameter and the quantization parameter to be encoded. Determine whether the gap is larger than the preset threshold. If yes, it indicates that the encoding quantization parameter needs to be increased and adjusted. By obtaining the adjustment coefficient, the quantization parameter increment is calculated according to the adjustment coefficient and the gap width; if not, the quantization parameter to be encoded need not be adjusted. The quantization parameter to be encoded is directly used as the target coding quantization parameter.
  • Step S208B Obtain an adjustment coefficient, and calculate a quantization parameter increment according to the adjustment coefficient and the gap width.
  • the adjustment factor is a coefficient for controlling the magnitude of the adjustment amplitude, which may be preset. After calculating the difference amplitude, the corresponding quantization parameter increment can be calculated according to the adjustment coefficient and the gap width. In one embodiment, the product of the adjustment factor and the gap magnitude can be directly used as a quantization parameter increment. In another embodiment, the product of the adjustment factor and the gap magnitude may be further added to a constant as a quantization parameter increment.
  • Step S208C Calculate the target coding quantization parameter according to the quantization parameter increment and the quantization parameter to be encoded corresponding to the current coding unit.
  • the quantization parameter increment refers to an adjustment amount to be increased by the quantization parameter to be encoded
  • the target coding quantization parameter is obtained by adding the quantization parameter increment to the quantization parameter to be encoded
  • step S208D the quantization parameter to be encoded is directly used as the target coding quantization parameter.
  • the quantization parameter to be encoded is directly used as the target coding quantization parameter, and no adjustment is needed.
  • the current reference quantization parameter is determined by the quantization parameter corresponding to the initial coding unit, and the current reference quantization parameter reflects the quantization parameter used when encoding the initial coding unit, and the quantization parameter reflects the fineness of the image. Since the original compressed video is decoded instead of the original video, but the compressed video, if the compressed video quality is not good, even if the quantization parameter used in transcoding is small, the video quality cannot be further improved, and the code rate is wasted.
  • the quantization parameter facilitates the improvement of the compression ratio of the encoding under the premise of ensuring subjective quality, avoids wasting the bit rate, and reduces the corresponding bandwidth cost.
  • the segmentation function is used to calculate the target coding quantization parameter corresponding to the current coding unit.
  • the calculated quantization parameter to be encoded is greater than the current reference quantization parameter minus the preset threshold, it is not necessary to adjust the quantization parameter to be encoded, that is, the calculated quantization to be encoded is directly used as the target coding quantization parameter.
  • the calculated quantization parameter to be encoded is less than or equal to the current reference quantization parameter minus the preset threshold, the corresponding quantization parameter increment is calculated according to the adjustment coefficient and the difference between the current reference quantization parameter and the quantization parameter to be encoded. Then the target coding quantization parameter is equal to the sum of the quantization parameter to be encoded and the quantization parameter increment.
  • the video transcoding method further includes: acquiring a target initial decoding frame that matches a current video frame; and determining an average reference quantization parameter corresponding to the current coding unit according to an initial quantization parameter corresponding to the initial coding unit in the target initial decoding frame.
  • the average reference quantization parameter corresponding to the current coding unit is calculated according to the initial quantization parameter corresponding to the initial coding unit in the target initial decoding frame.
  • the initial quantization parameters corresponding to the respective initial coding units may be directly averaged to obtain an average reference quantization parameter.
  • the initial quantization parameters may also be sorted by size, and then the value corresponding to the initial quantization parameter of the intermediate position is taken as the average reference quantization parameter.
  • the calculated average reference quantization parameters need to be mapped and calculated to obtain a final average reference quantization parameter.
  • the step of obtaining the adjustment coefficient comprises: calculating a target difference value between the average reference quantization parameter and the current reference quantization parameter; calculating an adjustment coefficient according to the target difference, the adjustment coefficient being inversely related to the target difference.
  • the determining of the adjustment coefficient may be calculated according to a difference between the average reference quantization parameter and the current reference quantization parameter, and the difference between the calculated average reference quantization parameter and the current reference quantization parameter is called "Target difference".
  • Target difference the difference between the calculated average reference quantization parameter and the current reference quantization parameter.
  • the step of determining an average reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit in the target initial decoding frame comprises: acquiring an initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame. And performing average calculation according to the initial quantization parameter corresponding to each initial coding unit to obtain an average quantization parameter; and using the average quantization parameter as an average reference quantization parameter corresponding to the current coding unit in the current video frame.
  • the operation obtains an average quantization parameter, and directly uses the average quantization parameter as an average reference quantization parameter corresponding to the current coding unit in the current video frame.
  • the video transcoding method further includes: a step of classifying a current video frame according to a frame average quantization parameter corresponding to a current video frame, where the step includes the following steps:
  • Step S212A Acquire an initial decoded frame obtained by decoding the initial compressed video, calculate a frame average quantization parameter corresponding to each initial decoded frame, and calculate a video average quantization parameter corresponding to the initial compressed video according to the frame average quantization parameter.
  • the initial decoded frame is a video frame resulting from decoding the initial compressed video.
  • the frame average quantization parameter refers to an average quantization parameter corresponding to the initial decoded frame, and the frame average quantization parameter may obtain an initial quantization parameter corresponding to each initial coding unit in the initial decoded frame, and then perform an average operation according to the initial quantization parameter corresponding to each initial coding unit. The average value obtained can be used as a frame average quantization parameter.
  • the video average quantization parameter corresponding to the initial compressed video may be calculated according to the frame average quantization parameter corresponding to each initial decoded frame in the initial compressed video.
  • Step S212B determining whether the difference between the frame average quantization parameter and the video average quantization parameter is greater than a preset parameter, and if yes, proceeding to step S212C, and if no, proceeding to step S212D.
  • the difference between the frame average quantization parameter and the video average quantization parameter is determined. If it is greater than a preset parameter (for example, 5), such a video frame is regarded as a type of video frame, otherwise, as a second type of video frame. .
  • a preset parameter for example, 5
  • Step S212C The current video frame that matches the initial decoded frame is used as a type of video frame.
  • Step S212D The current video frame that matches the initial decoded frame is used as the second type of video frame.
  • the initial decoded frames are divided into two categories based on the magnitude of the difference between the video average quantization parameter and the frame average quantization parameter. Since the decoded initial frame is used as the current video frame to be encoded, the initial decoded frame is in one-to-one correspondence with the current video frame. When the difference between the frame average quantization parameter and the video average quantization parameter is greater than a preset parameter, The current video frame corresponding to the initial decoded frame is used as a type of video frame. Otherwise, the current video frame corresponding to the initial decoded frame is used as the second type of video frame.
  • the difference between the frame average quantization parameter and the video average quantization parameter is relatively large, it indicates that the quantization parameter corresponding to the initial coding unit of the video frame is large, and the corresponding image quality is poor. On the contrary, the image quality is better.
  • the step S208B includes: when the current video frame where the current coding unit is located is a type of video frame, acquiring the first adjustment coefficient, according to the first adjustment coefficient and the gap The amplitude calculation obtains the quantization parameter increment; when the current video frame where the current coding unit is located is the second type of video frame, the second adjustment coefficient is obtained, and the quantization parameter increment is calculated according to the second adjustment coefficient and the gap amplitude.
  • the adjustment coefficients are set for different types of video frames, and for those video frames whose frame average quantization parameters are relatively large, the adjustment coefficients may be correspondingly adjusted.
  • the setting is larger, because the average quantization parameter of the frame corresponding to the initial decoded frame is relatively large, indicating that the original image quality of the frame is already very poor, so even if the encoding is performed with a smaller quantization parameter, the quality cannot be improved.
  • the adjustment factor is increased, which is beneficial to further improve the compression efficiency.
  • the adjustment coefficient can be set smaller.
  • FIG. 7 it is a schematic flowchart of video transcoding in one embodiment.
  • the video before compression of the terminal is referred to as “original video”
  • the code stream after compression by the terminal is referred to as “one-time compressed code stream”, that is, the code stream to be transcoded
  • the terminal compression process is referred to as “one-time compression”.
  • the terminal uploads the compressed stream to the server once.
  • the server transcoding process is divided into "one-time compressed code stream decoding" and "secondary compression”.
  • the code stream obtained after transcoding the server is called “secondary compressed code stream", and the server Compression is called “secondary compression.”
  • the server first decodes the compressed code stream, obtains an initial quantization parameter of each coding unit in the compressed video frame, and calculates a secondary compression corresponding to each coding unit according to the initial quantization parameter.
  • Quantizing the reference value of the parameter then calculating the secondary compression quantization parameter of each coding unit, and increasing and adjusting the calculated secondary compression quantization parameter according to the reference value of the secondary compression quantization parameter to obtain a secondary compression target quantization parameter, and then The coding unit is coded according to the secondary compression target quantization parameter to obtain a secondary compressed code stream.
  • a quantization scheme is calculated for each coding unit, and then a flow diagram of coding the coding unit is performed.
  • prediction is performed.
  • the purpose of prediction is to reduce spatial redundancy and temporal redundancy of video images by intra prediction and inter prediction.
  • the transformation is performed to remove the correlation between adjacent data by transforming from the time domain to the frequency domain, that is, to remove spatial redundancy.
  • quantization is performed, which is different from the traditional direct calculation of the quantization parameters. By adjusting the calculated quantization parameters, it is beneficial to improve the compression efficiency and avoid the waste of the code stream.
  • the encoding unit is encoded by entropy coding. .
  • a video transcoding method which specifically includes the following steps:
  • Step S901 Acquire an initial quantization parameter corresponding to an initial coding unit when encoding the initial compressed video.
  • Step S902 Acquire a target initial decoding frame that matches the current video frame, and obtain an initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame.
  • Step S903 Sort the initial quantization parameters corresponding to the initial coding units according to the size to obtain a ranking result, and use the smallest initial quantization parameter in the ranking result as the current reference quantization parameter corresponding to the current coding unit.
  • Step S904 calculating a quantization parameter to be encoded corresponding to the current coding unit
  • Step S905 calculating a difference between the current reference quantization parameter corresponding to the current coding unit and the corresponding quantization parameter to be coded;
  • step S906 it is determined whether the gap width is greater than a preset threshold. If yes, the process goes to step S907, and if no, the process goes to step S908.
  • Step S907 obtaining an adjustment coefficient, calculating a quantization parameter increment according to the adjustment coefficient and the gap width, and calculating a target coding quantization parameter according to the quantization parameter increment and the quantization parameter to be encoded corresponding to the current coding unit.
  • step S908 the quantization parameter to be encoded is directly used as the target coding quantization parameter.
  • Step S909 encoding the current coding unit according to the target coding quantization parameter.
  • a video transcoding device comprising:
  • the initial quantization parameter obtaining module 1002 is configured to obtain an initial quantization parameter corresponding to the initial coding unit when encoding the initial compressed video.
  • a determining module 1004 configured to acquire a current coding unit in a current video frame, and determine a current reference quantization parameter corresponding to the current coding unit according to an initial quantization parameter corresponding to the initial coding unit;
  • the to-be-coded quantization parameter determining module 1006 is configured to determine a quantization parameter to be encoded corresponding to the current coding unit;
  • the target coding quantization parameter determining module 1008 is configured to determine a gap between the current reference quantization parameter corresponding to the current coding unit and the corresponding quantization parameter to be encoded, and increase the to-be-corresponding to the current coding unit according to the gap magnitude Encoding the quantization parameter to obtain a target coding quantization parameter;
  • the encoding module 1010 is configured to encode the current coding unit according to the target coding quantization parameter.
  • the determining module 1004 is further configured to acquire a target initial decoding frame that is matched by the current video frame, and obtain a target initial coding unit that is matched by the current coding unit in the target initial decoded frame, according to the target initial coding.
  • the initial quantization parameter corresponding to the unit determines a current reference quantization parameter corresponding to the current coding unit.
  • the determining module 1004 includes:
  • the sorting module 1004A is configured to acquire a target initial decoding frame that matches the current video frame, and obtain an initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame, and perform initial quantization parameters corresponding to the initial coding units according to the size. Sort to get the sort result;
  • the current reference quantization parameter determining module 1004B is configured to determine a current reference quantization parameter corresponding to the current coding unit according to the ranking result.
  • the current reference quantization parameter determining module is further configured to use a minimum initial quantization parameter of the sorting result as a current reference quantization parameter corresponding to the current coding unit.
  • the determining module 1004 is further configured to acquire an initial video coding standard corresponding to the initial compressed video, and obtain a current video coding standard corresponding to the current video frame, according to the initial video coding standard and the current video.
  • the coding standard determines a mapping relationship of the quantization parameter to obtain the current reference quantization parameter according to the initial quantization parameter corresponding to the initial coding unit and the mapping relationship.
  • the target encoding quantization parameter determining module 1008 is further configured to: when the gap amplitude is greater than a preset threshold, acquire an adjustment coefficient, and calculate a quantization parameter increment according to the adjustment coefficient and the gap amplitude; And calculating a target coding quantization parameter according to the quantization parameter increment and the quantization parameter to be encoded corresponding to the current coding unit.
  • the video transcoding device further includes:
  • the average reference quantization parameter determining module 1012 is further configured to obtain a target initial decoding frame that matches the current video frame, and determine an average reference quantization parameter corresponding to the current coding unit according to an initial quantization parameter corresponding to the initial coding unit in the target initial decoding frame;
  • the target encoding quantization parameter determining module 1008 is further configured to calculate a target difference value of the average reference quantization parameter and the current reference quantization parameter, and calculate an adjustment coefficient according to the target difference, the adjustment coefficient and the target The difference is positively correlated.
  • the average reference quantization parameter determining module 1012 is further configured to obtain an initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame, and perform an average calculation according to the initial quantization parameter corresponding to each initial coding unit.
  • An average quantization parameter; the average quantization parameter is used as an average reference quantization parameter corresponding to a current coding unit in the current video frame.
  • the video transcoding device includes:
  • the video average quantization parameter calculation module 1014 is configured to obtain an initial decoded frame obtained by decoding the initial compressed video, calculate a frame average quantization parameter corresponding to each initial decoded frame, and calculate and obtain the initial compressed video according to the frame average quantization parameter. Corresponding video average quantization parameter;
  • the video frame determining module 1016 is configured to: when the difference between the video average quantization parameter and the frame average quantization parameter is greater than a preset parameter, use a current video frame that matches the initial decoded frame as a type of video frame. ;
  • the second type of video frame determining module 1018 is configured to: when the difference between the video average quantization parameter and the frame average quantization parameter is less than or equal to a preset parameter, use a current video frame that matches the initial decoded frame as a second class.
  • the target coded quantization parameter determining module 1008 is further configured to: when the current video frame where the current coding unit is located, is a type of video frame, obtain a first adjustment coefficient, and calculate, according to the first adjustment coefficient and the difference amplitude, Quantizing the parameter increment; when the current video frame in which the current coding unit is located is a second type of video frame, acquiring a second adjustment coefficient, and calculating a quantization parameter increment according to the second adjustment coefficient and the difference width.
  • Figure 14 is a diagram showing the internal structure of a computer device in one embodiment.
  • the computer device may specifically be the server 120 of FIG.
  • the computer device includes the computer device including a processor, a memory, and a network interface 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 transcoding method.
  • the internal memory can also store computer readable instructions that, when executed by the processor, cause the processor to perform a video transcoding method.
  • FIG. 14 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied.
  • the specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • the video transcoding device provided herein can be implemented in the form of a computer readable instruction that can be executed on a computer device as shown in FIG.
  • Each program module constituting the video transcoding device may be stored in a memory of the computer device, for example, an initial quantization parameter acquisition module 1002, a determination module 1004, a quantization parameter calculation module 1006 to be encoded, and a target coding quantization parameter determination module shown in FIG. 1008 and encoding module 1010.
  • the computer readable instructions formed by the various program modules cause the processor to perform the steps in the video transcoding method of various embodiments of the present application described in this specification.
  • the 14 may perform initial quantization parameters corresponding to the initial coding unit when the initial compressed video is encoded by the initial quantization parameter acquisition module 1002 in the video transcoding device shown in FIG. 10; Obtaining a current coding unit in the current video frame, determining a current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit; and calculating, by the to-be-coded quantization parameter calculation module 1006, the current coding unit a quantization parameter to be encoded; the target encoding quantization parameter determining module 1008 performs a calculation of a gap between a current reference quantization parameter corresponding to the current coding unit and a corresponding quantization parameter to be encoded, and increases the current coding according to the gap width The quantization parameter to be encoded corresponding to the unit obtains the target coding quantization parameter; and the encoding module 1010 performs encoding on the current coding unit according to the target coding quantization parameter.
  • a computer device comprising a memory and one or more processors, the memory storing computer readable instructions, the computer readable instructions being executed by the one or more processors such that the one or more The processor performs the following steps: obtaining an initial quantization parameter corresponding to the initial coding unit when the initial compressed video is encoded; determining a current reference quantization parameter corresponding to the current coding unit in the current video frame according to the initial quantization parameter corresponding to the initial coding unit; a quantization parameter to be encoded corresponding to the current coding unit; determining a difference width between the to-be-coded quantization parameter corresponding to the current coding unit and the corresponding current reference quantization parameter, and increasing the to-be-coded quantization corresponding to the current coding unit according to the gap width And obtaining a target coding quantization parameter, and encoding the current coding unit according to the target coding quantization parameter.
  • the step of acquiring the current coding unit in the current video frame and determining the current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit includes: acquiring a current video frame matching The target initial decoding frame is obtained; the target initial coding unit that is matched by the current coding unit in the target initial decoding frame is obtained; and the current reference quantization parameter corresponding to the current coding unit is determined according to the initial quantization parameter corresponding to the target initial coding unit.
  • the step of acquiring the current coding unit in the current video frame and determining the current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit includes: acquiring a current video frame match a target initial decoding frame; acquiring an initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame; sorting initial quantization parameters corresponding to the respective initial coding units according to the size to obtain a sorting result, and determining, according to the sorting result a current reference quantization parameter corresponding to the current coding unit.
  • the determining, according to the ranking result, the current reference quantization parameter corresponding to the current coding unit comprises: using a minimum initial quantization parameter of the ranking result as a current current corresponding to the current coding unit Refer to the quantization parameters.
  • the step of acquiring the current coding unit in the current video frame, and determining the current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit includes: acquiring the initial compressed video Corresponding initial video coding standard, acquiring a current video coding standard corresponding to the current video frame; determining a mapping relationship of the quantization parameter according to the initial video coding standard and the current video coding standard; and initial quantization parameter corresponding to the initial coding unit And the mapping relationship to obtain the current reference quantization parameter.
  • the step of obtaining the target coding quantization parameter includes: when the gap amplitude is greater than a preset threshold, acquiring an adjustment coefficient, and calculating a quantization parameter increment according to the adjustment coefficient and the gap amplitude; according to the quantization parameter increment
  • the target coding quantization parameter is calculated by calculating a quantization parameter to be encoded corresponding to the current coding unit.
  • the processor when the computer readable instructions are executed by the processor, the processor further causes the processor to perform the steps of: acquiring a target initial decoded frame of a current video frame match; initial coding unit in the initial decoded frame according to the target Corresponding initial quantization parameter determines an average reference quantization parameter corresponding to the current coding unit; the step of acquiring the adjustment coefficient includes: calculating a target difference value of the average reference quantization parameter and the current reference quantization parameter; according to the target difference The value calculation yields an adjustment factor that is positively correlated with the target difference.
  • the determining, according to the initial quantization parameter corresponding to the initial coding unit in the target initial decoding frame, the average reference quantization parameter corresponding to the current coding unit comprises: acquiring an initial corresponding to each initial coding unit in the target initial decoding frame The quantization parameter is averaged according to the initial quantization parameter corresponding to each initial coding unit to obtain an average quantization parameter; and the average quantization parameter is used as an average reference quantization parameter corresponding to the current coding unit in the current video frame.
  • the computer readable instructions when executed by the processor, further cause the processor to perform the steps of: obtaining an initial decoded frame obtained by decoding the initial compressed video, and calculating respective initial decoded frames a frame average quantization parameter, and calculating, according to the frame average quantization parameter, a video average quantization parameter corresponding to the initial compressed video; when a difference between the video average quantization parameter and the frame average quantization parameter is greater than a preset parameter, And the current video frame that matches the initial decoded frame is used as a type of video frame; and when the difference between the video average quantization parameter and the frame average quantization parameter is less than or equal to a preset parameter,
  • the matching current video frame is used as the second type of video frame;
  • the obtaining the adjustment coefficient, and the step of calculating the quantization parameter increment according to the adjustment coefficient and the gap width comprises: when the current video frame where the current coding unit is located is one When the video frame is similar, the first adjustment coefficient is obtained, and the quantization is calculated according to the first adjustment coefficient and the
  • one or more non-transitory computer readable storage media having stored thereon computer readable instructions, when executed by one or more processors, cause one or more processors Performing the following steps: obtaining an initial quantization parameter corresponding to the initial coding unit when the initial compressed video is encoded; determining a current reference quantization parameter corresponding to the current coding unit in the current video frame according to the initial quantization parameter corresponding to the initial coding unit; determining the current coding a quantization parameter to be encoded corresponding to the unit; determining a difference width between the to-be-coded quantization parameter corresponding to the current coding unit and the corresponding current reference quantization parameter, and increasing the to-be-coded quantization parameter corresponding to the current coding unit according to the gap size, Obtaining a target coding quantization parameter; encoding the current coding unit according to the target coding quantization parameter.
  • the step of acquiring the current coding unit in the current video frame and determining the current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit includes: acquiring a current video frame matching The target initial decoding frame is obtained; the target initial coding unit that is matched by the current coding unit in the target initial decoding frame is obtained; and the current reference quantization parameter corresponding to the current coding unit is determined according to the initial quantization parameter corresponding to the target initial coding unit.
  • the step of acquiring the current coding unit in the current video frame and determining the current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit includes: acquiring a current video frame match a target initial decoding frame; acquiring an initial quantization parameter corresponding to each initial coding unit in the target initial decoding frame; sorting initial quantization parameters corresponding to the respective initial coding units according to the size to obtain a sorting result, and determining, according to the sorting result a current reference quantization parameter corresponding to the current coding unit.
  • the determining, according to the ranking result, the current reference quantization parameter corresponding to the current coding unit comprises: using a minimum initial quantization parameter of the ranking result as a current current corresponding to the current coding unit Refer to the quantization parameters.
  • the step of acquiring the current coding unit in the current video frame, and determining the current reference quantization parameter corresponding to the current coding unit according to the initial quantization parameter corresponding to the initial coding unit includes: acquiring the initial compressed video Corresponding initial video coding standard, acquiring a current video coding standard corresponding to the current video frame; determining a mapping relationship of the quantization parameter according to the initial video coding standard and the current video coding standard; and initial quantization parameter corresponding to the initial coding unit And the mapping relationship to obtain the current reference quantization parameter.
  • the step of obtaining the target coding quantization parameter includes: when the gap amplitude is greater than a preset threshold, acquiring an adjustment coefficient, and calculating a quantization parameter increment according to the adjustment coefficient and the gap amplitude; according to the quantization parameter increment
  • the target coding quantization parameter is calculated by calculating a quantization parameter to be encoded corresponding to the current coding unit.
  • the processor when the computer readable instructions are executed by the processor, the processor further causes the processor to perform the steps of: acquiring a target initial decoded frame of a current video frame match; initial coding unit in the initial decoded frame according to the target Corresponding initial quantization parameter determines an average reference quantization parameter corresponding to the current coding unit; the step of acquiring the adjustment coefficient includes: calculating a target difference value of the average reference quantization parameter and the current reference quantization parameter; according to the target difference The value calculation yields an adjustment factor that is positively correlated with the target difference.
  • the determining, according to the initial quantization parameter corresponding to the initial coding unit in the target initial decoding frame, the average reference quantization parameter corresponding to the current coding unit comprises: acquiring an initial corresponding to each initial coding unit in the target initial decoding frame The quantization parameter is averaged according to the initial quantization parameter corresponding to each initial coding unit to obtain an average quantization parameter; and the average quantization parameter is used as an average reference quantization parameter corresponding to the current coding unit in the current video frame.
  • the computer readable instructions when executed by the processor, further cause the processor to perform the steps of: obtaining an initial decoded frame obtained by decoding the initial compressed video, and calculating respective initial decoded frames a frame average quantization parameter, and calculating, according to the frame average quantization parameter, a video average quantization parameter corresponding to the initial compressed video; when a difference between the video average quantization parameter and the frame average quantization parameter is greater than a preset parameter, And the current video frame that matches the initial decoded frame is used as a type of video frame; and when the difference between the video average quantization parameter and the frame average quantization parameter is less than or equal to a preset parameter,
  • the matching current video frame is used as the second type of video frame;
  • the obtaining the adjustment coefficient, and the step of calculating the quantization parameter increment according to the adjustment coefficient and the gap width comprises: when the current video frame where the current coding unit is located is one When the video frame is similar, the first adjustment coefficient is obtained, and the quantization is calculated according to the first adjustment coefficient and the
  • 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

Landscapes

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

Abstract

本申请涉及一种视频转码方法包括:获取编码初始压缩视频时初始编码单元对应的初始量化参数;根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;确定所述当前编码单元对应的待编码量化参数;确定当前编码单元对应的待编码量化参数与对应的当前参考量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;根据所述目标编码量化参数对当前编码单元进行编码。

Description

视频转码方法、计算机设备及存储介质
本申请要求于2017年10月10日提交中国专利局、申请号为2017109370116、发明名称为“视频转码方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机处理技术领域,特别是涉及一种视频转码方法、计算机设备及存储介质。
背景技术
视频转码是指将已经压缩编码的视频码流转换成另一个视频码流,以适应不同的网络带宽、不同的终端处理能力和不同的用户需求。转码的本质是一个先解码,再编码的过程,所以转码前后可能不遵循相同的视频编码标准。
传统的客户端上传已经压缩的视频到服务器,服务器需要对接收到的视频进行转码,传统的视频转码方法的带宽成本高。
发明内容
根据本申请的各种实施例,提出了一种视频转码方法、计算机设备及存储介质。
一种视频转码方法,包括:
计算机设备获取编码初始压缩视频时初始编码单元对应的初始量化参数;
所述计算机设备根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;
所述计算机设备确定所述当前编码单元对应的待编码量化参数;
所述计算机设备确定当前编码单元对应的待编码量化参数与对应的当前参 考量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;及
所述计算机设备根据所述目标编码量化参数对当前编码单元进行编码。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令计算机可读指令,所述计算机可读指令计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
获取编码初始压缩视频时初始编码单元对应的初始量化参数;
根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;
确定所述当前编码单元对应的待编码量化参数;
确定当前编码单元对应的待编码量化参数与对应的当前参考量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;及
根据所述目标编码量化参数对当前编码单元进行编码。
一个或多个存储有计算机可执行指令的非易失性计算机可读存储介质,所述计算机可执行指令被一个或多个处理器执行时,可使得所述一个或多个处理器执行以下步骤:获取编码初始压缩视频时初始编码单元对应的初始量化参数;
根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;
确定所述当前编码单元对应的待编码量化参数;
确定当前编码单元对应的待编码量化参数与对应的当前参考量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;及
根据所述目标编码量化参数对当前编码单元进行编码。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的 其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为一个实施例中视频转码方法的应用环境图;
图2为一个实施例中视频转码方法的流程图;
图3为一个实施例中确定当前编码单元对应的当前参考量化参数的方法流程图;
图4为另一个实施例中确定当前编码单元对应的当前参考量化参数的方法流程图;
图5为一个实施例中确定目标编码量化参数的方法流程图;
图6为一个实施例中根据当前视频帧对应的帧平均量化参数对当前视频帧进行分类的方法流程图;
图7为一个实施例中视频转码的流程示意图;
图8为一个实施例中对编码单元进行编码的流程示意图;
图9为又一个实施例中视频转码方法流程图;
图10为一个实施例中视频转码装置的结构框图;
图11为一个实施例中确定模块的结构框图;
图12为另一个实施例中视频转码装置的结构框图;
图13为又一个实施例中视频转码装置的结构框图;及
图14为一个实施例中计算机设备的内部结构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅 仅用以解释本申请,并不用于限定本申请。
图1为一个实施例中视频转码方法的应用环境图。参照图1,该视频转码方法应用于视频转码系统。可以应用与该视频转码系统中的服务器,也可以应用于视频转码系统中的终端。该视频转码系统包括第一终端110、服务器120和第二终端130。第一终端110和服务器120通过网络连接,服务器120和第二终端130通过网络连接。第一终端110、第二终端130具体可以是台式终端或移动终端,移动终端具体可以是手机、平板电脑、笔记本电脑等中的至少一种。服务器120可以用独立的服务器或者是多个服务器组成的服务器集群来实现。在一个实施例中,首先,第一终端对原始视频进行压缩得到初始压缩视频,然后将初始压缩视频上传到服务器120,服务器120接收到初始压缩视频后,获取编码初始压缩视频时初始编码单元对应的初始量化参数,然后根据初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数,之后确定当前编码单元对应的待编码量化参数,然后确定当前编码单元对应的待编码量化参数与对应的当前参考量化参数之间的差距幅度,根据差距幅度增大当前编码单元对应的待编码量化参数,得到目标编码量化参数,根据目标编码量化参数对当前编码单元进行编码。最后,可以将转码后得到的目标压缩视频发送到第二终端130。
在另一个实施例中,上述视频转码方法可以直接应用于终端110或130。终端110或130获取编码初始压缩视频时初始编码单元对应的初始量化参数,然后根据初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数,之后确定当前编码单元对应的待编码量化参数,然后确定当前编码单元对应的待编码量化参数与对应的当前参考量化参数之间的差距幅度,根据差距幅度增大当前编码单元对应的待编码量化参数,得到目标编码量化参数,根据目标编码量化参数对当前编码单元进行编码。
如图2所示,在一个实施例中,提供了一种视频转码方法。该视频转码方法既可以应用于服务器,也可以应用于终端。本实施例主要以该方法应用于上述图1中的服务器120来举例说明。参照图2,该视频转码方法具体包括如下步骤:
步骤S202,获取编码初始压缩视频时初始编码单元对应的初始量化参数。
在一个实施例中,量化参数(QP,Quantization Parameter)是用来衡量量化步长的参数,其能够影响图像质量,量化参数越小,相应的图像质量越好。举个例子,对于H.264视频编码标准,量化参数QP是量化步长Qstep的序号,取值为0-51。量化参数QP取最小值0时,表示量化最精细,相反,量化参数QP取最大值51时,表示量化最粗糙。量化参数与压缩率成正相关,即量化参数越小,相应的压缩率越小,量化参数越大,相应的压缩率越高。其中,这里的压缩率是指压缩前的大小与压缩后的大小的比值。
视频是由一个个视频帧组成的,而每个视频帧中包含有编码单元,每个编码单元对应一个量化参数。在进行编码时需要计算每个编码单元对应的量化参数,然后根据量化参数对相应的编码单元进行编码。初始压缩视频是相对于本次视频转码而言的,将转码前的视频称为初始压缩视频。初始编码单元是指初始压缩视频中包含的编码单元,初始量化参数是指初始编码单元对应的量化参数。
编码单元是组成视频帧的单元,编码单元可以是视频帧中的编码块,也可以是视频帧中的编码条带,编码条带中包含有多个编码块,由于编码条带中的编码块对应的量化参数相同,所以可以将编码条带看作是一个编码单元,其对应一个量化参数。
在一个实施例中获取初始压缩视频,对初始压缩视频进行解码,得到初始解码帧,初始解码帧是指解码初始压缩视频得到的解码后的视频帧,并获取每个初始编码单元对应的初始量化参数。
步骤S204,根据初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数。
其中,当前视频帧是指当前待编码的视频帧,当前编码单元是指当前视频帧中的编码单元。当前参考量化参数是用来衡量当前编码单元对应的待编码量化参数的参照值。具体地,视频转码的本质是一个先解码,再重新编码的过程。为了对初始压缩视频进行转码,首先,需要对初始压缩视频进行解码,得到初始解码帧,然后将初始解码帧作为待编码的当前视频帧,便于后续重新进行编码。
获取当前视频帧中的当前编码单元,然后根据初始编码单元对应的初始量化参数计算当前编码单元对应的当前参考量化参数。计算当前编码单元对应的当前参考量化参数的方法有多种,在一个实施例中,首先,获取与当前编码单元匹配的目标初始编码单元,由于是将解码得到的初始解码帧作为当前待编码的视频帧,然后重新进行编码,所以初始解码帧和当前待编码的视频帧具有一一对应的关系。初始解码帧中的初始编码单元的规格和当前待编码的视频帧中的当前编码单元的规格可以相同,也可以不同。比如,当初始编码单元为编码块时,当前编码单元可以为编码块,也可以为编码条带。不管两者的规格是否相同,当前编码单元与初始编码单元之间都存在相应的匹配关系。比如,如果当前编码单元为编码条带,而初始编码单元为编码块,那么与当前编码单元匹配的初始编码单元对应的有多个。在一个实施例中,首先,获取与当前编码单元匹配的目标初始编码单元,然后根据目标初始编码单元对应的初始量化参数计算与当前编码单元对应的当前参考量化参数。具体地,可以将目标初始编码单元对应的初始量化参数减去一个数值得到当前参考量化参数。
在另一个实施例中,获取与当前视频帧对应的目标初始解码帧,获取目标初始解码帧中各个初始编码单元对应的初始量化参数,对各个初始编码单元对应的初始量化参数根据大小进行排序得到排序结果,根据排序结果确定与当前编码单元对应的当前参考量化参数。
步骤S206,确定当前编码单元对应的待编码量化参数。
在一个实施例中获取待编码的当前编码单元,计算当前编码单元对应的待编码量化参数。由于编码依赖于编码单元对应的量化参数,所以在编码前,首先需要计算编码单元对应的待编码量化参数。待编码量化参数的计算与图像复杂度、目标码率等因素有关,具体的计算可以采用码率控制算法计算得到,也可以采用自适应量化参数计算方法,当然也可以采用其他的算法计算得到。这里并不对待编码量化参数的计算进行限制。
步骤S208,确定当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据差距幅度增大当前编码单元对应的待编码量化参数,得到目标编码量化参数。
在一个实施例中差距幅度是指当前编码单元对应的当前参考量化参数与待编码量化参数之间的差值大小。根据计算得到的差距幅度对当前编码单元对应的待编码量化参数进行相应的增大调整,得到目标编码量化参数。目标编码量化参数是指得到的最终用于编码的量化参数。
在一个实施例中当前参考量化参数反应了对初始编码单元进行编码时采用的量化参数的大小,而量化参数反应了图像的精细度。由于对初始压缩视频解码得到的不是原始视频,而是已经压缩过的视频,所以如果已经压缩过的视频质量不佳,那么二次压缩时,即使使用比较小的量化参数进行编码也无法进一步提高视频质量,反而会浪费码率。所以通过将当前参考量化参数作为参照值,计算当前参考量化参数与待编码量化参数的差距幅度,当差距幅度比较大时,说明待编码量化参数比较小,可以根据差距幅度对待编码量化参数进行相应的增大调整来提高压缩率。在一个实施例中,量化参数增大调整的幅度与差距幅度成正相关,差距幅度越大,相应的量化参数增大调整幅度越大。该方法通过根据差距幅度适当地增大待编码量化参数,能够在保证主观质量的前提下,提高编码的压缩率,避免浪费码率,并且降低了相应的带宽成本。
步骤S210,根据目标编码量化参数对当前编码单元进行编码。
在一个实施例中目标编码量化参数是与当前编码单元对应的最终编码量化参数。具体地,根据调整得到的目标编码量化参数对当前编码单元进行编码,进而得到相应的压缩视频,由于对计算得到的待编码量化参数进行了增大调整,所以有利于在保证主观质量的前提下提高视频的压缩率,降低了相应的码率,进而节省相应的带宽成本。
在一个实施例中,在提高视频压缩率的同时,为了保证视频中的比较重要的内容(下面称为“目标内容”)所对应的图像质量不受影响,对待转码的当前视频帧进行识别,若当前视频帧中包含有目标内容(比如,包含人脸的内容),则不对当前待编码量化参数进行增大调整。
上述视频转码方法,通过获取编码初始压缩视频时初始编码单元对应的初始量化参数,根据初始量化参数确定与当前编码单元对应的当前参考量化参数,继而根据当前编码单元对应的待编码量化参数与当前参考量化参数之间的差距 幅度,对待编码量化参数进行增大调整,得到目标编码量化参数,最后根据目标量化参数对当前编码单元进行编码。在保证主观质量的前提下,对待编码量化参数进行增大调整,有利于提高压缩效率,从而降低了带宽成本。
如图3所示,在一个实施例中,获取当前视频帧中当前编码单元,根据初始编码单元对应的初始量化参数确定当前编码单元对应的当前参考量化参数的步骤S204包括:
步骤S204A,获取当前视频帧匹配的目标初始解码帧。
在一个实施例中,初始解码帧是指解码初始压缩视频得到的视频帧。目标初始解码帧是指与当前视频帧匹配的初始解码帧。当前视频帧是指当前待编码的视频帧。具体地,服务器接收到初始压缩视频,对该初始压缩视频进行解码,得到初始解码帧,然后将初始解码帧作为待编码的视频帧重新对视频进行编码。所以待编码的视频帧与初始解码帧是一一对应的关系。待编码的视频帧与初始解码帧之间的匹配关系可以自定义,在一个实施例中,可以直接将与当前视频帧对应的初始解码帧作为目标初始解码帧。在另一个实施例中,也可以将当前视频帧与多个初始解码帧匹配,比如,将当前视频帧与相应的初始解码帧以及该初始解码帧相邻的解码帧作为匹配的目标初始解码帧。举个例子,假设解码初始压缩视频得到的初始解码帧有6帧,分别为1,2,3,4,5,6。假设当前待编码的视频帧为3,可以根据预先自定义的规则,获取与当前视频帧3匹配的目标初始解码帧,比如,可以设置直接将对应的初始解码帧3作为匹配的目标初始解码帧,也可以设置将初始解码帧2,3和4一起作为目标初始解码帧。
步骤S204B,获取当前编码单元在目标初始解码帧中匹配的目标初始编码单元。
在一个实施例中,当前编码单元是指当前待编码的编码单元,当前编码单元是包含在当前视频帧中的。获取当前编码单元在目标初始解码帧中匹配的目标初始编码单元。待编码的编码单元与初始编码单元的匹配关系同样可以自定义。比如,在一个实施例中,可以将目标初始解码帧中的一个初始编码单元作为与当前编码单元匹配的目标初始编码单元。在另一个实施例中,也可以将目 标初始解码帧中的多个初始解码单元一起作为与当前编码单元匹配的目标初始编码单元。可以将目标初始解码帧中的与当前编码单元位置相对应的初始编码单元作为与当前编码单元匹配的目标初始编码单元。
步骤S204C,根据目标初始编码单元对应的初始量化参数确定当前编码单元对应的当前参考量化参数。
在一个实施例中,当前参考量化参数是用于衡量当前编码单元对应的待编码量化参数的标准,后续根据当前参考量化参数对待编码的量化参数进行调整。具体地,获取目标初始编码单元对应的初始量化参数,然后根据初始量化参数计算得到当前编码单元对应的当前参考量化参数。在一个实施例中,假设某个当前视频帧对应的初始解码帧的初始量化参数无法获取,由于相邻帧的量化参数比较接近,可以获取相邻帧对应的初始量化参数作为相应的初始量化参数,然后确定当前编码单元对应的当前参考量化参数。在一个实施例中,可以将初始量化参数减去某一预设数值得到与当前编码单元对应的当前参考量化参数。
如图4所示,在一个实施例中,获取当前视频帧中的当前编码单元,根据初始编码单元对应的初始量化参数确定当前编码单元对应的当前参考量化参数的步骤S204包括:
步骤S204a,获取当前视频帧匹配的目标初始解码帧。
在一个实施例中,初始解码帧是指解码初始压缩视频得到的视频帧。目标初始解码帧是指与当前视频帧匹配的初始解码帧。当前视频帧是指当前待编码的视频帧。具体地,服务器接收到初始压缩视频,对该初始压缩视频进行解码,得到初始解码帧,然后将初始解码帧作为待编码的视频帧重新对视频进行编码。所以待编码的视频帧与初始解码帧是一一对应的关系。待编码的视频帧与初始解码帧之间的匹配关系可以自定义,在一个实施例中,可以直接将与当前视频帧对应的初始解码帧作为目标初始解码帧。在另一个实施例中,也可以将当前视频帧与多个初始解码帧匹配,比如,将当前视频帧与相应的初始解码帧以及初始解码帧相邻的解码帧一起作为匹配的目标初始解码帧。举个例子,假设解码初始压缩视频得到的初始解码帧有6帧,分别为1,2,3,4,5,6。假设当前待编码的视频帧为3,可以根据预先自定义的规则,获取与当前视频帧3匹配 的目标初始解码帧,比如,可以设置直接将对应的初始解码帧3作为匹配的目标初始解码帧,也可以设置将初始解码帧2,3和4一起作为匹配的目标初始解码帧。
步骤S204b,获取目标初始解码帧中各个初始编码单元对应的初始量化参数。
在一个实施例中,每个初始解码帧中包含有多个初始编码单元,在获取到匹配的目标初始解码帧后,需要获取目标初始解码帧中各个初始编码单元对应的初始量化参数。
步骤S204c,对各个初始编码单元对应的初始量化参数根据大小进行排序得到排序结果,根据排序结果确定与当前编码单元对应的当前参考量化参数。
在一个实施例中,获取到各个初始编码单元对应的初始量化参数后,根据初始量化参数的大小,将各个初始量化参数进行排序,得到相应的排序结果,其中,排序可以是从大到小,也可以是从小到大。之后根据排序结果来确定与当前编码单元对应的当前参考量化参数。在一个实施例中,可以将排序得到的倒数第二小的初始量化参数作为与当前编码单元对应的当前参考量化参数。在另一个实施例中,可以获取前10%小的初始量化参数,然后计算这10%的初始量化参数的平均值,将计算得到的平均值作为与当前编码单元对应的当前参考量化参数。
在一个实施例中,根据排序结果确定与当前编码单元对应的当前参考量化参数的步骤包括:将排序结果中最小的初始量化参数作为当前编码单元对应的当前参考量化参数。
在一个实施例中,获取到排序结果后,将排序结果中最小的初始量化参数作为当前编码单元对应的当前参考量化参数,由于量化参数越小,其代表的精细度越高,所以通过将排序结果中的最小值作为当前参考量化参数,有利于后续根据当前参考量化参数对待编码的量化参数进行增大调整,以增加相应的压缩率,节约带宽成本。
在一个实施例中,获取当前视频帧中当前编码单元,根据初始编码单元对 应的初始量化参数确定当前编码单元对应的当前参考量化参数的步骤包括:获取初始压缩视频对应的初始视频编码标准,获取当前视频帧对应的当前视频编码标准;根据初始视频编码标准和当前视频编码标准确定量化参数的映射关系;根据初始编码单元对应的初始量化参数和映射关系得到当前参考量化参数。
在一个实施例中如果转码前后采用的是不同的视频压缩标准,那么为了保证量化参数对应的压缩质量相当,需要将原量化参数映射为当前视频帧对应的当前视频编码标准中的量化参数。其中,映射关系的确定是根据初始视频编码标准和当前视频编码标准来确定的,假设初始视频编码标准和当前视频编码标准一样,则映射前后的值相同,相应的公式可以表示为:f(qp)=qp。如果初始视频编码标准和当前视频编码标准不一样,则相应的公式可以表示为qp'=f i(qp),其中f i是映射函数F中的其中一个线性离散的映射函数,其选取规则表示如下:f i=F(S 1,S 2),S 1为初始压缩视频编码标准,S 2为当前视频编码标准。
如图5所示,在一个实施例中,确定当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据差距幅度增大当前编码单元对应的待编码量化参数,得到目标编码量化参数的步骤S208包括:
步骤S208A,判断差距幅度是否大于预设阈值,若是,则进入步骤S208B,若否,则进入步骤S208D。
在一个实施例中,差距幅度是指当前参考量化参数与待编码量化参数之间的差值大小。判断差距幅度是否大于预设阈值,若是,说明需要对待编码量化参数进行增大调整,通过获取调整系数,根据调整系数和差距幅度计算得到量化参数增量;若否,则无需调整待编码量化参数,直接将待编码量化参数作为目标编码量化参数。
步骤S208B,获取调整系数,根据调整系数和差距幅度计算得到量化参数增量。
在一个实施例中,调整系数是用于控制调整幅度大小的系数,可以预先设置。在计算得到差距幅度后,根据调整系数和差距幅度可以计算得到相应的量化参数增量。在一个实施例中,可以直接将调整系数和差距幅度的乘积作为量化参数增量。在另一个实施例中,也可以将调整系数和差距幅度的乘积再加上 一个常数作为量化参数增量。
步骤S208C,根据量化参数增量和当前编码单元对应的待编码量化参数计算得到目标编码量化参数。
在一个实施例中,量化参数增量是指对待编码量化参数增大的调整量,通过将量化参数增量与待编码量化参数进行加和运算得到目标编码量化参数。
步骤S208D,直接将待编码量化参数作为目标编码量化参数。
在一个实施例中,若差距幅度小于或等于预设阈值,则直接将待编码量化参数作为目标编码量化参数,无需进行调整。
通过根据初始编码单元对应的量化参数确定当前参考量化参数,当前参考量化参数反映了对初始编码单元进行编码时采用的量化参数,而量化参数反应了图像的精细度。由于对初始压缩视频解码得到的不是原始视频,而是已压缩视频,如果已压缩视频质量不佳,即使转码时使用的量化参数再小也无法进一步提高视频质量,反而会浪费码率。所以若当前参考量化参数与待编码量化参数的差值大于预设阈值,说明待编码量化参数过小,此时不但无法进一步提高视频质量,而且会导致码率浪费,所以可以适当增大待编码量化参数,便于在保证主观质量的前提下,提高编码的压缩率,避免浪费码率,并且降低了相应的带宽成本。
在一个具体的实施例中,采用分段函数计算当前编码单元对应的目标编码量化参数。当计算得到的待编码量化参数大于当前参考量化参数减去预设阈值时,则无需调整待编码量化参数,即直接将计算得到的待编码量化作为目标编码量化参数。当计算得到的待编码量化参数小于或等于当前参考量化参数减去预设阈值时,则根据调整系数以及当前参考量化参数与待编码量化参数的差值计算得到相应的量化参数增量。那么目标编码量化参数就等于待编码量化参数和量化参数增量之和。具体的公式表示如下:
Figure PCTCN2018093318-appb-000001
其中,qp'代表目标编码量化参数,qp表示待编码量化参数,qp 0表示当前参 考量化参数,α表示调整系数,β表示预设阈值。
在一个实施例中,上述视频转码方法还包括:获取当前视频帧匹配的目标初始解码帧;根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数。
具体地,获取到与当前视频帧匹配的目标初始解码帧后,根据目标初始解码帧中初始编码单元对应的初始量化参数计算当前编码单元对应的平均参考量化参数。在一个实施例中,可以直接将各个初始编码单元对应的初始量化参数进行均值计算得到平均参考量化参数。在另一个实施例中,也可以将初始量化参数按照大小进行排序,然后将中间位置的初始量化参数对应的值作为平均参考量化参数。在一个实施例中,如果编码前后使用的视频编码标准不同,还需要将计算得到的平均参考量化参数进行映射计算得到最终的平均参考量化参数。
获取调整系数的步骤包括:计算平均参考量化参数和当前参考量化参数的目标差值;根据目标差值计算得到调整系数,调整系数与目标差值成反相关。
在一个实施例中,调整系数的确定可以根据平均参考量化参数与当前参考量化参数之间的差值来计算得到,将计算得到的平均参考量化参数与当前参考量化参数之间的差值称为“目标差值”。为了避免过度调整,设置调整系数与目标差值成反相关。即目标差值比较大时,计算得到的调整系数越小,当目标差值比较小时,计算得到的调整系数越大。在一个实施例中,可以采用以下公式计算得到,α=k/(qp ave-qp 0),其中,α表示调整系数,k表示常数,qp ave表示平均参考量化参数,qp 0表示当前参考量化参数。通过将调整系数和目标差值的乘积作为量化参数增量,可以避免过度调整,影响图像质量。
在一个实施例中,根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数的步骤包括:获取目标初始解码帧中各个初始编码单元对应的初始量化参数,根据各个初始编码单元对应的初始量化参数进行均值计算得到平均量化参数;将平均量化参数作为当前视频帧中当前编码单元对应的平均参考量化参数。
具体地,在获取到与当前视频帧匹配的目标初始解码帧后,获取目标初始解码帧中的各个目标初始编码单元对应的初始量化参数,然后对各个初始编码单元对应的初始量化参数进行求平均运算得到平均量化参数,直接将该平均量化参数作为当前视频帧中当前编码单元对应的平均参考量化参数。
如图6所示,在一个实施例中,上述视频转码方法还包括:根据当前视频帧对应的帧平均量化参数对当前视频帧进行分类的步骤,该步骤包括以下步骤:
步骤S212A,获取解码初始压缩视频得到的初始解码帧,计算各个初始解码帧对应的帧平均量化参数,根据帧平均量化参数计算得到与初始压缩视频对应的视频平均量化参数。
在一个实施例中,初始解码帧是解码初始压缩视频得到的视频帧。帧平均量化参数是指初始解码帧对应的平均量化参数,帧平均量化参数可以通过获取初始解码帧中各个初始编码单元对应的初始量化参数,然后根据各个初始编码单元对应的初始量化参数进行平均运算得到的平均值即可作为帧平均量化参数。同样地,在计算得到各个初始解码帧对应的帧平均量化参数后,可以根据初始压缩视频中各个初始解码帧对应的帧平均量化参数计算得到与初始压缩视频对应的视频平均量化参数。
步骤S212B,判断帧平均量化参数与视频平均量化参数的差值是否大于预设参数,若是,则进入步骤S212C,若否,则进入步骤S212D。
在一个实施例中,判断帧平均量化参数与视频平均量化参数的差值,如果大于预设参数(比如,5),那么将这类视频帧作为一类视频帧,否则,作为二类视频帧。
步骤S212C,将与初始解码帧匹配的当前视频帧作为一类视频帧。
步骤S212D,将与初始解码帧匹配的当前视频帧作为二类视频帧。
在一个实施例中,根据视频平均量化参数与帧平均量化参数的差值的大小将初始解码帧分为两类。由于是将解码得到的初始解码帧作为待编码的当前视频帧,所以初始解码帧与当前视频帧是一一对应的,当帧平均量化参数与视频平均量化参数的差值大于预设参数时,将与初始解码帧对应的当前视频帧作为 一类视频帧,否则,将与初始解码帧对应的当前视频帧作为二类视频帧。通过将待编码的视频帧分为两类,便于后续有针对性地对不同类视频帧对应的待编码量化参数进行调整。如果帧平均量化参数与视频平均量化参数的差值比较大,说明该视频帧初始编码单元对应的量化参数较大,相应的图像质量较差。反之,图像质量较好。通过根据帧平均量化参数将相应的待编码的视频帧分为两类,便于后续有针对性地对调整系数进行调整。
获取调整系数,根据调整系数和差距幅度计算得到量化参数增量的步骤S208B包括:当当前编码单元所在的当前视频帧为一类视频帧时,获取第一调整系数,根据第一调整系数和差距幅度计算得到量化参数增量;当当前编码单元所在的当前视频帧为二类视频帧时,获取第二调整系数,根据第二调整系数和差距幅度计算得到量化参数增量。
在一个实施例中为了在保证主观质量的前提下,进一步提高压缩效率,针对于不同类的视频帧设置不同的调整系数,对于那些帧平均量化参数比较大的视频帧,可以相应的将调整系数设置的大一点,因为初始解码帧对应的帧平均量化参数比较大,说明该帧的原本的图像质量已经很差了,所以现在即使采用较小的量化参数编码也无法改善质量了,而通过将调整系数调大,有利于进一步提高压缩效率。相反的,对于那些帧平均量化参数比较小的视频帧,可以相应地将调整系数设置的小一点。
为了更容易理解本方案的内容,在一个具体的应用场景中,对本方案进行描述。如图7所示,为一个实施例中视频转码的流程示意图。为了描述方便,将终端压缩前的视频称为“原始视频”、终端压缩后的码流称为“一次压缩码流”,也就是待转码码流,终端压缩过程称为“一次压缩”。终端将一次压缩码流上传到服务器,服务器转码过程分为“一次压缩码流的解码”和“二次压缩”,服务器转码后得到的码流称为“二次压缩码流”,服务器压缩称为“二次压缩”。在本实施例中,我们主要关注的是服务器转码的部分。具体地,服务器接收到一次压缩码流后,首先对一次压缩码流进行解码,获取一次压缩视频帧中每个编码单元的初始量化参数,根据初始量化参数计算每个编码单元对应的二次压缩量化参数的参考值,然后计算每个编码单元的二次压缩量化参数,根据二次压缩量化参数的参 考值对计算得到的二次压缩量化参数进行增大调整得到二次压缩目标量化参数,然后根据二次压缩目标量化参数对编码单元进行编码,得到二次压缩码流。
如图8所示,在一个实施例中,对每个编码单元计算得到量化参数,然后对编码单元进行编码的流程示意图。首先,进行预测,预测的目的是通过帧内预测和帧间预测降低视频图像的空间冗余和时间冗余。其次,进行变换,通过从时域到频域的变换,去除相邻数据之间的相关性,即去除空间冗余。之后,进行量化,不同于传统的直接采用计算得到的量化参数,通过对计算得到的量化参数进行调整,有利于提高压缩效率,避免码流浪费;最后,采用熵编码的方式对编码单元进行编码。
如图9所示,在一个实施例中,提出了一种视频转码方法,具体包括以下步骤:
步骤S901,获取编码初始压缩视频时初始编码单元对应的初始量化参数。
步骤S902,获取当前视频帧匹配的目标初始解码帧,获取目标初始解码帧中各个初始编码单元对应的初始量化参数;
步骤S903,对各个初始编码单元对应的初始量化参数根据大小进行排序得到排序结果,将排序结果中最小的初始量化参数作为当前编码单元对应的当前参考量化参数。
步骤S904,计算当前编码单元对应的待编码量化参数;
步骤S905,计算当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度;
步骤S906,判断差距幅度是否大于预设阈值,若是,则进入步骤S907,若否,则进入步骤S908。
步骤S907,获取调整系数,根据调整系数和差距幅度计算得到量化参数增量,根据量化参数增量和当前编码单元对应的待编码量化参数计算得到目标编码量化参数。
步骤S908,直接将待编码量化参数作为目标编码量化参数。
步骤S909,根据目标编码量化参数对当前编码单元进行编码。
应该理解的是,虽然上述流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
如图10所示,提出了一种视频转码装置,该装置包括:
初始量化参数获取模块1002,用于获取编码初始压缩视频时初始编码单元对应的初始量化参数;
确定模块1004,用于获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数;
待编码量化参数确定模块1006,用于确定所述当前编码单元对应的待编码量化参数;
目标编码量化参数确定模块1008,用于确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;
编码模块1010,用于根据所述目标编码量化参数对当前编码单元进行编码。
在一个实施例中,所述确定模块1004还用于获取当前视频帧匹配的目标初始解码帧,获取当前编码单元在所述目标初始解码帧中匹配的目标初始编码单元,根据所述目标初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数。
如图11所示,在一个实施例中,所述确定模块1004包括:
排序模块1004A,用于获取当前视频帧匹配的目标初始解码帧,获取所述目标初始解码帧中各个初始编码单元对应的初始量化参数,对所述各个初始编码单元对应的初始量化参数根据大小进行排序得到排序结果;
当前参考量化参数确定模块1004B,用于根据所述排序结果确定与所述当前 编码单元对应的当前参考量化参数。
在一个实施例中,所述当前参考量化参数确定模块还用于将所述排序结果中最小的初始量化参数作为所述当前编码单元对应的当前参考量化参数。
在一个实施例中,所述确定模块1004还用于获取所述初始压缩视频对应的初始视频编码标准,获取当前视频帧对应的当前视频编码标准,根据所述初始视频编码标准和所述当前视频编码标准确定量化参数的映射关系根据所述初始编码单元对应的初始量化参数和所述映射关系得到所述当前参考量化参数。
在一个实施例中,所述目标编码量化参数确定模块1008还用于当所述差距幅度大于预设阈值时,获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量;根据所述量化参数增量和当前编码单元对应的待编码量化参数计算得到目标编码量化参数。
如图12所示,在一个实施例中,上述视频转码装置还包括:
平均参考量化参数确定模块1012,还用于获取当前视频帧匹配的目标初始解码帧,根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数;
所述目标编码量化参数确定模块1008还用于计算所述平均参考量化参数和所述当前参考量化参数的目标差值,根据所述目标差值计算得到调整系数,所述调整系数与所述目标差值成正相关。
在一个实施例中,所述平均参考量化参数确定模块1012还用于获取目标初始解码帧中各个初始编码单元对应的初始量化参数,根据所述各个初始编码单元对应的初始量化参数进行均值计算得到平均量化参数;将所述平均量化参数作为所述当前视频帧中当前编码单元对应的平均参考量化参数。
如图13所示,在一个实施例中,上述视频转码装置包括:
视频平均量化参数计算模块1014,用于获取解码所述初始压缩视频得到的初始解码帧,计算各个初始解码帧对应的帧平均量化参数,根据所述帧平均量化参数计算得到与所述初始压缩视频对应的视频平均量化参数;
一类视频帧确定模块1016,用于当所述视频平均量化参数与所述帧平均量化参数的差值大于预设参数时,将与所述初始解码帧匹配的当前视频帧作为一 类视频帧;
二类视频帧确定模块1018,用于当所述视频平均量化参数与所述帧平均量化参数的差值小于或等于预设参数时,将与所述初始解码帧匹配的当前视频帧作为二类视频帧;
所述目标编码量化参数确定模块1008还用于当所述当前编码单元所在的当前视频帧为一类视频帧时,获取第一调整系数,根据所述第一调整系数和所述差距幅度计算得到量化参数增量;当所述当前编码单元所在的当前视频帧为二类视频帧时,获取第二调整系数,根据所述第二调整系数和所述差距幅度计算得到量化参数增量。
图14示出了一个实施例中计算机设备的内部结构图。该计算机设备具体可以是图1中的服务器120。如图14所示,该计算机设备包括该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,存储器包括非易失性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器实现视频转码方法。该内存储器中也可储存有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行视频转码方法。
本领域技术人员可以理解,图14中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,本申请提供的视频转码装置可以实现为一种计算机可读指令的形式,计算机可读指令可在如图14所示的计算机设备上运行。计算机设备的存储器中可存储组成该视频转码装置的各个程序模块,比如,图10所示的初始量化参数获取模块1002、确定模块1004、待编码量化参数计算模块1006、目标编码量化参数确定模块1008和编码模块1010。各个程序模块构成的计算机可读指令使得处理器执行本说明书中描述的本申请各个实施例的视频转码方法中的步骤。例如,图14所示的计算机设备可以通过如图10所示的视频转码装置中的初始量化参数获取模块1002执行获取编码初始压缩视频时初始编码单元 对应的初始量化参数;通过确定模块1004执行获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数;通过待编码量化参数计算模块1006执行计算所述当前编码单元对应的待编码量化参数;通过目标编码量化参数确定模块1008执行计算所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;通过编码模块1010执行根据所述目标编码量化参数对当前编码单元进行编码。
一种计算机设备,包括存储器和一个或多个处理器,所述存储器存储有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:获取编码初始压缩视频时初始编码单元对应的初始量化参数;根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;确定所述当前编码单元对应的待编码量化参数;确定当前编码单元对应的待编码量化参数与对应的当前参考量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;根据所述目标编码量化参数对当前编码单元进行编码。
在一个实施例中,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数的步骤包括:获取当前视频帧匹配的目标初始解码帧;获取当前编码单元在所述目标初始解码帧中匹配的目标初始编码单元;根据所述目标初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数。
在一个实施例中,所述获取当前视频帧中的当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数的步骤包括:获取当前视频帧匹配的目标初始解码帧;获取所述目标初始解码帧中各个初始编码单元对应的初始量化参数;对所述各个初始编码单元对应的初始量化参数根据大小进行排序得到排序结果,根据所述排序结果确定与所述 当前编码单元对应的当前参考量化参数。
在一个实施例中,所述根据所述排序结果确定与所述当前编码单元对应的当前参考量化参数的步骤包括:将所述排序结果中最小的初始量化参数作为所述当前编码单元对应的当前参考量化参数。
在一个实施例中,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数的步骤包括:获取所述初始压缩视频对应的初始视频编码标准,获取当前视频帧对应的当前视频编码标准;根据所述初始视频编码标准和所述当前视频编码标准确定量化参数的映射关系;根据所述初始编码单元对应的初始量化参数和所述映射关系得到所述当前参考量化参数。
在一个实施例中,所述确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数的步骤包括:当所述差距幅度大于预设阈值时,获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量;根据所述量化参数增量和当前编码单元对应的待编码量化参数计算得到目标编码量化参数。
在一个实施例中,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行以下步骤:获取当前视频帧匹配的目标初始解码帧;根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数;所述获取调整系数的步骤包括:计算所述平均参考量化参数和所述当前参考量化参数的目标差值;根据所述目标差值计算得到调整系数,所述调整系数与所述目标差值成正相关。
在一个实施例中,所述根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数的步骤包括:获取目标初始解码帧中各个初始编码单元对应的初始量化参数,根据所述各个初始编码单元对应的初始量化参数进行均值计算得到平均量化参数;将所述平均量化参数作为所述当前视频帧中当前编码单元对应的平均参考量化参数。
在一个实施例中,所述计算机可读指令被所述处理器执行时,还使得所述 处理器执行以下步骤:获取解码所述初始压缩视频得到的初始解码帧,计算各个初始解码帧对应的帧平均量化参数,根据所述帧平均量化参数计算得到与所述初始压缩视频对应的视频平均量化参数;当所述视频平均量化参数与所述帧平均量化参数的差值大于预设参数时,将与所述初始解码帧匹配的当前视频帧作为一类视频帧;当所述视频平均量化参数与所述帧平均量化参数的差值小于或等于预设参数时,将与所述初始解码帧匹配的当前视频帧作为二类视频帧;所述获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量的步骤包括:当所述当前编码单元所在的当前视频帧为一类视频帧时,获取第一调整系数,根据所述第一调整系数和所述差距幅度计算得到量化参数增量;当所述当前编码单元所在的当前视频帧为二类视频帧时,获取第二调整系数,根据所述第二调整系数和所述差距幅度计算得到量化参数增量。
在一个实施例中,提出了一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:获取编码初始压缩视频时初始编码单元对应的初始量化参数;根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;确定所述当前编码单元对应的待编码量化参数;确定当前编码单元对应的待编码量化参数与对应的当前参考量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;根据所述目标编码量化参数对当前编码单元进行编码。
在一个实施例中,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数的步骤包括:获取当前视频帧匹配的目标初始解码帧;获取当前编码单元在所述目标初始解码帧中匹配的目标初始编码单元;根据所述目标初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数。
在一个实施例中,所述获取当前视频帧中的当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数的步骤包括:获取当前视频帧匹配的目标初始解码帧;获取所述目标初始解码 帧中各个初始编码单元对应的初始量化参数;对所述各个初始编码单元对应的初始量化参数根据大小进行排序得到排序结果,根据所述排序结果确定与所述当前编码单元对应的当前参考量化参数。
在一个实施例中,所述根据所述排序结果确定与所述当前编码单元对应的当前参考量化参数的步骤包括:将所述排序结果中最小的初始量化参数作为所述当前编码单元对应的当前参考量化参数。
在一个实施例中,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数的步骤包括:获取所述初始压缩视频对应的初始视频编码标准,获取当前视频帧对应的当前视频编码标准;根据所述初始视频编码标准和所述当前视频编码标准确定量化参数的映射关系;根据所述初始编码单元对应的初始量化参数和所述映射关系得到所述当前参考量化参数。
在一个实施例中,所述确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数的步骤包括:当所述差距幅度大于预设阈值时,获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量;根据所述量化参数增量和当前编码单元对应的待编码量化参数计算得到目标编码量化参数。
在一个实施例中,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行以下步骤:获取当前视频帧匹配的目标初始解码帧;根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数;所述获取调整系数的步骤包括:计算所述平均参考量化参数和所述当前参考量化参数的目标差值;根据所述目标差值计算得到调整系数,所述调整系数与所述目标差值成正相关。
在一个实施例中,所述根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数的步骤包括:获取目标初始解码帧中各个初始编码单元对应的初始量化参数,根据所述各个初始编码单元对应的初始量化参数进行均值计算得到平均量化参数;将所述平均量化参数 作为所述当前视频帧中当前编码单元对应的平均参考量化参数。
在一个实施例中,所述计算机可读指令被所述处理器执行时,还使得所述处理器执行以下步骤:获取解码所述初始压缩视频得到的初始解码帧,计算各个初始解码帧对应的帧平均量化参数,根据所述帧平均量化参数计算得到与所述初始压缩视频对应的视频平均量化参数;当所述视频平均量化参数与所述帧平均量化参数的差值大于预设参数时,将与所述初始解码帧匹配的当前视频帧作为一类视频帧;当所述视频平均量化参数与所述帧平均量化参数的差值小于或等于预设参数时,将与所述初始解码帧匹配的当前视频帧作为二类视频帧;所述获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量的步骤包括:当所述当前编码单元所在的当前视频帧为一类视频帧时,获取第一调整系数,根据所述第一调整系数和所述差距幅度计算得到量化参数增量;当所述当前编码单元所在的当前视频帧为二类视频帧时,获取第二调整系数,根据所述第二调整系数和所述差距幅度计算得到量化参数增量。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(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 (27)

  1. 一种视频转码方法,包括:
    计算机设备获取编码初始压缩视频时初始编码单元对应的初始量化参数;
    所述计算机设备根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;
    所述计算机设备确定所述当前编码单元对应的待编码量化参数;
    所述计算机设备确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;及
    所述计算机设备根据所述目标编码量化参数对当前编码单元进行编码。
  2. 根据权利要求1所述的方法,其特征在于,所述计算机设备获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数包括:
    所述计算机设备获取当前视频帧匹配的目标初始解码帧;
    所述计算机设备获取当前编码单元在所述目标初始解码帧中匹配的目标初始编码单元;
    所述计算机设备根据所述目标初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数。
  3. 根据权利要求1所述的方法,其特征在于,所述计算机设备获取当前视频帧中的当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数包括:
    所述计算机设备获取当前视频帧匹配的目标初始解码帧;
    所述计算机设备获取所述目标初始解码帧中各个初始编码单元对应的初始量化参数;
    所述计算机设备对所述各个初始编码单元对应的初始量化参数根据大小进行排序得到排序结果,根据所述排序结果确定与所述当前编码单元对应的 当前参考量化参数。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述排序结果确定与所述当前编码单元对应的当前参考量化参数包括:
    所述计算机设备将所述排序结果中最小的初始量化参数作为所述当前编码单元对应的当前参考量化参数。
  5. 根据权利要求1所述的方法,其特征在于,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数包括:
    所述计算机设备获取所述初始压缩视频对应的初始视频编码标准,获取当前视频帧对应的当前视频编码标准;
    所述计算机设备根据所述初始视频编码标准和所述当前视频编码标准确定量化参数的映射关系;
    所述计算机设备根据所述初始编码单元对应的初始量化参数和所述映射关系得到所述当前参考量化参数。
  6. 根据权利要求1所述的方法,其特征在于,所述确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数包括:
    当所述差距幅度大于预设阈值时,所述计算机设备获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量;
    所述计算机设备根据所述量化参数增量和当前编码单元对应的待编码量化参数计算得到目标编码量化参数。
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:
    所述计算机设备获取当前视频帧匹配的目标初始解码帧;
    所述计算机设备根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数;
    所述获取调整系数,包括:
    所述计算机设备计算所述平均参考量化参数和所述当前参考量化参数的目标差值;
    所述计算机设备根据所述目标差值计算得到调整系数,所述调整系数与所述目标差值成正相关。
  8. 根据权利要求7所述的方法,其特征在于,所述计算机设备根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数,包括:
    所述计算机设备获取目标初始解码帧中各个初始编码单元对应的初始量化参数,根据所述各个初始编码单元对应的初始量化参数进行均值计算得到平均量化参数;
    所述计算机设备将所述平均量化参数作为所述当前视频帧中当前编码单元对应的平均参考量化参数。
  9. 根据权利要求6所述的方法,其特征在于,所述方法包括:
    所述计算机设备获取解码所述初始压缩视频得到的初始解码帧,计算各个初始解码帧对应的帧平均量化参数,根据所述帧平均量化参数计算得到与所述初始压缩视频对应的视频平均量化参数;
    当所述视频平均量化参数与所述帧平均量化参数的差值大于预设参数时,所述计算机设备将与所述初始解码帧匹配的当前视频帧作为一类视频帧;
    当所述视频平均量化参数与所述帧平均量化参数的差值小于或等于预设参数时,所述计算机设备将与所述初始解码帧匹配的当前视频帧作为二类视频帧;
    所述计算机设备获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量,包括:
    当所述当前编码单元所在的当前视频帧为一类视频帧时,所述计算机设备获取第一调整系数,根据所述第一调整系数和所述差距幅度计算得到量化参数增量;
    当所述当前编码单元所在的当前视频帧为二类视频帧时,所述计算机设 备获取第二调整系数,根据所述第二调整系数和所述差距幅度计算得到量化参数增量。
  10. 一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取编码初始压缩视频时初始编码单元对应的初始量化参数;
    根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;
    确定所述当前编码单元对应的待编码量化参数;
    确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;及
    根据所述目标编码量化参数对当前编码单元进行编码。
  11. 根据权利要求10所述的计算机设备,其特征在于,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数,包括:
    获取当前视频帧匹配的目标初始解码帧;
    获取当前编码单元在所述目标初始解码帧中匹配的目标初始编码单元;
    根据所述目标初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数。
  12. 根据权利要求10所述的计算机设备,其特征在于,所述获取当前视频帧中的当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数,包括:
    获取当前视频帧匹配的目标初始解码帧;
    获取所述目标初始解码帧中各个初始编码单元对应的初始量化参数;
    对所述各个初始编码单元对应的初始量化参数根据大小进行排序得到排 序结果,根据所述排序结果确定与所述当前编码单元对应的当前参考量化参数。
  13. 根据权利要求12所述的计算机设备,其特征在于,所述根据所述排序结果确定与所述当前编码单元对应的当前参考量化参数,包括:
    将所述排序结果中最小的初始量化参数作为所述当前编码单元对应的当前参考量化参数。
  14. 根据权利要求10所述的计算机设备,其特征在于,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数,包括:
    获取所述初始压缩视频对应的初始视频编码标准,获取当前视频帧对应的当前视频编码标准;
    根据所述初始视频编码标准和所述当前视频编码标准确定量化参数的映射关系;
    根据所述初始编码单元对应的初始量化参数和所述映射关系得到所述当前参考量化参数。
  15. 根据权利要求10所述的计算机设备,其特征在于,所述确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数,包括:
    当所述差距幅度大于预设阈值时,获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量;
    根据所述量化参数增量和当前编码单元对应的待编码量化参数计算得到目标编码量化参数。
  16. 根据权利要求15所述的计算机设备,其特征在于,所述计算机可读指令还使得所述处理器执行以下步骤:
    获取当前视频帧匹配的目标初始解码帧;
    根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编 码单元对应的平均参考量化参数;
    所述获取调整系数,包括:
    计算所述平均参考量化参数和所述当前参考量化参数的目标差值;
    根据所述目标差值计算得到调整系数,所述调整系数与所述目标差值成正相关。
  17. 根据权利要求16所述的计算机设备,其特征在于,所述根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数,包括:
    获取目标初始解码帧中各个初始编码单元对应的初始量化参数,根据所述各个初始编码单元对应的初始量化参数进行均值计算得到平均量化参数;
    将所述平均量化参数作为所述当前视频帧中当前编码单元对应的平均参考量化参数。
  18. 根据权利要求15所述的计算机设备,其特征在于,所述计算机可读指令还使得所述处理器执行以下步骤:
    获取解码所述初始压缩视频得到的初始解码帧,计算各个初始解码帧对应的帧平均量化参数,根据所述帧平均量化参数计算得到与所述初始压缩视频对应的视频平均量化参数;
    当所述视频平均量化参数与所述帧平均量化参数的差值大于预设参数时,将与所述初始解码帧匹配的当前视频帧作为一类视频帧;
    当所述视频平均量化参数与所述帧平均量化参数的差值小于或等于预设参数时,将与所述初始解码帧匹配的当前视频帧作为二类视频帧;
    所述获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量,包括:
    当所述当前编码单元所在的当前视频帧为一类视频帧时,获取第一调整系数,根据所述第一调整系数和所述差距幅度计算得到量化参数增量;
    当所述当前编码单元所在的当前视频帧为二类视频帧时,获取第二调整系数,根据所述第二调整系数和所述差距幅度计算得到量化参数增量。
  19. 一个或多个存储有计算机可读指令的计算机可读非易失性存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    获取编码初始压缩视频时初始编码单元对应的初始量化参数;
    根据所述初始编码单元对应的初始量化参数确定当前视频帧中当前编码单元对应的当前参考量化参数;
    确定所述当前编码单元对应的待编码量化参数;
    确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数;及
    根据所述目标编码量化参数对当前编码单元进行编码。
  20. 根据权利要求19所述的存储介质,其特征在于,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数,包括:
    获取当前视频帧匹配的目标初始解码帧;
    获取当前编码单元在所述目标初始解码帧中匹配的目标初始编码单元;
    根据所述目标初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数。
  21. 根据权利要求19所述的存储介质,其特征在于,所述获取当前视频帧中的当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数,包括:
    获取当前视频帧匹配的目标初始解码帧;
    获取所述目标初始解码帧中各个初始编码单元对应的初始量化参数;
    对所述各个初始编码单元对应的初始量化参数根据大小进行排序得到排序结果,根据所述排序结果确定与所述当前编码单元对应的当前参考量化参数。
  22. 根据权利要求21所述的存储介质,其特征在于,所述根据所述排序结果确定与所述当前编码单元对应的当前参考量化参数,包括:
    将所述排序结果中最小的初始量化参数作为所述当前编码单元对应的当前参考量化参数。
  23. 根据权利要求19所述的存储介质,其特征在于,所述获取当前视频帧中当前编码单元,根据所述初始编码单元对应的初始量化参数确定所述当前编码单元对应的当前参考量化参数,包括:
    获取所述初始压缩视频对应的初始视频编码标准,获取当前视频帧对应的当前视频编码标准;
    根据所述初始视频编码标准和所述当前视频编码标准确定量化参数的映射关系;
    根据所述初始编码单元对应的初始量化参数和所述映射关系得到所述当前参考量化参数。
  24. 根据权利要求19所述的存储介质,其特征在于,所述确定所述当前编码单元对应的当前参考量化参数与对应的待编码量化参数之间的差距幅度,根据所述差距幅度增大所述当前编码单元对应的待编码量化参数,得到目标编码量化参数,包括:
    当所述差距幅度大于预设阈值时,获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量;
    根据所述量化参数增量和当前编码单元对应的待编码量化参数计算得到目标编码量化参数。
  25. 根据权利要求24所述的存储介质,其特征在于,所述计算机可读指令还使得所述处理器执行以下步骤:
    获取当前视频帧匹配的目标初始解码帧;
    根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数;
    所述获取调整系数,包括:
    计算所述平均参考量化参数和所述当前参考量化参数的目标差值;
    根据所述目标差值计算得到调整系数,所述调整系数与所述目标差值成正相关。
  26. 根据权利要求25所述的存储介质,其特征在于,所述根据目标初始解码帧中初始编码单元对应的初始量化参数确定与当前编码单元对应的平均参考量化参数,包括:
    获取目标初始解码帧中各个初始编码单元对应的初始量化参数,根据所述各个初始编码单元对应的初始量化参数进行均值计算得到平均量化参数;
    将所述平均量化参数作为所述当前视频帧中当前编码单元对应的平均参考量化参数。
  27. 根据权利要求24所述的存储介质,其特征在于,所述计算机可读指令还使得所述处理器执行以下步骤:
    获取解码所述初始压缩视频得到的初始解码帧,计算各个初始解码帧对应的帧平均量化参数,根据所述帧平均量化参数计算得到与所述初始压缩视频对应的视频平均量化参数;
    当所述视频平均量化参数与所述帧平均量化参数的差值大于预设参数时,将与所述初始解码帧匹配的当前视频帧作为一类视频帧;
    当所述视频平均量化参数与所述帧平均量化参数的差值小于或等于预设参数时,将与所述初始解码帧匹配的当前视频帧作为二类视频帧;
    所述获取调整系数,根据所述调整系数和所述差距幅度计算得到量化参数增量,包括:
    当所述当前编码单元所在的当前视频帧为一类视频帧时,获取第一调整系数,根据所述第一调整系数和所述差距幅度计算得到量化参数增量;
    当所述当前编码单元所在的当前视频帧为二类视频帧时,获取第二调整系数,根据所述第二调整系数和所述差距幅度计算得到量化参数增量。
PCT/CN2018/093318 2017-10-10 2018-06-28 视频转码方法、计算机设备及存储介质 WO2019071984A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2019561246A JP6881819B2 (ja) 2017-10-10 2018-06-28 ビデオトランスコーディング方法、コンピューター機器、及び記憶媒体
KR1020197035404A KR102291570B1 (ko) 2017-10-10 2018-06-28 비디오 트랜스코딩 방법, 컴퓨터 디바이스 및 저장 매체
EP18866688.7A EP3697095A4 (en) 2017-10-10 2018-06-28 VIDEO TRANSCODING METHOD, COMPUTER DEVICE AND STORAGE MEDIUM
US16/436,570 US10951905B2 (en) 2017-10-10 2019-06-10 Video transcoding method, computer device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710937011.6 2017-10-10
CN201710937011.6A CN109660825B (zh) 2017-10-10 2017-10-10 视频转码方法、装置、计算机设备及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/436,570 Continuation US10951905B2 (en) 2017-10-10 2019-06-10 Video transcoding method, computer device, and storage medium

Publications (1)

Publication Number Publication Date
WO2019071984A1 true WO2019071984A1 (zh) 2019-04-18

Family

ID=66101287

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/093318 WO2019071984A1 (zh) 2017-10-10 2018-06-28 视频转码方法、计算机设备及存储介质

Country Status (7)

Country Link
US (1) US10951905B2 (zh)
EP (1) EP3697095A4 (zh)
JP (1) JP6881819B2 (zh)
KR (1) KR102291570B1 (zh)
CN (1) CN109660825B (zh)
MA (1) MA50765A (zh)
WO (1) WO2019071984A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11139827B2 (en) * 2019-03-15 2021-10-05 Samsung Electronics Co., Ltd. Conditional transcoding for encoded data
CN110944200B (zh) * 2019-12-10 2022-03-15 南京大学 一种评估沉浸式视频转码方案的方法
CN111193924B (zh) 2019-12-26 2022-01-25 腾讯科技(深圳)有限公司 视频码率的确定方法、装置、计算机设备及存储介质
CN111107395B (zh) * 2019-12-31 2021-08-03 广州市百果园网络科技有限公司 一种视频转码的方法、装置、服务器和存储介质
CN112203094B (zh) * 2020-11-16 2024-05-14 北京世纪好未来教育科技有限公司 编码方法、装置、电子设备及存储介质
CN114333862B (zh) * 2021-11-10 2024-05-03 腾讯科技(深圳)有限公司 音频编码方法、解码方法、装置、设备、存储介质及产品
CN116756589B (zh) * 2023-08-16 2023-11-17 北京壁仞科技开发有限公司 匹配算子的方法、计算设备和计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1653822A (zh) * 2002-05-17 2005-08-10 通用仪表公司 用于代码转换压缩视频比特流的方法和设备
US20080031337A1 (en) * 2006-08-04 2008-02-07 Megachips Corporation Transcoder and coded image conversion method
CN101594525A (zh) * 2008-05-31 2009-12-02 华为技术有限公司 量化参数的获取方法、装置及转码器
CN104202660A (zh) * 2014-09-15 2014-12-10 乐视网信息技术(北京)股份有限公司 分片转码方法及装置

Family Cites Families (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3244399B2 (ja) * 1994-03-25 2002-01-07 三洋電機株式会社 圧縮動画像符号信号の情報量変換回路、及び方法
US5677969A (en) * 1995-02-23 1997-10-14 Motorola, Inc. Method, rate controller, and system for preventing overflow and underflow of a decoder buffer in a video compression system
US6441754B1 (en) * 1999-08-17 2002-08-27 General Instrument Corporation Apparatus and methods for transcoder-based adaptive quantization
JP3561485B2 (ja) * 2000-08-18 2004-09-02 株式会社メディアグルー 符号化信号分離・合成装置、差分符号化信号生成装置、符号化信号分離・合成方法、差分符号化信号生成方法、符号化信号分離・合成プログラムを記録した媒体および差分符号化信号生成プログラムを記録した媒体
KR100540655B1 (ko) * 2003-01-23 2006-01-10 삼성전자주식회사 비디오 코딩시의 비트율 제어 방법 및 장치
JP4063204B2 (ja) * 2003-11-20 2008-03-19 セイコーエプソン株式会社 画像データ圧縮装置及びエンコーダ
JP4747494B2 (ja) * 2004-03-03 2011-08-17 ソニー株式会社 データ処理装置およびその方法と符号化装置
US8295343B2 (en) * 2005-11-18 2012-10-23 Apple Inc. Video bit rate control method
CN101009829A (zh) * 2006-01-25 2007-08-01 松下电器产业株式会社 可以及累积误差的比特元率转换编码方法,转换编码器,及集成电路
US8320450B2 (en) * 2006-03-29 2012-11-27 Vidyo, Inc. System and method for transcoding between scalable and non-scalable video codecs
US20070274396A1 (en) * 2006-05-26 2007-11-29 Ximin Zhang Complexity adaptive skip mode estimation for video encoding
US8982947B2 (en) * 2007-07-20 2015-03-17 The Hong Kong University Of Science And Technology Rate control and video denoising for noisy video data
EP2227020B1 (en) * 2007-09-28 2014-08-13 Dolby Laboratories Licensing Corporation Video compression and transmission techniques
BRPI0817655A2 (pt) * 2007-10-05 2015-03-31 Thomson Licensing Método e aparelho para precisão de controle de taxa em codificação e decodificação de vídeo
CN101779467B (zh) * 2008-06-27 2012-06-27 索尼公司 图像处理装置和图像处理方法
CN101888542B (zh) * 2010-06-11 2013-01-09 北京数码视讯科技股份有限公司 视频转码的帧级码率控制方法及转码器
CN101924943B (zh) * 2010-08-27 2011-11-16 郭敏 一种实时的基于h.264的低比特率视频转码方法
JP6056122B2 (ja) * 2011-01-24 2017-01-11 ソニー株式会社 画像符号化装置と画像復号装置およびその方法とプログラム
US9135724B2 (en) * 2011-03-11 2015-09-15 Sony Corporation Image processing apparatus and method
CN102685478B (zh) * 2011-03-11 2015-04-29 华为技术有限公司 编码方法以及装置、解码方法以及装置
CN102685485B (zh) * 2011-03-11 2014-11-05 华为技术有限公司 编码方法以及装置、解码方法以及装置
US8804820B2 (en) * 2011-04-21 2014-08-12 Dialogic Corporation Rate control with look-ahead for video transcoding
JP5900163B2 (ja) * 2012-05-30 2016-04-06 ソニー株式会社 画像処理装置、画像処理方法およびプログラム
CN103763559B (zh) * 2014-01-09 2017-12-29 能力天空科技(北京)有限公司 一种视频文件转码方法
JP2015186120A (ja) * 2014-03-25 2015-10-22 沖電気工業株式会社 符号化方式変換装置及びプログラム
US10097828B2 (en) * 2014-12-11 2018-10-09 Intel Corporation Rate control for parallel video encoding
CN105992004B (zh) * 2015-02-13 2019-03-22 北京博雅华录视听技术研究院有限公司 基于视频编码标准的图像编码码率控制方法
CN104717507A (zh) * 2015-03-31 2015-06-17 北京奇艺世纪科技有限公司 一种视频转码方法及装置
CN106488227B (zh) * 2016-10-12 2019-03-15 广东中星电子有限公司 一种视频参考帧管理方法和系统
US10506196B2 (en) * 2017-04-01 2019-12-10 Intel Corporation 360 neighbor-based quality selector, range adjuster, viewport manager, and motion estimator for graphics

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1653822A (zh) * 2002-05-17 2005-08-10 通用仪表公司 用于代码转换压缩视频比特流的方法和设备
US20080031337A1 (en) * 2006-08-04 2008-02-07 Megachips Corporation Transcoder and coded image conversion method
CN101594525A (zh) * 2008-05-31 2009-12-02 华为技术有限公司 量化参数的获取方法、装置及转码器
CN104202660A (zh) * 2014-09-15 2014-12-10 乐视网信息技术(北京)股份有限公司 分片转码方法及装置

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
CN109660825A (zh) 2019-04-19
EP3697095A1 (en) 2020-08-19
EP3697095A4 (en) 2021-07-07
JP2020519207A (ja) 2020-06-25
CN109660825B (zh) 2021-02-09
US10951905B2 (en) 2021-03-16
MA50765A (fr) 2020-08-19
KR102291570B1 (ko) 2021-08-19
US20190320193A1 (en) 2019-10-17
KR20200003115A (ko) 2020-01-08
JP6881819B2 (ja) 2021-06-02

Similar Documents

Publication Publication Date Title
WO2019071984A1 (zh) 视频转码方法、计算机设备及存储介质
US11159801B2 (en) Video characterization for smart encoding based on perceptual quality optimization
US11412229B2 (en) Method and apparatus for video encoding and decoding
US11563974B2 (en) Method and apparatus for video decoding
WO2018171447A1 (zh) 视频编码方法、视频解码方法、计算机设备和存储介质
WO2019242486A1 (zh) 视频编码方法、解码方法、装置、计算机设备及存储介质
KR20140042845A (ko) 지각적 비디오 코딩을 위한 구조적 유사성 기반의 레이트-왜곡 최적화 방법 및 시스템
CN108574841B (zh) 一种基于自适应量化参数的编码方法及装置
WO2018161845A1 (zh) 视频编码的码率分配、编码单元码率分配方法及计算机设备
US9872032B2 (en) Autogressive pixel prediction in the neighborhood of image borders
CN101523915B (zh) 使用min-max方法的用于视频编码的两遍速率控制技术
WO2018095890A1 (en) Methods and apparatuses for encoding and decoding video based on perceptual metric classification
CN114793282A (zh) 带有比特分配的基于神经网络的视频压缩
Lin et al. Multipass encoding for reducing pulsing artifacts in cloud based video transcoding
US20230388491A1 (en) Colour component prediction method, encoder, decoder and storage medium
He et al. Efficient Rate Control in Versatile Video Coding With Adaptive Spatial–Temporal Bit Allocation and Parameter Updating
EP3552395B1 (en) Motion compensation techniques for video
KR102506115B1 (ko) 타겟 태스크별 양자화 테이블 생성 방법
Jenab et al. Content-adaptive resolution control to improve video coding efficiency
CN112313950A (zh) 视频图像分量的预测方法、装置及计算机存储介质
US11736730B2 (en) Systems, methods, and apparatuses for video processing
US20220377369A1 (en) Video encoder and operating method of the video encoder
WO2023050072A1 (en) Methods and systems for video compression

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019561246

Country of ref document: JP

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 20197035404

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

Country of ref document: EP

Effective date: 20200511