WO2024007802A1 - 视频编码方法、装置、电子设备和存储介质 - Google Patents

视频编码方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2024007802A1
WO2024007802A1 PCT/CN2023/098575 CN2023098575W WO2024007802A1 WO 2024007802 A1 WO2024007802 A1 WO 2024007802A1 CN 2023098575 W CN2023098575 W CN 2023098575W WO 2024007802 A1 WO2024007802 A1 WO 2024007802A1
Authority
WO
WIPO (PCT)
Prior art keywords
encoded
image
encoding
slice
type
Prior art date
Application number
PCT/CN2023/098575
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 中兴通讯股份有限公司
Publication of WO2024007802A1 publication Critical patent/WO2024007802A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/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/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation

Definitions

  • the present disclosure relates to the field of data processing technology, and in particular, to a video encoding method, device, electronic equipment and storage medium.
  • IDR frame video random access point
  • macroblock is the smallest coding unit, followed by slice and then frame.
  • the coding type of each macroblock can be divided into interframe coding and intraframe coding.
  • Slices can be divided into: I_Slice and P_Slice according to the type of macroblocks they contain. Among them, I_Slice only contains intra-coded macroblocks, and P_Slice can contain both inter-coded and intra-coded macroblocks.
  • the amount of data encoded in each IDR frame is extremely large.
  • measures to reduce image quality are taken in the field of video conferencing, it will cause technical problems such as blurring/flashing of images on all terminals in the conference.
  • the amount of data in the IDR frame is too large. In the case of systems with limited bandwidth, it will cause technical problems such as lag and delay.
  • the present disclosure provides a video encoding method, device, electronic device and storage medium to solve the above technical problems.
  • an embodiment of the present disclosure provides a video encoding method, including: performing the following encoding steps: Step: Obtain the image to be encoded and the encoding instruction information of the image to be encoded; divide the image to be encoded into a first number of slices, where the first number is a positive integer greater than 2; when the encoding instruction information indicates that the image to be encoded requires a video access point
  • Step: Obtain the image to be encoded and the encoding instruction information of the image to be encoded; divide the image to be encoded into a first number of slices, where the first number is a positive integer greater than 2; when the encoding instruction information indicates that the image to be encoded requires a video access point
  • the type of the target slice in the image to be encoded is configured as I type, and the slices other than the target slice are configured as P type.
  • the target slice is any target number of slices in the image to be encoded, and the target number is less than the th A number of integers; determine the type of each slice in the image to be encoded and the position of each slice in the image to be encoded as the encoding information of the image to be encoded, and perform encoding based on the encoding information; repeat the encoding steps until the number of target slices reaches After the first number, it is determined that the video access point encoding is completed, wherein the positions of the target slices in the images to be encoded that have completed the video access point encoding are different.
  • a video encoding device including: an acquisition module, a fragmentation module, a configuration module, a first determination module, and a second determination module.
  • the acquisition module is configured to perform the following encoding steps: obtain the image to be encoded and the encoding instruction information of the image to be encoded; the slicing module is configured to divide the image to be encoded into a first number of slices, where the first number is a positive integer greater than 2;
  • a configuration module configured to configure the type of the target slice in the image to be encoded as the I type, and configure the slices other than the target slice as the P type when the encoding instruction information indicates that the image to be encoded needs to be encoded by the video access point,
  • the target slice is any target number of slices in the image to be encoded, and the target number is an integer less than the first number; the first determination module is configured to determine the type of each slice in the image to be encoded and the position of each slice in the image to be encoded.
  • the second determination module is configured to repeatedly perform the encoding step, and after the number of target slices reaches the first number, determine the video access point encoding, wherein the video encoding is completed The position of the target patch in each image to be encoded is different.
  • embodiments of the present disclosure provide an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus; the memory is used to The computer program is stored; the processor is used to execute the program stored in the memory to implement the video encoding method of the first aspect.
  • embodiments of the present disclosure provide a computer-readable storage medium storing a computer program.
  • the computer program is executed by a processor, the video encoding method of the first aspect is implemented.
  • Figure 1 is an application scenario diagram of a video encoding method provided by an embodiment of the present disclosure
  • Figure 2 is a flow chart of a video encoding method provided by an embodiment of the present disclosure
  • Figure 3 is a schematic diagram of the motion search range of the video encoding method provided by an embodiment of the present disclosure
  • Figure 4 is a structural diagram of a video encoding device provided by an embodiment of the present disclosure.
  • FIG. 5 is a structural diagram of an electronic device according to an embodiment of the present disclosure.
  • IDR frame video random access point
  • macroblock is the smallest coding unit, followed by slice and then frame.
  • the coding type of each macroblock can be divided into interframe coding and intraframe coding.
  • Slices can be divided into: I_Slice and P_Slice according to the type of macroblocks they contain. Among them, I_Slice only contains intra-coded macroblocks, and P_Slice can contain both inter-coded and intra-coded macroblocks.
  • the slices (Slices) contained in an IDR frame are all I_Slices. Since intra-frame coding of the same macroblock occupies a larger amount of data than inter-frame coding, the amount of data after encoding of each IDR frame is particularly large. big.
  • a video encoding method is provided according to an embodiment of the present disclosure.
  • the above video encoding method can be applied in a hardware environment composed of a terminal 101 and a server 102 as shown in FIG. 1 .
  • the server 102 is connected to the terminal 101 through the network and can be used to provide services (such as video services, application services, etc.) for the terminal or the client installed on the terminal.
  • the database can be set up on the server or independently from the server. Used to provide data storage services for the server 102.
  • the above-mentioned network includes but is not limited to: wide area network, metropolitan area network or local area network.
  • the terminal 101 is not limited to PC, mobile phone, tablet computer, etc.
  • the application environment of the video encoding method of the present disclosure can be, but is not limited to, all application scenarios involving video encoding, such as video conferencing, video live broadcast, video monitoring, and video transcoding.
  • the video encoding method in the embodiment of the present disclosure can be executed by the server 102, the terminal 101, or both the server 102 and the terminal 101.
  • the terminal 101 executes the video encoding method according to the embodiment of the present disclosure, or may be executed by a client installed on the terminal 101 .
  • Figure 2 is a schematic flowchart of an exemplary video encoding method according to the embodiment of the present disclosure. As shown in Figure 2, the flow of the method may include the following steps 201 Go to step 205.
  • Step 201 Obtain the image to be encoded and the encoding instruction information of the image to be encoded.
  • the encoding instruction information of the image to be encoded may include indicating whether the image to be encoded requires video access point encoding.
  • Step 202 Divide the image to be encoded into a first number of slices, where the first number is a positive integer greater than 2.
  • the first number may be preset when the encoding system is initialized.
  • the width and height pixels of each frame of image are set to width and height respectively.
  • Step 203 When the encoding instruction information indicates that the image to be encoded needs to be encoded by the video access point, the image to be encoded is The type of the target slice in the encoded image is configured as I type, and slices other than the target slice are configured as P type.
  • the target slice is any target number of slices in the image to be encoded, and the target number is an integer smaller than the first number.
  • the type of the target slice in the image to be encoded is configured as I type. , and configure slices other than the target slice as P type, thereby reducing the number of I-type slices in the image to be encoded when performing video access point encoding, so that the data of the image to be encoded The quantity will not be too large.
  • the number of target slices may be one or multiple. When there are multiple target slices, the positions of each target slice in the image to be encoded are different.
  • Step 204 Determine the type of each slice in the image to be encoded and the position of each slice in the image to be encoded as the encoding information of the image to be encoded, and perform encoding based on the encoding information.
  • the position of each slice in the image to be encoded and the type of the slice are determined as encoding information, and encoding is performed based on the encoding information.
  • any coding algorithm in related technologies can be used, such as predictive coding, transform coding, entropy coding, motion compensation, etc.
  • Step 205 After the number of target slices reaches the first number, it is determined that the video access point encoding is completed, wherein the positions of the target slices in the images to be encoded that have completed the video access point encoding are different.
  • the number of target slices reaches the first number, it means that video access point encoding is completed, that is, multiple I_Slices divided by video random access points are configured into multiple images to be encoded. Since the positions of the multiple I_Slices obtained by dividing the video random access points are different, the positions of the target slices configured in the image to be encoded are also different.
  • a video random access point is divided into multiple I_Slices, and the positions of different slices of the image to be encoded in several consecutive frames are allocated for encoding, so that the amount of data in each frame will not be too large, thereby achieving the code rate smoothing purpose.
  • each frame of image used for the video random access point can still contain P_Slice, so high image quality and compression rate can still be obtained.
  • Each frame of image used for the video random access point still complies with video encoding and decoding standards such as H.264, and is therefore standards-compliant.
  • the method before the encoding instruction information indicates that the image to be encoded needs to be encoded by video access point, the method further includes: determining whether the encoding instruction information indicates that the image to be encoded needs to be encoded by video access point; if so, Configure the second number of remaining I-type slices in the encoding instruction information, and the initial value of the second number is the first number; if not, determine whether the second number of remaining I-type slices in the encoding instruction information is zero, and if If the second number is zero, it means that the I-type slices have been configured. All slices in the image to be encoded are configured as P types.
  • the method further includes: updating the second number to the second number minus one to determine the number of unconfigured I-type slices.
  • the coding instruction information indicates that the image to be encoded requires video access point encoding, including: the second number in the encoding instruction information is not 0, and it is determined that the image to be encoded requires video access point encoding.
  • a second quantity is added to the encoding instruction information, and based on the second quantity, it is determined whether the acquired image to be encoded needs to be encoded by the video access point. When the second quantity is not 0, the image to be encoded is determined. Video access point encoding needs to be performed, and I-type slices are configured in the image to be encoded; when the second number is 0, it is determined that the video access point encoding has been completed, and all slices in the subsequent images to be encoded are configured as P type.
  • configuring the type of the target slice in the image to be encoded as type I includes: determining the slice at the position of the first number minus the second number in the image to be encoded as the target slice; changing the type of the target slice Configured as type I.
  • the first slice of the image to be encoded is set to the I type.
  • the method before encoding based on the encoding information, the method further includes: when the image to be encoded includes I-type slices, determining the motion vector range of the target P-type slice in the image to be encoded, wherein the running vector The range includes the location of the target P-type slice in the previous image to be encoded, and the previous For the I-type slice in the image to be encoded, the target P-type slice is the P-type slice above the I-type slice; the determined motion vector range of the slice is the encoding information.
  • the running vector range of the target P-type slices is set to avoid the situation where all slices in the previous image to be encoded are searched for the target P-type slices in the image to be encoded. Since the I-type slices in the image to be encoded do not need to refer to the previous frame image, and the P-type slices need to refer to the previous frame image, therefore, the part in the previous image to be encoded is searched, that is, the previous image to be encoded is searched. By performing motion search on the location of the target P-type slice and the I-type slice in the previous image to be encoded, the difference information with the current image to be encoded can be determined, thereby reducing the motion search range and reducing the calculation amount of the decoding process. .
  • the video encoding method of the present disclosure further includes: when the encoding instruction information indicates that the image to be encoded does not require video access point encoding, configuring the types of all slices in the image to be encoded to be P type. .
  • the types of all their slices are configured as P type, thus ensuring the image quality and compression rate of the subsequently encoded image to be identified.
  • the method further includes: counting a third number of configured images to be encoded; and when the third number reaches the preset number of encoded images. when, end encoding.
  • the number of images that need to be encoded is also configured. By counting the third number of configured images to be encoded, when the third number reaches the preset number After encoding the number of images, it means that all the video frames of this video encoding have been encoded, thus confirming that this video encoding is complete.
  • a video encoding method of the present disclosure further includes the following steps from the first to the eighth step.
  • Step one Initialize the encoding system. Set the width and height pixels of each frame image to width and height respectively. Set the number N of Slices that need to be divided into each frame of the image (the division method is equal ratio division), and N is a positive integer less than height/16. Set the index i used to indicate the encoded image, and set the initial value of i to 0. Set the variable configured number of slices of type I (RemainingIntraSliceNum), and set The initial value of RemainingIntraSliceNum is 0. Set the number of images to be encoded, which is the default number of encoded images (TotalFrameNum).
  • Step 2 Read the image Frame[i] to be encoded, and the Boolean input parameter IDR_Flag (ie, the above-mentioned encoding instruction information) indicating whether to encode this frame image (ie, Frame[i]) as a random access point.
  • IDR_Flag the above-mentioned encoding instruction information
  • Step 3 If IDR_Flag is False (indicating that there is no need to start encoding the random access point from the current frame), this situation indicates that there is no need to start a new random access point encoding, so jump to step five.
  • Step 5 Determine whether RemainingIntraSliceNum is 0. If RemainingIntraSliceNum is not 0 (to determine whether the random access point is currently being encoded), set the type of the N-RemainingIntraSliceNum Slice of the current image to I_Slice, and set the type of the remaining Slices to I_Slice. The type is set to P_Slice, and then RemainingIntraSliceNum is updated to RemainingIntraSliceNum-1; if RemainingIntraSliceNum is 0, the type of all Slices is set to P_Slice.
  • Step 6 If the I_Slice set in step 5 exists in the current image Frame[i] to be encoded (indicating that the random access point is currently being encoded), limit the motion vector search range of all P_Slices located above the I_Slice to only can be located above the corresponding position of the I_Slice in the reference image, and there is no restriction on the motion vector range of the other Slices (as shown in Figure 3, Figure 3 assumes that N set in the first step is equal to 4). If the I_Slice set in the fifth step does not exist in the current image Frame[i] to be encoded, the entire range of motion vectors of all Slices is not limited.
  • Step 7 Encode according to the encoding parameters set in the previous steps 1 to 6, and then output the compressed code stream after encoding the current image.
  • Step 8 Update i to i+1. If i is equal to TotalFrameNum (indicating that all frames of the video have been encoded), the encoding ends. If i is not equal to TotalFrameNum, go to step 2 and continue encoding the next frame of image.
  • a video random access point is divided into multiple I_Slices, which are allocated to different positions of several consecutive frames of images for encoding, so that the amount of data in each frame is not too large, thereby achieving the purpose of smoothing the code rate.
  • Each frame of image used for video random access point can still contain P_Slice so high image quality and compression rate can still be obtained.
  • Each frame of image used for video random access point still complies with H.264 and other visual standards frequency codec standard, so it is standards-compliant.
  • the new video random access point encoding algorithm does not introduce additional computational complexity.
  • the disclosed video encoding method can solve the problem of incompatible bit rate smoothness and image quality encountered in related technologies when encoding random access points. No additional performance overhead is introduced for video encoding when encoding random access points.
  • the encoded random access point is compatible with the standard protocol of video encoding, and the well-known H.264 open source software such as FFmpeg and JM can parse it.
  • the device mainly includes: obtaining Module 401, fragmentation module 402, configuration module 403, first determination module 404, and second determination module 405.
  • the acquisition module 401 is configured to perform the following encoding steps: obtain the image to be encoded and the encoding instruction information of the image to be encoded; the slice module 402 is configured to divide the image to be encoded into a first number of slices, and the first number is a positive number greater than 2.
  • the configuration module 403 is configured to configure the type of the target slice in the image to be encoded as I type when the encoding instruction information indicates that the image to be encoded needs to be encoded by the video access point, and configure the slices other than the target slice to be P type, the target slice is any target number of slices in the image to be encoded, and the target number is an integer less than the first number;
  • the first determination module 404 is configured to determine the type of each slice in the image to be encoded and the number of slices in the image to be encoded.
  • the position in the image is the encoding information of the image to be encoded, and encoding is performed based on the encoding information;
  • the second determination module 405 is configured to repeatedly perform the encoding step, and determine the video access point encoding after the number of target slices reaches the first number, Among them, the positions of the target slices in each image to be encoded after video encoding is completed are different.
  • the embodiment of the present disclosure also provides an electronic device.
  • the electronic device mainly includes: a processor 501, a memory 502 and a communication bus 503.
  • the processor 501 and the memory 502 communicate through Bus 503 completes mutual communication.
  • the memory 502 stores a program that can be executed by the processor 501.
  • the processor 501 executes the program stored in the memory 502 to implement the following steps: perform the following encoding steps: obtain the image to be encoded and the encoding instruction information of the image to be encoded;
  • the encoded image is divided into a first number of slices, and the first number is a positive integer greater than 2; when the encoding instruction information indicates that the image to be encoded requires video access point encoding, the type of the target slice in the image to be encoded is configured as I Type, configure the slices except the target slice as P type.
  • the target slice is any target number of slices in the image to be encoded, and the target number is an integer less than the first number; determine the type and each slice of each slice in the image to be encoded.
  • the position of the slice in the image to be encoded is the encoding information of the image to be encoded, and encoding is performed based on the encoding information; repeat The encoding step is repeated, and after the number of target slices reaches the first number, the video access point encoding is determined, wherein the positions of the target slices in the images to be encoded that have completed video encoding are different.
  • the communication bus 503 mentioned in the above electronic equipment may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus 503 can be divided into an address bus, a data bus, a control bus, etc. For ease of presentation, only one thick line is used in Figure 5, but it does not mean that there is only one bus or one type of bus.
  • the memory 502 may include random access memory (Random Access Memory, RAM for short) or non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM Random Access Memory
  • non-volatile memory non-volatile memory
  • the memory may also be at least one storage device located remotely from the aforementioned processor 501 .
  • the above-mentioned processor 501 can be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc., or it can also be a digital signal processor (Digital Signal Processing, referred to as DSP). ), Application Specific Integrated Circuit (ASIC for short), Field-Programmable Gate Array (FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • a computer-readable storage medium stores a computer program.
  • the computer program When the computer program is run on a computer, it causes the computer to execute the above embodiments.
  • the described video encoding method is also provided.
  • the present disclosure provides a video encoding method, device, electronic device and storage medium to solve the problem that in some situations, the IDR frame data volume is too large because all the Slices it contains are I_Slices. In systems with limited bandwidth, Can cause lags and delays.
  • the method provided by the embodiments of the present disclosure by obtaining the image to be encoded and the encoding instruction information of the image to be encoded; dividing the image to be encoded into a first number of slices, the first number is a positive integer greater than 2; when the encoding instruction information indicates that the image to be encoded needs to be encoded by the video access point, the type of the target slice in the image to be encoded is configured as I type, and the target slice is The slice configuration is P type, the target slice is any target number of slices in the image to be encoded, and the target number is an integer smaller than the first number; determine The type of each slice in the image to be encoded and the position of each slice in the image to be encoded are the encoding information of the image to be encoded, and encoding is performed based on the encoding information; the encoding step is repeated, and after the number of target slices reaches the first number, determine Video access point
  • the I-type slices in the IDR frame are encoded into at least two consecutive images to be encoded, so that the I-type slices in each to-be-encoded image are reduced, thereby reducing the number of frames in the same macroblock.
  • a video random access point is divided into multiple I_Slices, which are allocated to different positions of several consecutive frames of the image to be encoded for encoding, so that the amount of data in each frame will not be too large, thereby achieving code rate smoothness.
  • the purpose is to avoid system lags and delays.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, e.g., from a website, computer, server, or data center via a wireline (e.g., Coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) means to transmit to another website, computer, server or data center.
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center integrated with one or more available media.
  • the available media may be magnetic media (such as floppy disks, hard disks, magnetic tapes, etc.), optical media (such as DVDs), or semiconductor media (such as solid state drives).

Landscapes

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

Abstract

本公开涉及一种视频编码方法、装置、电子设备和存储介质,应用于数据处理技术领域,其中,方法包括:获取待编码图像和待编码图像编码指示信息;将待编码图像划分为第一数量的片,第一数量为大于2的正整数;在编码指示信息指示待编码图像需要进行视频接入点编码时,将待编码图像中的目标片的类型配置为I类型,将除目标片之外的片配置为P类型,目标片为待编码图像中的任意目标数量的片,目标数量为小于第一数量的整数;确定待编码图像中各片的类型和各片在待编码图像中的位置为待编码图像的编码信息,并基于编码信息进行编码;在目标片的数量达到第一数量后,确定视频接入点编码,其中,完成视频接入点编码的各待编码图像中目标片的位置不同。

Description

视频编码方法、装置、电子设备和存储介质
相关申请的交叉引用
本公开要求享有2022年07月08日提交的名称为“视频编码方法、装置、电子设备和存储介质”的中国专利申请CN202210805167.X的优先权,其全部内容通过引用并入本公开中。
技术领域
本公开涉及数据处理技术领域,尤其涉及一种视频编码方法、装置、电子设备和存储介质。
背景技术
码率平滑度和图像质量是IDR帧编码领域的两个重要指标。IDR帧(视频随机接入点)是视频编解码系统中的关键元素是编解码的起点和错误恢复点。IDR帧编码中宏块为最小的编码单元,其次是片(Slice),再是帧(Frame)。其中,每一个宏块的编码类型可以分为帧间编码和帧内编码,片(Slice)根据包含的宏块类型可以分为:I_Slice、P_Slice。其中,I_Slice只包含帧内编码的宏块,P_Slice可以包含同时帧间编码和帧内编码宏块。
相关技术中,每个IDR帧编码后的数据量特别大,在视频会议领域采取降低图像质量的措施时会造成所有在会终端图像发虚/闪一下的技术问题,并且,IDR帧数据量过大的情况下在带宽有限的系统中会造成卡顿和延迟的技术问题。
发明内容
本公开提供了一种视频编码方法、装置、电子设备和存储介质,用以解决上述技术问题。
第一方面,本公开实施例提供了一种视频编码方法,包括:执行以下编码步 骤:获取待编码图像和待编码图像编码指示信息;将待编码图像划分为第一数量的片,第一数量为大于2的正整数;在编码指示信息指示待编码图像需要进行视频接入点编码时,将待编码图像中的目标片的类型配置为I类型,将除目标片之外的片配置为P类型,目标片为待编码图像中的任意目标数量的片,目标数量为小于第一数量的整数;确定待编码图像中各片的类型和各片在待编码图像中的位置为待编码图像的编码信息,并基于编码信息进行编码;重复执行编码步骤,在目标片的数量达到第一数量后,确定视频接入点编码完成,其中,完成视频接入点编码的各待编码图像中目标片的位置不同。
第二方面,本公开实施例提供了一种视频编码装置,包括:获取模块、分片模块、配置模块、第一确定模块、第二确定模块。获取模块,配置为执行以下编码步骤:获取待编码图像和待编码图像编码指示信息;分片模块,配置为将待编码图像划分为第一数量的片,第一数量为大于2的正整数;配置模块,配置为在编码指示信息指示待编码图像需要进行视频接入点编码时,将待编码图像中的目标片的类型配置为I类型,将除目标片之外的片配置为P类型,目标片为待编码图像中的任意目标数量的片,目标数量为小于第一数量的整数;第一确定模块,配置为确定待编码图像中各片的类型和各片在待编码图像中的位置为待编码图像的编码信息,并基于编码信息进行编码;第二确定模块,配置为重复执行编码步骤,在目标片的数量达到第一数量后,确定视频接入点编码,其中,完成视频编码的各待编码图像中目标片的位置不同。
第三方面,本公开实施例提供了一种电子设备,包括:处理器、通信接口、存储器和通信总线,其中,处理器、通信接口和存储器通过通信总线完成相互间的通信;存储器,用于存储计算机程序;处理器,用于执行存储器中所存储的程序,实现第一方面的视频编码方法。
第四方面,本公开实施例提供了一种计算机可读存储介质,存储有计算机程序,计算机程序被处理器执行时实现第一方面的视频编码方法。
附图说明
此处的附图被并入说明书中并构成本公开的一部分,示出了符合本公开的实 施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开的一实施例提供的视频编码方法的应用场景图;
图2为本公开的一实施例提供的视频编码方法的流程图;
图3为本公开的一实施例提供的视频编码方法的运动搜索范围的示意图;
图4为本公开的一实施例提供的视频编码装置的结构图;以及
图5为本公开的一实施例提供的电子设备的结构图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开的一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
码率平滑度和图像质量是IDR帧编码领域的两个重要指标。IDR帧(视频随机接入点)是视频编解码系统中的关键元素是编解码的起点和错误恢复点。IDR帧编码中宏块为最小的编码单元,其次是片(Slice),再是帧(Frame)。其中,每一个宏块的编码类型可以分为帧间编码和帧内编码,片(Slice)根据包含的宏块类型可以分为:I_Slice、P_Slice。其中,I_Slice只包含帧内编码的宏块,P_Slice可以包含同时帧间编码和帧内编码宏块。
相关技术中,IDR帧由于其包含的片(Slice)全部为I_Slice,由于,同一宏块采用帧内编码比采用帧间编码占用的数据量要大,导致每个IDR帧编码后的数据量特别大。
从而,在视频会议领域为了实现码率控制防止瞬间超码率的现象,通常会采 取降低图像质量的措施来限制IDR帧压缩后的数据大小,造成所有在会终端图像发虚/闪一下,并且,IDR帧数据量过大的情况下在带宽有限的系统中会造成卡顿和延迟。
根据本公开的一实施例提供的一种视频编码方法。在本公开的一示例性的实施例中,上述视频编码方法可以应用于如图1所示的由终端101和服务器102所构成的硬件环境中。如图1所示,服务器102通过网络与终端101进行连接,可用于为终端或终端上安装的客户端提供服务(如视频服务、应用服务等),可在服务器上或独立于服务器设置数据库,用于为服务器102提供数据存储服务,上述网络包括但不限于:广域网、城域网或局域网,终端101并不限定于PC、手机、平板电脑等。
本公开的视频编码方法的应用环境可以但不限于所有包含视频编码的应用场景,例如,视频会议、视频直播、视频监控以及视频转码等。
本公开实施例的视频编码方法可以由服务器102来执行,也可以由终端101来执行,还可以是由服务器102和终端101共同执行。其中,终端101执行本公开实施例的视频编码方法,也可以是由安装在其上的客户端来执行。
以终端执行本公开实施例的视频编码方法为例,图2是根据本公开实施例的一种示例性的视频编码方法的流程示意图,如图2所示,该方法的流程可以包括以下步骤201至步骤205。
步骤201、获取待编码图像和待编码图像编码指示信息。
在一些实施例中,待编码图像的编码指示信息可以包括用于指示该待编码图像是否需要进行视频接入点编码。
步骤202、将待编码图像划分为第一数量的片,第一数量为大于2的正整数。
在一些实施例中,第一数量可以是在编码系统初始化时,预先设置的。在一示例性实施例中,在编码系统初始化时,设置每帧图像的宽高像素分别为width和height。设置每帧图像需要划分的片(Slice)个数N(划分方法为等比划分),其中,N可以但不限于为小于height/16的正整数。
步骤203、在编码指示信息指示待编码图像需要进行视频接入点编码时,将待 编码图像中的目标片的类型配置为I类型,将除目标片之外的片配置为P类型,目标片为待编码图像中的任意目标数量的片,目标数量为小于第一数量的整数。
在一些实施例中,在编码指示信息指示待编码图像需要进行视频接入点编码时,由于将待编码图像划分为了第一数量的片,将待编码图像中的目标片的类型配置为I类型,以及将除目标片之外的片配置为P类型,从而,使得待编码图像在进行视频接入点编码时,降低了待编码图像中的I类型的片的数量,使待编码图像的数据量不会过大。
其中,目标片的数量可以是一个,也可以是多个,在其为多个时,各目标片在待编码图像中的位置不同。
步骤204、确定待编码图像中各片的类型和各片在待编码图像中的位置为待编码图像的编码信息,并基于编码信息进行编码。
在一些实施例中,在对待编码图像中各片的类型配置完成后,确定每片在待编码图像中的位置以及片的类型为编码信息,并基于该编码信息进行编码。
其中,对编码信息进行编码的方式有多种,可以采用相关技术中的任一编码算法,例如,预测编码、变换编码、熵编码及运动补偿等。
重复执行编码步骤201至步骤204。
步骤205、在目标片的数量达到第一数量后,确定视频接入点编码完成,其中,完成视频接入点编码的各待编码图像中目标片的位置不同。
在一些实施例中,在目标片的数量达到第一数量后,表示完成了视频接入点编码,即将视频随机接入点划分的多个I_Slice配置到了多个待编码图像中。由于视频随机接入点划分得到的多个I_Slice的位置不同,因此,配置到待编码图像中目标片的位置也不相同。
本实施例中,通过将一个视频随机接入点分为多个I_Slice,分配在连续几帧待编码图像的不同片的位置来编码,使得每一帧的数据量不会过大,从而达到码率平滑的目的。并且,用于视频随机接入点的每一帧图像仍然可以包含P_Slice,因此仍然可以获得较高的图像质量和压缩率。用于视频随机接入点的每一帧图像依然符合H.264等视频编解码标准,因此是标准兼容的。
在一个示例性实施例中,在编码指示信息指示待编码图像需要进行视频接入点编码之前,还包括:判断编码指示信息是否指示需要从当前的待编码图像进行视频接入点编码;若是,在编码指示信息中配置剩余I类型的片的第二数量,第二数量的初始值为第一数量;若否,判断编码指示信息中剩余I类型的片的第二数量是否为零,若第二数量为零,则表示I类型的片已配置完成,将该待编码图像中的片全部配置为P类型,若第二数量不为零,则在该待编码图像中配置I类型的片;在每次得到待编码图像的编码信息之后,还包括:将第二数量更新为第二数量减一,以确定未配置的I类型的片的数量。
在一些实施例中,通过设置第二数量,基于该第二数量对I类型的片进行数量监控,并在每次将待编码图像配置I类型的片后,更新该第二数量,进而,能够监控到I类型的片配置是否完成,进而能够在第二数量为零后,确定视频接入点编码完成。
在一个示例性实施例中,编码指示信息指示待编码图像需要进行视频接入点编码,包括:编码指示信息中第二数量不为0,确定待编码图像需要进行视频接入点编码。
在一些实施例中,编码指示信息中通过加入第二数量,基于该第二数量判断获取的待编码图像是否需要进行视频接入点编码,在第二数量不为0时,确定该待编码图像需要进行视频接入点编码,在该待编码图像中配置I类型的片;在第二数量为0时,确定已经完成视频接入点编码,对后续的待编码图像中的片全部配置为P类型。
在一个示例性实施例中,将待编码图像中的目标片的类型配置为I类型,包括:确定待编码图像中第一数量减第二数量所在位置的片为目标片;将目标片的类型配置为I类型。
在一示例性实施例中,在待编码图像为第一张视频接入点图像时,将待编码图像的第一个片设置为I类型。
在一个示例性实施例中,基于编码信息进行编码之前,还包括:在待编码图像中包括I类型的片时,确定待编码图像的中目标P类型的片的运动矢量范围,其中,运行矢量范围包括前一张待编码图像中目标P类型的片所在位置,和前一张 待编码图像中的I类型的片,目标P类型的片为在I类型的片上方的P类型的片;确定片的运动矢量范围为编码信息。
在一些实施例中,通过设置目标P类型的片的运行矢量范围,从而避免待编码图像中目标P类型的片,对前一张待编码图像中的所有片均进行搜索的情况。由于待编码图像中I类型的片无需参考前一帧图像,P类型的片需要参考前一帧图像,因此,对前一张待编码图像中的部分进行搜索,即对前一张待编码图像中目标P类型的片所在位置以及前一张待编码图像中的I类型的片进行运动搜索,便能够确定与当前待编码图像的差异信息,从而可以降低运动搜索范围,降低解码过程的计算量。
在一个示例性实施例中,本公开的视频编码方法,还包括:在编码指示信息指示待编码图像不需要进行视频接入点编码时,将待编码图像中所有片的类型均配置为P类型。
在一些实施例中,在I类型的片全部配置到连续几帧待编码图像后,则可以确定后续获取的待编码图像不再需要进行视频接入点编码,将其所有片的类型均配置为P类型,从而能够保证后续编码的待识别图像的图像质量和压缩率。
在一个可选实施例中,将待编码图像中所有片的类型均配置为P类型之后,还包括:统计已配置的待编码图像的第三数量;在第三数量达到预设编码图像个数时,结束编码。
在一些实施例中,在编码系统初始化时,还会配置需要编码的图像个数即预设编码图像个数,通过统计已配置的待编码图像的第三数量,在该第三数量达到预设编码图像个数后,说明本次视频编码的所有视频帧均已编码完成,从而确定本次视频编码结束。
在一个示例性实施例中,本公开的一种视频编码方法,进一步包括以下第一步至第八步的步骤。
第一步:初始化编码系统。设置每帧图像的宽高像素分别为width和height。设置每帧图像需要划分的Slice个数N(划分方式为等比划分),N为小于height/16的正整数。设置用于指示编码图像的索引i,并设置i的初始值为0。设置变量已配置的片为I类型的个数(RemainingIntraSliceNum),并设置 RemainingIntraSliceNum的初始值为0。设置需要编码的图像个数即预设编码图像个数(TotalFrameNum)。
第二步:读取待编码图像Frame[i],以及指示是否将此帧图像(即Frame[i])编码为随机接入点的布尔型入参IDR_Flag(即上述的编码指示信息)。
第三步:如果IDR_Flag为False(表明不需要从当前帧开始编码随机接入点),这种情况说明不需要开始新的随机接入点编码,因此跳转至步骤五。
第四步:如果IDR_Flag为TURE(表明需要从当前帧开始编码随机接入点),设置RemainingIntraSliceNum=N,开始一个随机接入点的编码。
第五步:判断RemainingIntraSliceNum是否为0,如果RemainingIntraSliceNum不为0(判断当前是否正在编码随机接入点的过程中),则将当前图像的第N-RemainingIntraSliceNum个Slice的类型设置为I_Slice,其余Slice的类型设置为P_Slice,然后更新RemainingIntraSliceNum为RemainingIntraSliceNum-1;如果RemainingIntraSliceNum为0,则所有Slice的类型都设置为P_Slice。
第六步:如果当前待编码图像Frame[i]中存在第五步设置的I_Slice(说明当前正在编码随机接入点的过程中),则限制所有位于该I_Slice上面的P_Slice的运动矢量搜索范围只能位于该I_Slice在参考图像中的对应位置的上面,对其余Slice的运动矢量范围不做限制(如图3所示,图3假定了第一步设置的N等于4)。如果当前待编码图像Frame[i]中不存在第五步设置的I_Slice,则不限制所有Slice的运动矢量所有范围。
第七步:根据前面第一步到第六步设置的编码参数进行编码,然后输出当前图像编码后的压缩码流。
第八步:更新i为i+1,如果i等于TotalFrameNum(说明该视频的所有帧都已完成编码)则结束编码,如果i不等于TotalFrameNum则转第二步继续编码下一帧图像。
本实施例中,通过将一个视频随机接入点分为多个I_Slice,分配在连续几帧图像的不同位置来编码,使得每一帧的数据量不会过大,从而达到码率平滑的目的。用于视频随机接入点的每一帧图像仍然可以包含P_Slice因此仍然可以获得较高的图像质量和压缩率。用于视频随机接入点的每一帧图像依然符合H.264等视 频编解码标准,因此是标准兼容的。新的视频随机接入点编码算法不会引入额外的计算复杂度。
本公开的视频编码方法,能够解决相关技术编码随机接入点时碰到的码率平滑和图像质量不可兼得的问题。在编码随机接入点时不会为视频编码引入额外的性能开销。编码的随机接入点是和视频编码的标准协议兼容的,知名的FFmpeg和JM等H.264的开源软件都可以解析。
基于同一构思,本公开实施例中提供了一种视频编码装置,该装置的具体实施可参见方法实施例部分的描述,重复之处不再赘述,如图4所示,该装置主要包括:获取模块401、分片模块402、配置模块403、第一确定模块404、第二确定模块405。
获取模块401,配置为执行以下编码步骤:获取待编码图像和待编码图像编码指示信息;分片模块402,配置为将待编码图像划分为第一数量的片,第一数量为大于2的正整数;配置模块403,配置为在编码指示信息指示待编码图像需要进行视频接入点编码时,将待编码图像中的目标片的类型配置为I类型,将除目标片之外的片配置为P类型,目标片为待编码图像中的任意目标数量的片,目标数量为小于第一数量的整数;第一确定模块404,配置为确定待编码图像中各片的类型和各片在待编码图像中的位置为待编码图像的编码信息,并基于编码信息进行编码;第二确定模块405,配置为重复执行编码步骤,在目标片的数量达到第一数量后,确定视频接入点编码,其中,完成视频编码的各待编码图像中目标片的位置不同。
基于同一构思,本公开实施例中还提供了一种电子设备,如图5所示,该电子设备主要包括:处理器501、存储器502和通信总线503,其中,处理器501和存储器502通过通信总线503完成相互间的通信。其中,存储器502中存储有可被处理器501执行的程序,处理器501执行存储器502中存储的程序,实现如下步骤:执行以下编码步骤:获取待编码图像和待编码图像编码指示信息;将待编码图像划分为第一数量的片,第一数量为大于2的正整数;在编码指示信息指示待编码图像需要进行视频接入点编码时,将待编码图像中的目标片的类型配置为I类型,将除目标片之外的片配置为P类型,目标片为待编码图像中的任意目标数量的片,目标数量为小于第一数量的整数;确定待编码图像中各片的类型和各片在待编码图像中的位置为待编码图像的编码信息,并基于编码信息进行编码;重 复执行编码步骤,在目标片的数量达到第一数量后,确定视频接入点编码,其中,完成视频编码的各待编码图像中目标片的位置不同。
上述电子设备中提到的通信总线503可以是外设部件互连标准(Peripheral Component Interconnect,简称PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,简称EISA)总线等。该通信总线503可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器502可以包括随机存取存储器(Random Access Memory,简称RAM),也可以包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。在一示例性实施例中,存储器还可以是至少一个位于远离前述处理器501的存储装置。
上述的处理器501可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等,还可以是数字信号处理器(Digital Signal Processing,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。
在本公开的又一实施例中,还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当该计算机程序在计算机上运行时,使得计算机执行上述实施例中所描述的视频编码方法。
本公开提供了一种视频编码方法、装置、电子设备和存储介质,用以解决一些情形中,IDR帧由于其包含的Slice全部为I_Slice,导致IDR帧数据量过大,在带宽有限的系统中会造成卡顿和延迟。本公开实施例提供的上述技术方案与一些情形相比具有如下优点:本公开实施例提供的该方法,通过获取待编码图像和待编码图像编码指示信息;将待编码图像划分为第一数量的片,第一数量为大于2的正整数;在编码指示信息指示待编码图像需要进行视频接入点编码时,将待编码图像中的目标片的类型配置为I类型,将除目标片之外的片配置为P类型,目标片为待编码图像中的任意目标数量的片,目标数量为小于第一数量的整数;确定 待编码图像中各片的类型和各片在待编码图像中的位置为待编码图像的编码信息,并基于编码信息进行编码;重复执行编码步骤,在目标片的数量达到第一数量后,确定视频接入点编码,其中,完成视频编码的各待编码图像中目标片的位置不同。如此,通过上述编码方式,将IDR帧中的I类型的片,编码到连续至少两张待编码图像中,使得每张待编码图像中的I类型的片降低,进而降低了同一宏块中帧内编码的数据量,将一个视频随机接入点分为多个I_Slice,分配在连续几帧待编码图像的不同位置来编码,使得每一帧的数据量不会过大,从而达到码率平滑的目的,避免了系统的卡顿和延迟。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机指令时,全部或部分地产生按照本公开实施例所述的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、微波等)方式向另外一个网站站点、计算机、服务器或数据中心进行传输。该计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。该可用介质可以是磁性介质(例如软盘、硬盘、磁带等)、光介质(例如DVD)或者半导体介质(例如固态硬盘)等。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所示的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种视频编码方法,包括:
    执行以下编码步骤:获取待编码图像和所述待编码图像编码指示信息;
    将所述待编码图像划分为第一数量的片,所述第一数量为大于2的正整数;
    在所述编码指示信息指示所述待编码图像需要进行视频接入点编码时,将所述待编码图像中的目标片的类型配置为I类型,将除所述目标片之外的片配置为P类型,所述目标片为所述待编码图像中的任意目标数量的片,所述目标数量为小于所述第一数量的整数;
    确定所述待编码图像中各片的类型和各片在所述待编码图像中的位置为所述待编码图像的编码信息,并基于所述编码信息进行编码;
    重复执行所述编码步骤,在所述目标片的数量达到所述第一数量后,确定视频接入点编码完成,其中,完成视频接入点编码的各所述待编码图像中所述目标片的位置不同。
  2. 根据权利要求1所述的视频编码方法,其中,在所述编码指示信息指示所述待编码图像需要进行视频接入点编码之前,还包括:
    判断所述编码指示信息是否指示需要从当前的所述待编码图像进行视频接入点编码;
    若是,在所述编码指示信息中配置剩余I类型的片的第二数量,所述第二数量的初始值为所述第一数量;
    在每次得到所述待编码图像的编码信息之后,还包括:
    将所述第二数量更新为所述第二数量减一。
  3. 根据权利要求2所述的视频编码方法,其中,所述编码指示信息指示所述待编码图像需要进行视频接入点编码,包括:
    所述编码指示信息中所述第二数量不为0,确定所述待编码图像需要进行视频 接入点编码。
  4. 根据权利要求2所述的视频编码方法,其中,所述将所述待编码图像中的目标片的类型配置为I类型,包括:
    确定所述待编码图像中第一数量减第二数量所在位置的片为所述目标片;
    将所述目标片的类型配置为I类型。
  5. 根据权利要求4所述的视频编码方法,其中,所述基于所述编码信息进行编码之前,还包括:
    在所述待编码图像中包括所述I类型的片时,确定所述待编码图像的中目标P类型的片的运动矢量范围,其中,所述运行矢量范围包括前一张待编码图像中所述目标P类型的片所在位置,和所述前一张待编码图像中的I类型的片,所述目标P类型的片为在所述I类型的片上方的P类型的片;
    确定所述片的运动矢量范围为所述编码信息。
  6. 根据权利要求1所述的视频编码方法,其中,还包括:
    在所述编码指示信息指示所述待编码图像不需要进行视频接入点编码时,将所述待编码图像中所有片的类型均配置为P类型。
  7. 根据权利要求6所述的视频编码方法,其中,所述将所述待编码图像中所有片的类型均配置为P类型之后,还包括:
    统计已配置的所述待编码图像的第三数量;
    在所述第三数量达到预设编码图像个数时,结束编码。
  8. 一种视频编码装置,包括:
    获取模块,配置为执行以下编码步骤:获取待编码图像和所述待编码图像编码指示信息;
    分片模块,配置为将所述待编码图像划分为第一数量的片,所述第一数量为大于2的正整数;
    配置模块,配置为在所述编码指示信息指示所述待编码图像需要进行视频接入点编码时,将所述待编码图像中的目标片的类型配置为I类型,将除所述目标片之外的片配置为P类型,所述目标片为所述待编码图像中的任意目标数量的片,所述目标数量为小于所述第一数量的整数;
    第一确定模块,配置为确定所述待编码图像中各片的类型和各片在所述待编码图像中的位置为所述待编码图像的编码信息,并基于所述编码信息进行编码;
    第二确定模块,配置为重复执行所述编码步骤,在所述目标片的数量达到所述第一数量后,确定视频接入点编码,其中,完成视频编码的各所述待编码图像中所述目标片的位置不同。
  9. 一种电子设备,包括:处理器、通信接口、存储器和通信总线,其中,处理器、通信接口和存储器通过通信总线完成相互间的通信;
    所述存储器,用于存储计算机程序;
    所述处理器,用于执行所述存储器中所存储的程序,实现权利要求1-7任一项所述的视频编码方法。
  10. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-7任一项所述的视频编码方法。
PCT/CN2023/098575 2022-07-08 2023-06-06 视频编码方法、装置、电子设备和存储介质 WO2024007802A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210805167.X 2022-07-08
CN202210805167.XA CN117412053A (zh) 2022-07-08 2022-07-08 视频编码方法、装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2024007802A1 true WO2024007802A1 (zh) 2024-01-11

Family

ID=89454161

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/098575 WO2024007802A1 (zh) 2022-07-08 2023-06-06 视频编码方法、装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN117412053A (zh)
WO (1) WO2024007802A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105163117A (zh) * 2015-08-26 2015-12-16 华为技术有限公司 一种图像编码、处理方法及装置
US20190104321A1 (en) * 2017-09-29 2019-04-04 Ati Technologies Ulc Method and apparatus for encoding video using intra refresh video encoding
CN112929667A (zh) * 2021-03-26 2021-06-08 咪咕文化科技有限公司 一种编解码方法、装置、设备及可读存储介质
CN113709479A (zh) * 2021-03-19 2021-11-26 杭州海康威视数字技术股份有限公司 基于自适应帧内刷新机制的解码、编码方法及相关设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105163117A (zh) * 2015-08-26 2015-12-16 华为技术有限公司 一种图像编码、处理方法及装置
US20190104321A1 (en) * 2017-09-29 2019-04-04 Ati Technologies Ulc Method and apparatus for encoding video using intra refresh video encoding
CN113709479A (zh) * 2021-03-19 2021-11-26 杭州海康威视数字技术股份有限公司 基于自适应帧内刷新机制的解码、编码方法及相关设备
CN114630122A (zh) * 2021-03-19 2022-06-14 杭州海康威视数字技术股份有限公司 基于自适应帧内刷新机制的解码、编码方法及相关设备
CN112929667A (zh) * 2021-03-26 2021-06-08 咪咕文化科技有限公司 一种编解码方法、装置、设备及可读存储介质

Also Published As

Publication number Publication date
CN117412053A (zh) 2024-01-16

Similar Documents

Publication Publication Date Title
US11558639B2 (en) Selective resolution video encoding method, computer device, and readable storage medium
US10476928B2 (en) Network video playback method and apparatus
TW201904301A (zh) 影像編解碼方法、影片編解碼器及影片編解碼系統
WO2017198223A1 (zh) 视频质量评估的方法、装置和头端设备
CN113965751B (zh) 屏幕内容编码方法、装置、设备及存储介质
WO2023142716A1 (zh) 编码方法、实时通信方法、装置、设备及存储介质
CN111327921A (zh) 视频数据处理方法及设备
CN108206956B (zh) 一种视频解码错误的处理方法及装置
WO2022078090A1 (zh) 文件封装方法、文件传输方法、文件解码方法、电子设备及存储介质
WO2021057697A1 (zh) 视频编解码方法和装置、存储介质及电子装置
CN111294602A (zh) 一种帧内预测模式编解码方法和装置及设备
WO2021057705A1 (zh) 视频编解码方法和相关装置
WO2020042191A1 (zh) 编码方法、解码方法、编码设备和解码设备
JP2019537904A (ja) ビデオ符号化処理方法、装置、及び記憶媒体
JP2024514294A (ja) マルチメディアデータ処理方法、装置、機器、コンピュータ可読記憶媒体及びコンピュータプログラム
WO2024007802A1 (zh) 视频编码方法、装置、电子设备和存储介质
TW200835344A (en) Motion detection for video processing
US20200413103A1 (en) Context modeling method and apparatus of split flag
CN113573003A (zh) 一种基于弱网的音视频实时通信方法、装置以及设备
CN110572672B (zh) 视频编解码方法和装置、存储介质及电子装置
US9812095B2 (en) Video processing method including managing a reference picture list and video system therefore
CN110662071A (zh) 视频解码方法和装置、存储介质及电子装置
WO2021057478A1 (zh) 视频编解码方法和相关装置
CN111510703B (zh) 一种视频播放方法、装置及系统
WO2023130893A1 (zh) 流媒体传输方法、装置、电子设备及计算机可读存储介质

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

Country of ref document: EP

Kind code of ref document: A1