Method, device and electronic device for determining reference state of long-term reference frame
By obtaining the reference information of the image frame to determine the reference state of the long-term reference frame, and only making reference in the valid state, the problem of reduced coding performance caused by long-term reference frame search in the existing technology is solved, and the coding efficiency is improved.
Patent Information
- Application Number
- CN202310560952.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-05-17
AI Technical Summary
In existing image coding technology, the long-term reference frame searches for coding blocks similar to it in each image frame, resulting in increased coding time and reduced coding performance.
By obtaining the reference information of the reference image frame and the long-term reference frame of the current image frame, the reference state of the current image frame to the long-term reference frame is determined, and the long-term reference frame is referenced only in the reference valid state, reducing unnecessary search processes.
It improves the performance of image coding, reduces the loss of coding time, and ensures that coding efficiency is not affected.
Smart Images

Figure CN116684610B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, specifically to the field of image coding technology, and in particular to a method, device, electronic device and storage medium for determining a reference state of a long-term reference frame. Background Art
[0002] Although related image coding technologies all use multi-frame reference technology, the reference method is relatively simple, which is to add the long-term reference frame to the reference frame list of each image frame. That is, each image frame needs to refer to the long-term reference frame. The encoder needs to search for coding blocks similar to the long-term reference frame in each frame, which increases the encoding time and reduces the encoding performance. Summary of the invention
[0003] The present disclosure provides a method, an apparatus, an electronic device, and a storage medium for determining a reference state of a long-term reference frame.
[0004] According to a first aspect of the present disclosure, a method for determining a reference state of a long-term reference frame is provided, comprising: obtaining at least one reference image frame of a current image frame; obtaining reference information of each of the reference image frames to the long-term reference frame; and determining, based on the reference information, the reference state of the current image frame to the long-term reference frame.
[0005] According to a second aspect of the present disclosure, a device for determining a reference state of a long-term reference frame is provided, comprising: a first acquisition module for acquiring at least one reference image frame of a current image frame; a second acquisition module for acquiring reference information of each of the reference image frames to the long-term reference frame; and a determination module for determining the reference state of the current image frame to the long-term reference frame based on the reference information.
[0006] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for determining the reference state of a long-term reference frame described in the above-mentioned first aspect embodiment.
[0007] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, on which a computer program / instructions are stored, and the computer instructions are used to enable the computer to execute the method for determining the reference state of a long-term reference frame described in the above-mentioned embodiment.
[0008] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements the method for determining a reference state of a long-term reference frame as described in the above-mentioned first aspect embodiment.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1 A flowchart of a method for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0012] Figure 2 A flowchart of another method for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0013] Figure 3 A flowchart of another method for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0014] Figure 4 A schematic diagram of a flow chart of determining whether a current image frame satisfies a pull-back condition for pulling back a long-term reference frame in a method for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0015] Figure 5 A schematic diagram of a flow chart of determining whether a current image frame satisfies a pull-back condition according to a frame number interval distance in a method for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0016] Figure 6 A schematic diagram of a flow chart of determining whether a current image frame satisfies a pull-back condition according to a frame number interval distance in another method for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0017] Figure 7 A schematic diagram of a flow chart of identifying whether a long-term reference frame needs to be updated in a method for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0018] Figure 8 A flowchart of another method for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0019] Fig. 9 A schematic diagram of the structure of a device for determining a reference state of a long-term reference frame provided by an embodiment of the present disclosure;
[0020] Fig.10 The present invention is a block diagram of an electronic device for determining a reference state of a long-term reference frame according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0022] The following describes a method, an apparatus, and an electronic device for determining a reference state of a long-term reference frame according to an embodiment of the present disclosure with reference to the accompanying drawings.
[0023] Artificial Intelligence (AI) is a discipline that studies how computers can simulate certain thought processes and intelligent behaviors of human beings (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level technologies and software-level technologies. AI hardware technologies generally include computer vision technology, speech recognition technology, natural language processing technology, as well as learning / deep learning, big data processing technology, knowledge graph technology, and other aspects.
[0024] Natural Language Processing (NLP) is an important field in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between humans and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Natural language processing is mainly used in machine translation, public opinion monitoring, automatic summarization, opinion extraction, text classification, question answering, text semantic comparison, speech recognition, etc.
[0025] Deep Learning (DL) is a new research direction in the field of Machine Learning (ML). It is introduced into machine learning to make it closer to its original goal - artificial intelligence. Deep learning is the internal laws and representation levels of learning sample data. The information obtained in the learning process is of great help in the interpretation of data such as text, images and sounds. Its ultimate goal is to enable machines to have analytical learning capabilities like humans and to recognize data such as text, images and sounds. Deep learning is a complex machine learning algorithm that has achieved results in speech and image recognition that far exceed previous related technologies.
[0026] Smart search is a new generation of search engine that combines artificial intelligence technology. In addition to providing traditional fast retrieval and relevance sorting functions, it can also provide user role registration, automatic identification of user interests, semantic understanding of content, intelligent information filtering and push, etc.
[0027] Computer vision is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision that uses cameras and computers to replace human eyes to identify, track and measure targets, and further performs graphic processing so that the computer processes the images into images that are more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain "information" from images or multidimensional data, which can be used to help make a "decision". Because perception can be seen as extracting information from sensory signals, computer vision can also be seen as a science that studies how to make artificial systems "perceive" from images or multidimensional data.
[0028] Image processing technology is a technology that uses computers to analyze images to achieve the desired results. It is also called image processing. Image processing generally refers to digital image processing. A digital image refers to a large two-dimensional array obtained by shooting with industrial cameras, video cameras, scanners and other equipment. The elements of the array are called pixels, and their values are called grayscale values. Image processing technology generally includes three parts: image compression, enhancement and restoration, matching, description and recognition.
[0029] Figure 1 A flowchart of a method for determining a reference state of a long-term reference frame provided in an embodiment of the present disclosure.
[0030] like Figure 1 As shown, the method for determining the reference state of the long-term reference frame may include:
[0031] S101, obtaining at least one reference image frame of a current image frame.
[0032] The execution subject of the method for determining the reference state of the long-term reference frame in the embodiment of the present disclosure is an electronic device and a server with an image coding function. Optionally, the electronic device can be a mobile electronic device or a non-mobile electronic device. Optionally, the server can be a network server or an application server.
[0033] Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiments of the present disclosure.
[0034] In some implementations, the previous frame of the current image frame can be retained and used as a reference image frame. The previous frames of the current image frame can also be used as reference image frames, and optionally, the first three frames or the first five frames can be selected as reference image frames for the current image frame. For example, if the current image frame is P8, the reference image frame of P8 can be P7, or P7, P6 and P5.
[0035] S102, obtaining reference information of each reference image frame to a long-term reference frame.
[0036] It should be noted that the long-term reference frame is a special frame type in the video coding standard. The use of long-term reference frames can reduce the amount of video data transmission and improve video quality. In some implementations, intra picture frames (I frames) or instantaneous decoding refresh (IDR) frames can be selected as long-term reference frames and added to the reference frame list. I frames represent key frames of intra-frame coding frames, and IDR frames represent the first image frame of a video sequence.
[0037] In some implementations, the long-term reference frame mark bit of the reference image frame may be determined, and the reference information of the reference image frame to the long-term reference frame may be obtained according to the long-term reference frame mark bit of the reference image frame. For example, if the long-term reference frame mark bit of the reference image frame is 0, it means that the reference image frame does not refer to the long-term reference frame; if the long-term reference frame mark bit of the reference image frame is 1, it means that the reference image frame refers to the long-term reference frame.
[0038] S103: Determine the reference state of the current image frame to the long-term reference frame according to the reference information.
[0039] It can be understood that the reference status of the long-term reference frame can be divided into a reference invalid state and a reference valid state, wherein the reference valid state indicates that the current image frame needs to refer to the long-term reference frame; and the reference invalid state indicates that the current image frame does not need to refer to the long-term reference frame.
[0040] In some implementations, it can be determined from the reference information whether each reference image frame refers to a long-term reference frame, and based on the reference of each reference image frame to the long-term reference frame, it is determined whether the current image frame refers to the long-term reference frame. If the reference state of the reference image frame with respect to the long-term reference frame is a reference invalid state, then the reference state of the current image frame with respect to the long-term reference frame is a reference invalid state; if the reference state of the reference image frame with respect to the long-term reference frame is a reference valid state, then the reference state of the current image frame with respect to the long-term reference frame is a reference valid state.
[0041] In some implementations, if all reference image frames of the current image frame do not refer to the long-term reference frame, it is determined that the current image frame does not refer to the long-term reference frame, and the reference state of the current image frame to the long-term reference frame is a reference invalid state. If one or more reference image frames among all reference image frames of the current image frame refer to the long-term reference frame, it is determined that the current image frame needs to refer to the long-term reference frame, and the reference state of the current image frame to the long-term reference frame is determined to be a reference valid state.
[0042] The method for determining the reference state of a long-term reference frame in an embodiment of the present disclosure obtains a reference image frame of the current image frame, and determines whether the current image frame refers to the long-term reference frame based on the reference information of the reference image frame to the long-term reference frame, thereby adjusting the reference state of the current image frame to the long-term reference frame. Therefore, the encoder only needs to refer to the long-term reference frame for the image frame in the reference valid state, which reduces the loss in encoding time, improves encoding performance, and ensures that the encoding efficiency is not affected.
[0043] Figure 2 A flowchart of a method for determining a reference state of a long-term reference frame provided in an embodiment of the present disclosure.
[0044] like Figure 2 As shown, the method for determining the reference state of the long-term reference frame may include:
[0045] S201, obtaining at least one reference image frame of a current image frame.
[0046] The relevant contents of step S201 can be found in the above embodiment and will not be described again here.
[0047] S202, obtaining the number of reference coding blocks that refer to the long-term reference frame in each reference image frame.
[0048] In some implementations, each reference image frame is divided into a certain number of coding blocks, and the coding blocks of the reference image frame include reference coding blocks that reference the long-term reference frame and reference coding blocks that do not reference the long-term reference frame. The electronic device can obtain the number of reference coding blocks that reference the long-term reference frame in the reference image frame by reading the coding blocks of the reference image frame.
[0049] S203, obtaining the total number of coding blocks of the image frame.
[0050] It is understood that the number of coding blocks of an image frame depends on the size of the image and the size of the coding block. The size of the coding block is usually fixed and determined according to the compression algorithm. For example, an image frame can be divided into 64 horizontal coding blocks and 64 vertical coding blocks, and the total number of coding blocks of the image frame is 64*64.
[0051] S204: Determine reference information of the reference image frame according to the number of reference coding blocks and the total number of coding blocks.
[0052] Optionally, the reference information of the reference image frame to the long-term reference frame may be determined by the ratio of the number of reference coding blocks to the total number of coding blocks, such as whether the reference image frame refers to the long-term reference frame or does not refer to the long-term reference frame.
[0053] For example, suppose the current image frame is P5, its reference image frames are P4, P3, P2, and the long-term reference frame is P0. The ratio of the number of coding blocks of P2 referring to P0 to the total number of coding blocks is determined as the reference ratio of P2 referring to P0, which can be recorded as ref 20 , the ratio of the number of coded blocks of P3 reference P0 to the total number of coded blocks is determined as the reference ratio of P3 reference P0, which can be recorded as ref 30 , the ratio of the number of coded blocks of P4 referenced to P0 to the total number of coded blocks is determined as the reference ratio of P4 referenced to P0, which can be recorded as ref 40 If ref 20 , ref 30 , ref 40 If all are smaller than the threshold, it means that the reference image frames P4, P3, and P2 do not refer to the long-term reference frame P0.
[0054] S205: Determine a reference state of the current image frame to the long-term reference frame according to the reference information.
[0055] In some implementations, it can be determined whether the reference information of each reference image frame meets the set identification condition of not referencing the long-term reference frame. The set identification condition is that the ratio of the number of reference coding blocks to the total number of coding blocks is less than a set threshold. If the reference information of all reference image frames meets the set identification condition, it is determined that the reference state of the current image frame to the long-term reference frame is a reference failure state.
[0056] For example, the current image frame is P5, its reference image frames are P4, P3, P2, and the long-term reference frame is P0. 40 , ref 30 , ref 20 At least one of them is greater than the set threshold, indicating that at least one of the reference image frames P4, P3, and P2 refers to the long-term reference frame P0, and P5 also refers to the long-term reference frame P0, so the reference state of the current image frame P5 to the long-term reference frame P0 is a reference valid state. 40 , ref 30 , ref 20 All are less than the set threshold, indicating that the reference image frames P4, P3, and P2 do not refer to the long-term reference frame P0, and P5 does not refer to the long-term reference frame P0 either. Therefore, the reference state of the current image frame P5 to the long-term reference frame P0 is a reference failure state.
[0057] The method for determining the reference state of a long-term reference frame in an embodiment of the present disclosure obtains a reference image frame of the current image frame, and according to the number of reference coding blocks in the reference image frame that refer to the long-term reference frame, and the total number of coding blocks of the reference image frame, can determine the reference information of the reference image frame to the long-term reference frame, and further determine whether the current image frame refers to the long-term reference frame, so that the reference state of the current image frame to the long-term reference frame can be adjusted. Therefore, the encoder only needs to refer to the long-term reference frame for the image frame in the reference valid state, which reduces the loss in encoding time, improves the encoding performance, and ensures that the encoding efficiency is not affected.
[0058] Figure 3 A flowchart of a method for determining a reference state of a long-term reference frame provided in an embodiment of the present disclosure.
[0059] like Figure 3 As shown, the method for determining the reference state of the long-term reference frame may include:
[0060] S301, obtaining at least one reference image frame of a current image frame.
[0061] S302: Obtain reference information of each reference image frame to a long-term reference frame.
[0062] The relevant contents of steps S301 - S302 can be found in the above embodiment and will not be described again here.
[0063] S303: Determine a reference state of the current image frame to the long-term reference frame according to the reference information.
[0064] It can be understood that the reference state of the current image frame to the long-term reference frame can be divided into a reference invalid state and a reference valid state.
[0065] Optionally, if the reference state of the current image frame to the long-term reference frame is a reference failure state, the long-term reference frame flag of the current image frame is determined to be a first value. For example, the first value is recorded as 0.
[0066] Optionally, if the reference state of the current image frame to the long-term reference frame is a reference valid state, the long-term reference frame flag of the current image frame is determined to be a second value. For example, the second value is 1.
[0067] S304: If it is determined that the reference state of the current image frame to the long-term reference frame is a reference failure state, determine whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame.
[0068] In some implementations, the reference state of the current image frame to the long-term reference frame can be determined through the reference information of each reference image frame to the long-term reference frame. Since the reference information of the reference image frame indicates that the long-term reference frame is not referenced, the reference state of the current image frame is a reference failure state. Long-term reference frames can reduce errors generated during image encoding and improve encoding performance. In order to avoid encoding errors caused by long-term non-reference of images in the video, it is possible to determine whether the pull-back condition for pulling back the long-term reference frame is met for the current image frame that has been determined to be in a reference failure state. Pulling back the long-term reference frame when the pull-back condition is met can enhance the error resistance of the encoding and increase the encoding accuracy of subsequent images.
[0069] Optionally, whether the current image frame meets the pull-back condition for pulling back to the long-term reference frame can be determined by the frame number interval between the first frame number that does not refer to the long-term reference frame and the frame number of the current image frame. Optionally, whether the current image frame meets the pull-back condition for pulling back to the long-term reference frame can be determined by the Peak Signal to Noise Ratio (PSNR) between the current image frame and the long-term reference frame. Optionally, whether the current image frame meets the pull-back condition for pulling back to the long-term reference frame can be determined by the number of times that the long-term reference frame is not referred to.
[0070] S305: If the current image frame meets the pull-back condition, the reference state of the long-term reference frame is updated to a reference valid state.
[0071] In some implementations, if the current image frame meets the pull-back conditions for the long-term reference frame, the long-term reference frame is pulled back, and the current image frame needs to refer to the long-term reference frame. Furthermore, the reference state of the current image frame to the long-term reference frame can be updated to a reference valid state, and the long-term reference frame mark bit of the current image frame is recorded as the second value 1.
[0072] S306: If the current image frame does not meet the pull-back condition, the reference state of the long-term reference frame is maintained as a reference invalid state.
[0073] In some implementations, if the current image frame does not meet the pull-back conditions for the long-term reference frame, it means that the current image frame does not need to refer to the long-term reference frame, then the reference status of the current image frame to the long-term reference frame is still a reference invalid state, and the long-term reference frame mark bit of the current image frame is set to the first value 0.
[0074] The method for determining the reference state of a long-term reference frame of the disclosed embodiment obtains a reference image frame of the current image frame, and determines whether the current image frame is in a reference state to the long-term reference frame based on the reference information of the reference image frame to the long-term reference frame. Further, based on the reference state of the current image frame to the long-term reference frame, it is determined whether the long-term reference frame needs to be pulled back. By pulling back the long-term reference frame, the problem of reduced coding accuracy caused by the image continuously not referring to the long-term reference frame during the coding process can be avoided, the loss in coding time can be reduced, and the error resistance of the coding can be enhanced. Moreover, the encoder only needs to refer to the long-term reference frame for the image frame in the reference valid state, which reduces the loss in coding time, improves the coding performance, and ensures that the coding efficiency is not affected.
[0075] Figure 4 A flowchart of a process for determining whether a current image frame satisfies a pull-back condition for pulling back a long-term reference frame is provided in an embodiment of the present disclosure.
[0076] like Figure 4 As shown, the process of determining whether the current image frame satisfies the pull-back condition for pulling back the long-term reference frame may include:
[0077] S401, obtaining the first frame number of the first image frame in this round that does not need to refer to the long-term reference frame, and the second frame number of the current image frame.
[0078] In some implementations, any image frame can determine whether to refer to a long-term reference frame based on its reference image frame, thereby obtaining the first image frame that does not need to refer to a long-term reference frame, and recording the frame number of the image frame as the first frame number. Further, the frame number of the current image frame is recorded as the second frame number.
[0079] S402, obtaining a frame number interval distance between a first frame number and a second frame number.
[0080] S403, judging whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame according to the frame number interval distance.
[0081] In some implementations, the frame number interval distance can be obtained according to the difference between the second frame number and the first frame number, and the frame number interval distance can be used to determine whether the current image frame meets the pull-back condition, and then determine whether the current image frame needs to be pulled back to the long-term reference frame. The pull-back condition can be that the PSNR is greater than the signal-to-noise ratio threshold and the frame number interval is greater than the set threshold.
[0082] The method for determining the reference state of a long-term reference frame of the disclosed embodiment obtains a reference image frame of the current image frame, and determines whether the current image frame is in a reference state to the long-term reference frame based on the reference information of the reference image frame to the long-term reference frame. Furthermore, based on the reference state of the current image frame to the long-term reference frame, it is determined whether the long-term reference frame needs to be pulled back. By pulling back the long-term reference frame, the problem of reduced coding accuracy caused by the image continuously not referring to the long-term reference frame during the coding process can be avoided, the loss in coding time can be reduced, and the error resistance of the coding can be enhanced. Moreover, the encoder only needs to refer to the long-term reference frame for the image frame in the reference valid state, which reduces the loss in coding time, improves the coding performance, and ensures that the coding efficiency is not affected.
[0083] Figure 5 A flowchart of a process for determining whether a current image frame satisfies a pull-back condition for pulling back a long-term reference frame according to a frame number interval distance provided in an embodiment of the present disclosure.
[0084] like Figure 5 As shown, the process of judging whether the current image frame satisfies the pull-back condition for pulling back the long-term reference frame according to the frame number interval distance may include:
[0085] S501, obtaining the first frame number of the first image frame in this round that does not need to refer to the long-term reference frame, and the second frame number of the current image frame.
[0086] S502: Obtain a frame number interval distance between a first frame number and a second frame number.
[0087] The relevant contents of steps S501 - S502 can be found in the above embodiment and will not be described again here.
[0088] S503: If the frame number interval is between the first set threshold and the second set threshold, obtain a peak signal-to-noise ratio between the current image frame and the long-term reference frame.
[0089] In some implementations, a first set threshold and a second set threshold of the frame number interval distance may be preset, and the first set threshold and the second set threshold may determine whether the current image frame meets the pull-back condition, wherein the second set threshold is greater than the first set threshold.
[0090] Optionally, if the frame number interval distance is between a first set threshold and a second set threshold, the PSNR between the current image frame and the long-term reference frame is calculated. Based on the size of the PSNR, the similarity between the current image frame and the long-term reference frame can be determined, and then it is determined whether the current image frame meets the pull-back conditions for pulling back the long-term reference frame.
[0091] S504: If the peak signal-to-noise ratio is greater than the signal-to-noise ratio threshold, it is determined that the current image frame meets the pull-back condition.
[0092] In some implementations, the pull-back condition satisfied by the current image frame is that the PSNR is greater than the signal-to-noise ratio threshold. It can be understood that the PSNR between the current image frame and the long-term reference frame reflects the similarity between the two frames. When the PSNR is greater than the signal-to-noise ratio threshold, it indicates a high similarity between the current image frame and the long-term reference frame, meaning that the current image frame needs to refer to the long-term reference frame, and the long-term reference frame flag bit of the current image frame is set to 1. At this time, the current image frame satisfies the pull-back condition, and the long-term reference frame is pulled back.
[0093] Exemplarily, let the long-term reference frame be P0, the first frame number be P n , the second frame number be P m , the first set threshold be g1, and the second set threshold be g2. When P m - P n > g1 and P m - P n < g2, then calculate the PSNR between P m and P0. If the PSNR is greater than the signal-to-noise ratio threshold, it indicates a higher similarity between the current image frame and the long-term reference frame. Therefore, the long-term reference frame is pulled back at this time.
[0094] S505, if the peak signal-to-noise ratio is less than or equal to the signal-to-noise ratio threshold, it is determined that the current image frame does not satisfy the pull-back condition.
[0095] It can be understood that when the PSNR is less than or equal to the signal-to-noise ratio threshold, it indicates a low similarity between the current image frame and the long-term reference frame. The current image frame does not need to refer to the long-term reference frame. At this time, the current image frame does not satisfy the pull-back condition, and the long-term reference frame flag bit of the current image frame is set to 0, and the long-term reference frame is not pulled back.
[0096] S506, if the frame number interval distance is greater than the second set threshold, it is determined that the current image frame satisfies the pull-back condition.
[0097] In some other implementations, the pull-back condition satisfied by the current image frame is that the frame number interval distance is greater than the second set threshold. It can be understood that when the frame number interval distance is greater than the second set threshold, it indicates that there are too many image frames that do not refer to the long-term reference frame in this round of image frames, which is not conducive to improving the video coding performance and is prone to coding errors. At this time, the long-term reference frame needs to be forcibly pulled back, and the long-term reference frame flag bit of the current image frame is set to 1, so that the current image frame refers to the long-term reference frame to improve the coding performance. For example, the second set threshold is 10. When the frame number interval distance is greater than 10, the long-term reference frame is directly pulled back.
[0098] Furthermore, when the frame number interval distance is greater than the second set threshold, the next image frame that does not need to refer to the long-term reference frame is obtained as the first image frame in the next round that does not need to refer to the long-term reference frame, and then it can be determined whether the current image frame in the next round meets the pull-back conditions for pulling back the long-term reference frame.
[0099] S507: If the frame number interval is less than the first set threshold, it is determined that the current image frame does not meet the pull-back condition.
[0100] In some implementations, when the frame number interval is less than a first set threshold, the long-term reference frame mark bit of the current image frame is still 0, indicating that the current reference frame does not need to refer to the long-term reference frame, so the current image frame does not meet the pull-back condition and there is no need to pull back the long-term reference frame.
[0101] The method for determining the reference state of a long-term reference frame of the disclosed embodiment obtains a reference image frame of the current image frame, and determines whether the current image frame is in a reference state to the long-term reference frame according to the reference information of the reference image frame to the long-term reference frame. Furthermore, when the reference state of the current image frame to the long-term reference frame is a reference failure state, it is necessary to determine whether to pull back the long-term reference frame. By pulling back the long-term reference frame, the problem of reduced encoding accuracy caused by the image continuously not referring to the long-term reference frame during the encoding process can be avoided, the loss in encoding time can be reduced, and the error resistance of the encoding can be enhanced. Moreover, the encoder only needs to refer to the long-term reference frame for the image frame in the reference valid state, which reduces the loss in encoding time, improves the encoding performance, and ensures that the encoding efficiency is not affected.
[0102] Figure 6 A flowchart of a process for determining whether a current image frame satisfies a pull-back condition for pulling back a long-term reference frame according to a frame number interval distance provided in an embodiment of the present disclosure.
[0103] like Figure 6 As shown, the process of determining whether the current image frame satisfies the pull-back condition for pulling back the long-term reference frame may include:
[0104] S601, starting from the current round of counting by the counter, obtain the number of times that the mid- to long-term reference frame in the current round is determined to be in a reference failure state.
[0105] In some implementations, in the current round of image frames, when it is determined that the image frame is in a reference failure state with respect to the long-term reference frame, a counter is used to count the image frames. Counting starts from the first image frame that does not need to refer to the long-term reference frame until the counted number of times satisfies the pull-back condition for the current image frame to pull back to the long-term reference frame. It should be noted that counting a counter from 0 to a set value can be counted as one round.
[0106] S602: judging whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame according to the counted times.
[0107] It can be understood that the counted number reflects the number of image frames in the current round of image frames that do not refer to the long-term reference frame.
[0108] In some implementations, a first set threshold and a second set threshold corresponding to the counter setting may be preset. If the count number is between the first set threshold and the second set threshold, the PSNR between the current image frame and the long-term reference frame is obtained, and if the PSNR is greater than the signal-to-noise ratio threshold, it is determined that the current image frame meets the pull-back condition. If the PSNR is less than or equal to the signal-to-noise ratio threshold, it is determined that the current image frame does not meet the pull-back condition. Optionally, if the count number is greater than the second set threshold, it is determined that the current image frame meets the pull-back condition; if the count number is less than the first set threshold, it is determined that the current image frame does not meet the pull-back condition.
[0109] In some implementations, a threshold value of the frame number interval distance may be used for counting the number of times.
[0110] S603: If the counted times reaches a third set threshold, it is determined that the current image frame meets the pull-back condition, and the counter is cleared and counted again.
[0111] In some implementations, when the number of counts is equal to a third set threshold, the counter is cleared and counted again, and the next image frame that does not need to refer to the long-term reference frame is obtained as the first image frame in the next round of counting that does not need to refer to the long-term reference frame. It can then be determined whether the current image frame in the next round meets the pull-back conditions for pulling back the long-term reference frame.
[0112] It should be noted that the third set threshold value and the second set threshold value may be the same or different.
[0113] The method for determining the reference state of a long-term reference frame in the disclosed embodiment obtains a reference image frame of the current image frame, and determines whether the current image frame is in a reference state to the long-term reference frame based on the reference information of the reference image frame to the long-term reference frame. Furthermore, when the reference of the current image frame to the long-term reference frame is invalid, it is further determined whether it is necessary to pull back the long-term reference frame. By pulling back the long-term reference frame, the problem of reduced coding accuracy caused by the image continuously not referring to the long-term reference frame during the coding process is avoided, the loss in coding time is reduced, and the error resistance of the coding can be enhanced. Moreover, the encoder only needs to refer to the long-term reference frame for the image frame in the reference valid state, which reduces the loss in coding time and improves the coding performance. It is ensured that the coding efficiency is not affected.
[0114] On the basis of the above embodiment, whether the long-term reference frame needs to be updated can be identified based on the scene information of the current image frame and its adjacent historical image frames. Figure 7 A flowchart of a process for identifying whether a long-term reference frame needs to be updated is provided in an embodiment of the present disclosure.
[0115] like Figure 7 As shown, the method for determining the reference state of the long-term reference frame may include:
[0116] S701, obtaining first scene information of the current image frame.
[0117] S702: Acquire second scene information of a historical image frame adjacent to the current image frame.
[0118] In some implementations, computer vision-related tools can be used to perform image analysis and feature extraction on the current image frame and the historical image frames adjacent to the current image frame, thereby obtaining scene information of the image frame. The scene information of the current image frame is recorded as the first scene information, and the scene information of the historical image frame is recorded as the second scene information.
[0119] S703: Determine the scene similarity between the first scene information and the second scene information.
[0120] Optionally, a structural similarity index may be used to determine the scene similarity between the first scene information and the second scene information. The scene similarity in the scene information may be determined by comparing pixel values in the scene information, as well as structural factors such as brightness and contrast.
[0121] S704: If the scene similarity is less than or equal to the set similarity threshold, the long-term reference frame is updated, and the updated long-term reference frame is used as a coding reference for subsequent image frames.
[0122] In some implementations, a similarity threshold can be set to determine whether the long-term reference frame needs to be updated. If the scene similarity is greater than the set similarity threshold, it means that the scene has not switched and there is no need to update the long-term reference frame; if the scene similarity is less than or equal to the set similarity threshold, it means that the scene has switched and the long-term reference frame needs to be updated.
[0123] It can be understood that, due to the scene switching, the current image frame is the first frame after the scene switching, and thus the current image frame is determined to be an updated long-term reference frame so as to be used as a coding reference for subsequent image frames.
[0124] The method for determining the reference state of a long-term reference frame in the disclosed embodiment can determine different long-term reference frames according to scene switching, thereby realizing dynamic updating of the long-term reference frames, and using the updated long-term reference frames as encoding references for subsequent image frames, thereby achieving the purpose of periodically adjusting the long-term reference frames, avoiding always using the same frame as the long-term reference frame, reducing the impact of scene switching on the encoding effect, and improving the encoding performance.
[0125] Figure 8 A flowchart of a method for determining a reference state of a long-term reference frame provided in an embodiment of the present disclosure.
[0126] like Figure 8 As shown, the method for determining the reference state of the long-term reference frame may include:
[0127] S801, obtaining first scene information of the current image frame.
[0128] S802: Acquire second scene information of a historical image frame adjacent to the current image frame.
[0129] S803: Determine the scene similarity between the first scene information and the second scene information.
[0130] S804: If the scene similarity is less than or equal to the set similarity threshold, the long-term reference frame is updated, and the updated long-term reference frame is used as a coding reference for subsequent image frames.
[0131] S805: Acquire at least one reference image frame of the current image frame.
[0132] S806, obtaining the number of reference coding blocks that refer to the long-term reference frame in each reference image frame.
[0133] S807, obtaining the total number of coding blocks of the image frame.
[0134] S808: Determine reference information of the reference image frame according to the number of reference coding blocks and the total number of coding blocks.
[0135] S809: Determine the reference state of the current image frame to the long-term reference frame according to the reference information.
[0136] S810: If it is determined that the reference state of the current image frame to the long-term reference frame is a reference failure state, determine whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame.
[0137] S811: If the current image frame meets the pull-back condition, the reference state of the long-term reference frame is updated to a reference valid state.
[0138] S812: If the current image frame does not meet the pull-back condition, the reference state of the long-term reference frame is maintained as a reference invalid state.
[0139] The method for determining the reference state of a long-term reference frame of the disclosed embodiment can determine different long-term reference frames according to scene switching, realizes dynamic selection of long-term reference frames, achieves the purpose of periodically adjusting long-term reference frames, avoids always using the same frame as a long-term reference frame, and improves encoding performance. By obtaining the reference image frame of the current image frame, the reference state of the current image frame to the long-term reference frame is determined according to the reference information of the reference image frame to the long-term reference frame. Further, when the reference state of the current image frame to the long-term reference frame is a reference failure state, it is necessary to determine whether to pull back the long-term reference frame. By pulling back the long-term reference frame, the problem of reduced encoding accuracy caused by the image continuously not referring to the long-term reference frame during the encoding process can be avoided, the loss in encoding time can be reduced, and the error resistance of the encoding can be enhanced. Moreover, the encoder only needs to refer to the long-term reference frame for the image frame in the reference valid state, which reduces the loss in encoding time, improves the encoding performance, and ensures that the encoding efficiency is not affected.
[0140] Corresponding to the methods for determining the reference state of a long-term reference frame provided in the above-mentioned embodiments, an embodiment of the present disclosure further provides a device for determining the reference state of a long-term reference frame. Since the device for determining the reference state of a long-term reference frame provided in the embodiment of the present disclosure corresponds to the methods for determining the reference state of a long-term reference frame provided in the above-mentioned embodiments, the implementation methods of the above-mentioned methods for determining the reference state of a long-term reference frame are also applicable to the device for determining the reference state of a long-term reference frame provided in the embodiment of the present disclosure, and will not be described in detail in the following embodiments.
[0141] Fig. 9 A schematic diagram of the structure of a device for determining a reference state of a long-term reference frame provided in an embodiment of the present disclosure.
[0142] like Fig. 9 As shown, the device 900 for determining the reference state of a long-term reference frame according to an embodiment of the present disclosure includes: a first acquisition module 901 , a second acquisition module 902 and a determination module 903 .
[0143] The first acquisition module 901 is used to acquire at least one reference image frame of the current image frame.
[0144] The second acquisition module 902 is used to acquire reference information of each reference image frame to the long-term reference frame.
[0145] The determination module 903 is used to determine the reference state of the current image frame to the long-term reference frame according to the reference information.
[0146] In one embodiment of the present disclosure, the determination module 903 is also used to: if it is determined that the reference state of the current image frame to the long-term reference frame is a reference invalid state, determine whether the current image frame satisfies the pull-back condition for pulling back the long-term reference frame; if the current image frame satisfies the pull-back condition, update the reference state of the long-term reference frame to a reference valid state; if the current image frame does not satisfy the pull-back condition, maintain the reference state of the long-term reference frame as a reference invalid state.
[0147] In one embodiment of the present disclosure, the second acquisition module 902 is also used to: obtain the number of reference coding blocks that refer to the long-term reference frame in each reference image frame; obtain the total number of coding blocks of the image frame; and determine the reference information of the reference image frame based on the number of reference coding blocks and the total number of coding blocks.
[0148] In one embodiment of the present disclosure, the second acquisition module 902 is further used to: determine whether the reference information of each reference image frame meets the set recognition conditions for not referencing the long-term reference frame; if the reference information of all reference image frames meets the set recognition conditions, determine that the reference status of the current image frame to the long-term reference frame is a reference failure status.
[0149] In one embodiment of the present disclosure, the determination module 903 is further used to: obtain the first frame number of the first image frame of this round that does not need to refer to the long-term reference frame, and the second frame number of the current image frame; obtain the frame number interval distance between the first frame number and the second frame number; and determine whether the current image frame meets the pull-back condition for pulling back the long-term reference frame based on the frame number interval distance.
[0150] In one embodiment of the present disclosure, the determination module 903 is further used to: if the frame number interval distance is between a first set threshold and a second set threshold, obtain the peak signal-to-noise ratio between the current image frame and the long-term reference frame; if the peak signal-to-noise ratio is greater than the signal-to-noise ratio threshold, determine that the current image frame meets the pull-back condition; or, if the peak signal-to-noise ratio is less than or equal to the signal-to-noise ratio threshold, determine that the current image frame does not meet the pull-back condition.
[0151] In one embodiment of the present disclosure, the determination module 903 is further used to: if the frame number interval distance is greater than the second set threshold, determine that the current image frame meets the pull-back condition; or if the frame number interval distance is less than the first set threshold, determine that the current image frame does not meet the pull-back condition.
[0152] In one embodiment of the present disclosure, the determination module 903 is further used to: when the frame number interval distance is greater than a second set threshold, obtain the next image frame that does not need to refer to the long-term reference frame as the first image frame in the next round that does not need to refer to the long-term reference frame.
[0153] In one embodiment of the present disclosure, the determination module 903 is further used to: obtain the number of counts of the long-term reference frame in this round determined as a reference failure state from the current round of counting of the counter; and determine whether the current image frame meets the pull-back conditions for pulling back the long-term reference frame based on the count number.
[0154] In one embodiment of the present disclosure, the determination module 903 is further used to: if the counted times reaches a third set threshold, determine that the current image frame meets the pull-back condition, clear the counter, and restart the count.
[0155] In one embodiment of the present disclosure, the device also includes: if the reference state of the current image frame to the long-term reference frame is a reference invalid state, determining the long-term reference frame mark bit of the current image frame to be a first value; or, if the reference state of the current image frame to the long-term reference frame is a reference valid state, determining the long-term reference frame mark bit of the current image frame to be a second value.
[0156] In one embodiment of the present disclosure, the apparatus further includes: acquiring first scene information of a current image frame; acquiring second scene information of a historical image frame adjacent to the current image frame;
[0157] Determine the scene similarity between the first scene information and the second scene information; if the scene similarity is less than or equal to a set similarity threshold, update the long-term reference frame, and the updated long-term reference frame is used as a coding reference for subsequent image frames.
[0158] In one embodiment of the present disclosure, the device further includes: determining that the current image frame is an updated long-term reference frame.
[0159] The method for determining the reference state of a long-term reference frame of the disclosed embodiment can determine different long-term reference frames according to scene switching, realize dynamic updating of the long-term reference frame, achieve the purpose of periodically adjusting the long-term reference frame, avoid always using the same frame as the long-term reference frame, and improve the encoding performance. By obtaining the reference image frame of the current image frame, the reference state of the current image frame to the long-term reference frame is determined according to the reference information of the reference image frame to the long-term reference frame. Further, when the reference state of the current image frame to the long-term reference frame is a reference failure state, it is necessary to determine whether to pull back the long-term reference frame. By pulling back the long-term reference frame, the problem of reduced encoding accuracy caused by the image continuously not referring to the long-term reference frame during the encoding process can be avoided, the loss in encoding time can be reduced, and the error resistance of the encoding can be enhanced. Moreover, the encoder only needs to refer to the long-term reference frame for the image frame in the reference valid state, which reduces the loss in encoding time, improves the encoding performance, and ensures that the encoding efficiency is not affected.
[0160] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0161] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0162] Fig.10 A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0163] like Fig.10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program / instruction stored in a read-only memory (ROM) 1002 or a computer program / instruction loaded from a storage unit 1006 to a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0164] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, etc.; an output unit 1007 such as various types of displays, speakers, etc.; a storage unit 1008 such as a disk, an optical disk, etc.; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0165] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as a method for determining a reference state of a long-term reference frame. For example, in some embodiments, the method for determining a reference state of a long-term reference frame may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1006. In some embodiments, part or all of the computer program / instructions may be loaded and / or installed on the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program / instructions are loaded into the RAM 1003 and executed by the computing unit 1001, one or more steps of the method for determining the reference state of a long-term reference frame described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured in any other appropriate manner (eg, by means of firmware) to execute the method for determining the reference state of the long-term reference frame.
[0166] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs / instructions that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0167] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0168] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0169] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0170] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0171] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs / instructions running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0172] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in the disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in the disclosure can be achieved, and this document does not limit them here.
[0173] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for determining a reference state of a long-term reference frame, in, include: Acquire at least one reference image frame of the current image frame; Obtaining the number of reference coding blocks referring to the long-term reference frame in each of the reference image frames; Get the total number of coding blocks of the image frame; Determining reference information of the reference image frame according to the number of reference coding blocks and the total number of coding blocks, the reference information referring to information of whether the reference image frame refers to the long-term reference frame; Based on the reference information, the reference status of the current image frame to the long-term reference frame is determined, and the reference status includes a reference invalid status and a reference valid status. The reference valid status indicates that the current image frame needs to refer to the long-term reference frame, and the reference invalid status indicates that the current image frame does not need to refer to the long-term reference frame.
2. The method according to claim 1, in, The method further comprises: If it is determined that the reference state of the current image frame to the long-term reference frame is a reference failure state, determining whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame; If the current image frame satisfies the pull-back condition, updating the reference state of the long-term reference frame to a reference valid state; If the current image frame does not meet the pull-back condition, the reference state of the long-term reference frame is maintained as a reference invalid state.
3. The method according to claim 1, in, The step of determining, according to the reference information, a reference state of the current image frame to the long-term reference frame comprises: Determining whether the reference information of each of the reference image frames satisfies a set identification condition that does not refer to the long-term reference frame; If the reference information of all reference image frames satisfies the set identification condition, it is determined that the reference state of the current image frame to the long-term reference frame is a reference failure state.
4. The method according to claim 2, in, The determining whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame includes: Obtaining a first frame number of the first image frame in this round that does not need to refer to the long-term reference frame, and a second frame number of the current image frame; Obtaining a frame number interval distance between the first frame number and the second frame number; According to the frame number interval distance, it is determined whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame.
5. The method according to claim 4, in, The step of judging whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame according to the frame number interval distance includes: If the frame number interval is between a first set threshold and a second set threshold, obtaining a peak signal-to-noise ratio between the current image frame and the long-term reference frame; If the peak signal-to-noise ratio is greater than the signal-to-noise ratio threshold, it is determined that the current image frame meets the pull-back condition; or, If the peak signal-to-noise ratio is less than or equal to the signal-to-noise ratio threshold, it is determined that the current image frame does not meet the pullback condition.
6. The method according to claim 5, in, The method further comprises: If the frame number interval is greater than the second set threshold, it is determined that the current image frame meets the pull-back condition; or, If the frame number interval distance is less than the first set threshold, it is determined that the current image frame does not meet the pull-back condition; wherein the second set threshold is greater than the first set threshold.
7. The method according to claim 6, in, The method further comprises: When the frame number interval distance is greater than the second set threshold, the next image frame that does not need to refer to the long-term reference frame is obtained as the first image frame in the next round that does not need to refer to the long-term reference frame.
8. The method according to claim 2, in, The determining whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame includes: Obtaining the number of times the long-term reference frame in this round is determined to be in a reference failure state starting from the current round counting of the counter; According to the counted number, it is determined whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame.
9. The method according to claim 8, in, The method further comprises: If the counted times reaches a third set threshold, it is determined that the current image frame meets the pull-back condition, and the counter is cleared and counted again.
10. The method according to claim 1, in, The method further comprises: If the reference state of the current image frame to the long-term reference frame is a reference failure state, determining the long-term reference frame flag bit of the current image frame to be a first value; or, If the reference state of the current image frame to the long-term reference frame is a reference valid state, the long-term reference frame flag bit of the current image frame is determined to be a second value.
11. The method according to claim 1, in, The method further comprises: Acquire first scene information of the current image frame; Acquire second scene information of a historical image frame adjacent to the current image frame; Determining scene similarity between the first scene information and the second scene information; If the scene similarity is less than or equal to a set similarity threshold, the long-term reference frame is updated, and the updated long-term reference frame is used as a coding reference for subsequent image frames.
12. The method according to claim 11, in, The updating of the long-term reference frame comprises: The current image frame is determined to be an updated long-term reference frame.
13. A device for determining a reference state of a long-term reference frame, include: A first acquisition module, used to acquire at least one reference image frame of the current image frame; A second acquisition module is used to acquire reference information of each reference image frame to a long-term reference frame, wherein the reference information refers to information of whether the reference image frame refers to the long-term reference frame; a determination module, configured to determine, based on the reference information, a reference state of the current image frame to the long-term reference frame, wherein the reference state includes a reference invalid state and a reference valid state, wherein the reference valid state indicates that the current image frame needs to refer to the long-term reference frame, and the reference invalid state indicates that the current image frame does not need to refer to the long-term reference frame; The second acquisition module is further used for: Acquire the number of reference coding blocks that refer to the long-term reference frame in each of the reference image frames; Get the total number of coding blocks of the image frame; Reference information of the reference image frame is determined according to the number of reference coding blocks and the total number of coding blocks.
14. The device according to claim 13, in, The determining module is further used for: If it is determined that the reference state of the current image frame to the long-term reference frame is a reference failure state, determining whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame; If the current image frame satisfies the pull-back condition, updating the reference state of the long-term reference frame to a reference valid state; If the current image frame does not meet the pull-back condition, the reference state of the long-term reference frame is maintained as a reference invalid state.
15. The device according to claim 13, in, The second acquisition module is further used for: Determining whether the reference information of each of the reference image frames satisfies a set identification condition that does not refer to the long-term reference frame; If the reference information of all reference image frames satisfies the set identification condition, it is determined that the reference state of the current image frame to the long-term reference frame is a reference failure state.
16. The device according to claim 14, in, The determining module is further used for: Obtaining a first frame number of the first image frame in this round that does not need to refer to the long-term reference frame, and a second frame number of the current image frame; Obtaining a frame number interval distance between the first frame number and the second frame number; According to the frame number interval distance, it is determined whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame.
17. The device according to claim 16, in, The determining module is further used for: If the frame number interval is between a first set threshold and a second set threshold, obtaining a peak signal-to-noise ratio between the current image frame and the long-term reference frame; If the peak signal-to-noise ratio is greater than the signal-to-noise ratio threshold, determining that the current image frame meets the pullback condition; or, If the peak signal-to-noise ratio is less than or equal to the signal-to-noise ratio threshold, it is determined that the current image frame does not meet the pullback condition.
18. The device according to claim 17, in, The determining module is further used for: If the frame number interval is greater than the second set threshold, it is determined that the current image frame meets the pull-back condition; or, If the frame number interval distance is less than the first set threshold, it is determined that the current image frame does not meet the pull-back condition; wherein the second set threshold is greater than the first set threshold.
19. The device according to claim 18, in, The determining module is further used for: When the frame number interval distance is greater than the second set threshold, the next image frame that does not need to refer to the long-term reference frame is obtained as the first image frame in the next round that does not need to refer to the long-term reference frame.
20. The device according to claim 14, in, The determining module is further used for: Obtaining the number of times the long-term reference frame in this round is determined to be in a reference failure state starting from the current round counting of the counter; According to the counted number, it is determined whether the current image frame satisfies a pull-back condition for pulling back the long-term reference frame.
21. The device according to claim 20, in, The determining module is further used for: If the counted times reaches a third set threshold, it is determined that the current image frame meets the pull-back condition, and the counter is cleared and counted again.
22. The device according to claim 13, in, The device also includes: If the reference state of the current image frame to the long-term reference frame is a reference failure state, determining the long-term reference frame flag bit of the current image frame to be a first value; or, If the reference state of the current image frame to the long-term reference frame is a reference valid state, the long-term reference frame flag bit of the current image frame is determined to be a second value.
23. The device according to claim 13, in, The device also includes: Acquire first scene information of the current image frame; Acquire second scene information of a historical image frame adjacent to the current image frame; Determining scene similarity between the first scene information and the second scene information; If the scene similarity is less than or equal to a set similarity threshold, the long-term reference frame is updated, and the updated long-term reference frame is used as a coding reference for subsequent image frames.
24. The device according to claim 23, in, The device also includes: The current image frame is determined to be an updated long-term reference frame.
25. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.
26. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method for determining a reference state of a long-term reference frame according to any one of claims 1-12.
27. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method for determining the reference state of a long-term reference frame according to claim 1 are implemented.
