Video encoding method and device, electronic device and computer readable storage medium
By using the target linked list of the intra-block copy hash table in video encoding, the problem of high image coding complexity in the 5G era is solved, and efficient coding and low-bit rate transmission are achieved.
Patent Information
- Application Number
- CN202010575931.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-22
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2040-06-22
AI Technical Summary
In the 5G era, with the explosion of Internet image traffic, existing image encoding technologies are difficult to effectively process new Internet images with diverse and differentiated characteristics, resulting in high encoding complexity and high computing resources, which makes it difficult to meet the needs of efficient coding and low-bit rate transmission.
By obtaining the block hash value and address of the currently to be encoded video, the matching target linked list is determined from the intra-block copy hash table, invalid nodes are excluded, and matching reference blocks are searched for intra-block copy encoding.
It reduces encoding complexity, reduces computing resource usage, improves video encoding efficiency and speed, while maintaining video quality.
Smart Images

Figure CN111836046B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of video encoding, and in particular to a video encoding method, a video encoding device, an electronic device, and a computer-readable storage medium. Background Art
[0002] On the one hand, the Internet is about to enter a new era of 5G (5th generation mobile networks or 5th generation wireless systems, 5th-Generation, the fifth generation of mobile communication technology). Images (videos) appearing in various Internet applications have become the main consumers of Internet bandwidth. In particular, the image traffic of mobile Internet is increasing day by day, and it will have an explosive growth in the 5G era, which will inject a new and powerful impetus into the accelerated development of image coding technology. At the same time, it also poses many severe new challenges to image coding technology that have never been encountered in the past. In the 5G era, everything is connected, and the new Internet images generated in various emerging applications are diverse and different. Therefore, how to study efficient image coding technology based on the characteristics of new Internet images with diversity and differences has become an urgent need.
[0003] On the other hand, the amount of video data required to depict even a relatively short film may also be quite large, which may cause difficulties when the data is streamed or otherwise transmitted through a communication network with limited bandwidth capacity. Therefore, before being transmitted through modern telecommunications networks, video data is usually compressed. Before transmission, video compression equipment usually uses software and / or hardware on the source side to encode video data, thereby reducing the amount of data required for representing digital video images. The compressed data is subsequently received at the destination by a video decompression device, which encodes the video data. Under limited network resources and an increasing demand for higher video quality, it is necessary to improve image quality without increasing the improved compression and decompression technology of bit rate.
[0004] Intra Block Copy (IBC) technology can effectively improve the rate distortion (RD) quality of a video. However, the encoding complexity of the IBC technology in the related art is relatively high and consumes a lot of computing resources.
[0005] Therefore, a new video encoding method and apparatus, electronic device and computer-readable storage medium are needed.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure. Summary of the invention
[0007] The embodiments of the present disclosure provide a video encoding method, a video encoding method, an electronic device and a computer-readable storage medium, which can improve video encoding efficiency, reduce encoding complexity and occupy less computing resources.
[0008] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0009] The present disclosure provides a video encoding method, the method comprising: obtaining a current video to be encoded, the current video to be encoded comprising a current image, the current image comprising a current maximum coding unit, and the current maximum coding unit comprising a current block; obtaining a hash value of the current block and an address of the current block in the current maximum coding unit; determining a target linked list whose hash index value matches the hash value of the current block from an intra-block copy hash table of the current maximum coding unit; excluding at least part of invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit, and obtaining remaining nodes in the target linked list, wherein the invalid nodes correspond to candidate reference blocks in an uncoded area of the current maximum coding unit; and searching for a matching reference block of the current block from the remaining nodes to perform intra-block copy encoding on the current block.
[0010] The embodiment of the present disclosure provides a video encoding device, the device comprising: a video acquisition unit to be encoded, used to acquire a current video to be encoded, the current video to be encoded includes a current image, the current image includes a current maximum coding unit, and the current maximum coding unit includes a current block; a coding block information acquisition unit, used to acquire a hash value of the current block and an address of the current block in the current maximum coding unit; a coding block linked list determination unit, used to determine a target linked list whose hash index value matches the hash value of the current block from an intra-block copy hash table of the current maximum coding unit; a coding invalid block exclusion unit, used to exclude at least part of invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit, and acquire the remaining nodes in the target linked list, wherein the invalid nodes correspond to candidate reference blocks in an uncoded area of the current maximum coding unit; and an intra-block copy coding unit, used to search for a matching reference block of the current block from the remaining nodes, so as to perform intra-block copy coding on the current block.
[0011] In some exemplary embodiments of the present disclosure, the video encoding device also includes: a candidate reference block address acquisition unit, which is used to sequentially acquire the hash values of the candidate reference blocks in the current maximum coding unit and their addresses in the current maximum coding unit according to a scanning order; a candidate reference block node generation unit, which is used to insert the candidate reference block into a linked list corresponding to the intra-frame block copy hash table as a node in the corresponding linked list according to the hash value of the candidate reference block; and a candidate reference block address storage unit, which is used to store the address of the candidate reference block in the current maximum coding unit in the corresponding node in the linked list.
[0012] In some exemplary embodiments of the present disclosure, the scanning order is a scanning order from left to right and from top to bottom according to the way in which the current maximum coding unit is divided into blocks.
[0013] In some exemplary embodiments of the present disclosure, the address of the current block within the current maximum coding unit is the coordinates of the upper left corner pixel of the current block within the current maximum coding unit, and the address of the candidate reference block within the current maximum coding unit is the coordinates of the upper left corner pixel of the candidate reference block within the current maximum coding unit.
[0014] In some exemplary embodiments of the present disclosure, the encoding invalid block exclusion unit includes: a node address acquisition unit, used to obtain the address of the node in the target linked list within the current maximum coding unit; a first node exclusion unit, used to exclude the node whose vertical coordinate of the address of the node in the target linked list is greater than the vertical coordinate of the address of the current block, and treat it as the at least partially invalid node.
[0015] In some exemplary embodiments of the present disclosure, the encoding invalid block exclusion unit also includes: a second node exclusion unit, used to exclude the nodes whose vertical coordinates of the addresses of the nodes in the target linked list are equal to the vertical coordinates of the addresses of the current block, and whose horizontal coordinates of the addresses of the nodes in the target linked list are greater than the horizontal coordinates of the addresses of the current block, and treat them as the at least partially invalid nodes.
[0016] In some exemplary embodiments of the present disclosure, the nodes in the linked list in the intra-block copy hash table are first-in-last-out.
[0017] In some exemplary embodiments of the present disclosure, the lower right corner block of the current maximum coding unit is the starting node of the linked list. When performing an intra-block copy hash value search for each current block, the stored current block is directly used to start the search at the address of the hash index linked list node.
[0018] The embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the video encoding method described in the above embodiments is implemented.
[0019] An embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a storage device configured to store at least one program, so that when the at least one program is executed by the at least one processor, the at least one processor implements the video encoding method as described in the above embodiment.
[0020] In the technical solutions provided by some embodiments of the present disclosure, by directly using the address of each current block in its corresponding current maximum coding unit when performing an IBC hash search on each current block, at least some invalid nodes in the target linked list in the IBC hash table of the corresponding current maximum coding unit are excluded. When performing IBC encoding on the current block, it is only necessary to search for the matching reference block of the current block in the remaining nodes of the target linked list after excluding the at least some invalid nodes. On the one hand, the number of invalid nodes in the target linked list in the IBC hash table can be reduced, thereby improving the IBC encoding speed and encoding efficiency without reducing the video quality. On the other hand, less computing resources can be consumed, and the encoding complexity can be reduced while ensuring that the video RD quality remains unchanged.
[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0023] Figure 1 A basic block diagram of video encoding in the related art is schematically shown;
[0024] Figure 2 A schematic diagram of intra-frame block copying in the related art is schematically shown;
[0025] Figure 3 The flowchart of the video encoding method according to an embodiment of the present disclosure is schematically shown;
[0026] Figure 4 A schematic diagram schematically shows a video encoding method according to an embodiment of the present disclosure;
[0027] Figure 5 A schematic diagram schematically shows a video encoding method according to an embodiment of the present disclosure;
[0028] Figure 6 A block diagram of a video encoding device according to an embodiment of the present disclosure is schematically shown;
[0029] Figure 7 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0030] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.
[0031] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0032] The block diagrams shown in the accompanying drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in at least one hardware module or integrated circuit, or in different networks and / or processor devices and / or microcontroller devices.
[0033] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0034] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0035] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0036] The technical solution provided in the embodiments of the present disclosure can be applied to any application scenario involving video, image, etc. processing, such as cloud gaming and cloud conferencing, and the present disclosure does not limit this.
[0037] Among them, cloud gaming, also known as gaming on demand, is an online gaming technology based on cloud computing technology. Cloud gaming technology enables thinclient devices with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud gaming scenario, the game is not played on the player's game terminal, but on a cloud server, which renders the game scene into a video and audio stream and transmits it to the player's game terminal over the network. The player's game terminal does not need to have powerful graphics computing and data processing capabilities, but only needs to have basic streaming media playback capabilities and the ability to obtain player input commands and send them to the cloud server.
[0038] Among them, cloud conferencing is an efficient, convenient and low-cost conference format based on cloud computing technology. Users only need to use the Internet interface and perform simple and easy-to-use operations to quickly and efficiently share voice, data files and videos with teams and customers around the world, while the cloud conferencing service provider helps users operate complex technologies such as data transmission and processing during the meeting.
[0039] Currently, cloud conferencing mainly focuses on service content based on the SaaS (Software as a Service) model, including telephone, network, video and other service forms. Video conferencing based on cloud computing is called cloud conferencing.
[0040] In the era of cloud conferencing, data transmission, processing, and storage are all handled by the computer resources of video conferencing manufacturers. Users no longer need to purchase expensive hardware or install cumbersome software. They only need to open a browser and log in to the corresponding interface to conduct efficient remote meetings.
[0041] The cloud conference system supports dynamic cluster deployment of multiple servers and provides multiple high-performance servers, which greatly improves the stability, security and availability of conferences. In recent years, video conferencing has been welcomed by many users because it can greatly improve communication efficiency, continuously reduce communication costs, and bring about an upgrade in internal management level. It has been widely used in various fields such as government, military, transportation, finance, operators, education, and enterprises. There is no doubt that after the use of cloud computing, video conferencing has a stronger appeal in terms of convenience, speed, and ease of use, which will surely stimulate the arrival of a new upsurge in video conferencing applications.
[0042] First, some terms involved in the embodiments of the present disclosure are explained.
[0043] AVS: Audio Video Coding Standard, audio and video coding standard.
[0044] HEVC: High Efficiency Video Coding, also known as H.265.
[0045] VVC: Versatile Video Coding, also known as H.266.
[0046] Intra(picture)Prediction: intra-frame prediction.
[0047] Inter(picture)Prediction: Inter-frame prediction.
[0048] SCC: screen content coding, screen content / image coding.
[0049] Loop Filtering: Loop filtering.
[0050] QP: Quantization Parameter, quantization parameter.
[0051] LCU: Largest Coding Unit, maximum coding unit.
[0052] CTU: Coding Tree Unit, coding tree unit, generally divided from the largest coding unit downward.
[0053] CU: Coding Unit, coding unit.
[0054] PU: Prediction Unit, prediction unit.
[0055] MV: Motion Vector, motion vector.
[0056] MVP: Motion Vector Prediction, motion vector prediction value.
[0057] MVD: Motion Vector Difference, the difference between the true valuation of MVP and MV.
[0058] AMVP: Advanced Motion Vector Prediction, advanced motion vector prediction.
[0059] ME: Motion Estimation, the process of obtaining a motion vector MV is called motion estimation, which is a technology in motion compensation (MC).
[0060] MC: The process of obtaining an estimated value of the current image based on the motion vector and the inter-frame prediction method. Motion compensation is a method of describing the difference between adjacent frames (adjacent here means adjacent in coding relationship, and the two frames may not be adjacent in playback order). Specifically, it describes how each small block of the previous frame moves to a certain position in the current frame. This method is often used by video compression / video encoders to reduce spatial redundancy in video sequences. Adjacent frames are usually very similar, that is, they contain a lot of redundancy. The purpose of using motion compensation is to improve the compression ratio by eliminating this redundancy.
[0061] BV: Block Vector, block displacement vector / block vector.
[0062] BVP: Block Vector Prediction, block vector prediction value.
[0063] BVD: Block Vector Difference, the difference between the true valuation of BVP and BV.
[0064] I Slice: Intra Slice, an image can be divided into one frame or two fields, and a frame can be divided into one or several slices.
[0065] Video signals can be captured by cameras or generated by computers. Due to different statistical characteristics, the corresponding compression encoding methods may also be different.
[0066] Some video coding technologies, such as HEVC, VVC, and AVS, use a hybrid coding framework, such as Figure 1As shown, the images (pictures) in the input original video signal (input video) are encoded in sequence, and the following series of operations and processing are performed:
[0067] 1) Block partition structure: The input image is divided into several non-overlapping processing units, and similar compression operations are performed on each processing unit. This processing unit can be called CTU or LCU. Below CTU or LCU, more detailed divisions can be continued to obtain at least one basic coding unit, called CU. Each CU is the most basic element in the coding process. The following describes various possible coding methods for each CU.
[0068] 2) Predictive Coding: This includes intra-frame prediction and inter-frame prediction. The original video signal is predicted by the selected reconstructed video signal to obtain a residual video signal. The encoder needs to select the most suitable predictive coding mode for the current CU from among many possible predictive coding modes and inform the encoder.
[0069] a. Intra-frame prediction: The predicted signal comes from the area that has been encoded and reconstructed in the same image.
[0070] The basic idea of intra prediction is to use the correlation of adjacent pixels to remove spatial redundancy. In video coding, adjacent pixels refer to the reconstructed pixels of the encoded CU around the current CU.
[0071] b. Inter-frame prediction: The predicted signal comes from other images that have been encoded and are different from the current image (called reference images).
[0072] 3) Transform Coding and Quantization (Transform & Quantization): The residual video signal is transformed into the transform domain through DFT (DIBCreteFourier Transform), DCT (DIBCrete Cosine Transform) and other transformation operations, which are called transform coefficients. The residual video signal in the transform domain is further subjected to lossy quantization operations, which loses certain information, making the quantized signal conducive to compression expression.
[0073] In some video coding standards, there may be more than one transform mode available for selection, so the encoder also needs to select one of the transforms for the current CU to be encoded and inform the encoder.
[0074] Among them, the degree of quantization is usually determined by the quantization parameters (QP). When the QP value is large, the transform coefficients representing a larger value range will be quantized into the same output, which usually results in greater distortion and lower bit rate. On the contrary, when the QP value is small, the transform coefficients representing a smaller value range will be quantized into the same output, which usually results in less distortion and corresponds to a higher bit rate.
[0075] 4) Entropy Coding or Statistical Coding: The quantized transform domain signal will be statistically compressed and encoded according to the frequency of occurrence of each value, and finally output as a binary (0 or 1) compressed bitstream.
[0076] At the same time, encoding generates other information, such as the selected coding mode, motion vectors, etc., which also need to be entropy encoded to reduce the bit rate.
[0077] Among them, statistical coding is a lossless coding method that can effectively reduce the bit rate required to express the same signal. Common statistical coding methods include variable length coding (VLC) or context-based binary arithmetic coding (CABAC).
[0078] 5) Loop Filtering: The encoded image can be reconstructed into a decoded picture after undergoing inverse quantization, inverse transformation and prediction compensation (the reverse operation of the above steps 2) to 4). Compared with the original input image, the reconstructed encoded image has some information that is different from the original input image due to the influence of quantization, resulting in distortion. Filtering the reconstructed encoded image, such as deblocking filtering, SAO (Sample Adaptive Offset) or ALF (Adaptive Loop Filter), can effectively reduce the degree of distortion caused by quantization. Since these filtered reconstructed encoded images will be used as a reference for subsequent encoded images and used to predict future signals, the above filtering operation is also called loop filtering, and filtering operations within the encoding loop.
[0079] Figure 1 Shows a basic flow chart of a video encoder. Figure 1 The kth CU (marked as s k[x, y]) is used as an example. Where k is a positive integer greater than or equal to 1 and less than or equal to the number of CUs in the input current image, s k [x, y] represents the pixel with coordinates [x, y] in the kth CU, where x represents the horizontal coordinate of the pixel and y represents the vertical coordinate of the pixel. k [x,y] is obtained through a better processing such as motion compensation or intra-frame prediction to obtain a prediction signal s k [x,y] and Subtract to get the residual signal u k [x,y], and then the residual signal u k [x, y] is transformed and quantized. The quantized output data has two different destinations: one is sent to the entropy encoder for entropy encoding, and the encoded bit stream is output to a buffer for storage and waiting to be transmitted; the other application is to obtain the signal u′ after inverse quantization and inverse transformation. k [x,y] Transform the signal u′ k [x,y] and Add together to get the new prediction signal s * k [x,y], and s * k [x,y] is sent to the current image buffer for storage. * k [x,y] is obtained by intra-image prediction f(s * k [x,y]).s * k [x,y] is obtained after loop filtering to obtain s′ k [x,y], and s′ k [x,y] is sent to the coded image buffer for storage to generate the reconstructed video. s′ k [x,y] is obtained after motion-compensated prediction s′ r [x+m x ,y+m y ],s′ r [x+m x ,y+m y ] represents the reference block, m x and m y Represent the horizontal and vertical components of the motion vector respectively.
[0080] Some video coding standards, such as HEVC, VVC, and AVS3, all adopt a block-based hybrid coding framework. They divide the original video data into a series of coding blocks, and combine video coding methods such as prediction, transform, and entropy coding to achieve video data compression. Among them, motion compensation is a commonly used prediction method for video coding. Motion compensation is based on the redundant characteristics of video content in the time domain or spatial domain, and derives the prediction value of the current block from the encoded area. This type of prediction method includes: inter-frame prediction, intra-frame block copy prediction, intra-frame string copy prediction, etc. In specific coding implementations, these prediction methods may be used alone or in combination. For coding blocks using these prediction methods, it is usually necessary to explicitly or implicitly encode at least one two-dimensional displacement vector in the bitstream to indicate the displacement of the current block (or the same-position block of the current block) relative to at least one of its reference blocks.
[0081] Among them, in different prediction modes and different implementations, the displacement vector may have different names. In the embodiments of the present disclosure, they are uniformly described in the following manner: 1) The displacement vector in inter-frame prediction is called a motion vector (MV); 2) The displacement vector in intra-frame block copying is called a block vector or a block displacement vector (BV); 3) The displacement vector in intra-frame string copying is called a string vector (String Vector, abbreviated as SV).
[0082] The following introduces the related technologies in intra block copy prediction.
[0083] Screen images are images generated by electronic devices such as computers, mobile phones, and televisions, and mainly include two types of content: one is computer-generated non-continuous tone content, which contains a large number of small and sharp line shapes, such as text, icons, buttons, and grids; the other is camera-shot content containing a large number of continuous tones, such as movies, TV clips, natural image videos, etc. Block-based hybrid coding video coding standards in related technologies, such as AVS and HEVC, have a high compression ratio for natural images and videos containing a large amount of continuous content, but the compression effect is not good for screen images containing non-continuous tone content.
[0084] With the rapid development of cloud computing, mobile communication technology and wireless display technology, how to display screen images on various electronic terminal devices with high quality at low bit rates is a problem that SCC needs to solve. In order to improve the performance of screen image coding, the SCC version of the HEVC standard has been developed, and some tools that are conducive to screen image coding have been adopted, such as IBC (intra block copy).
[0085] IBC is an intra-frame coding tool adopted in the HEVC Screen Content Coding (SCC) extension, which significantly improves the coding efficiency of screen content. In AVS3 and VVC, IBC technology is also adopted to improve the performance of screen content coding. IBC uses the spatial correlation of screen content video and uses the coded image pixels on the current image to predict the current block to be coded ( Figure 2 The pixels of the current block (referred to as the current block) can effectively save the bits required to encode the pixels.
[0086] like Figure 2 As shown in Figure 1, the displacement between the current block and its reference block in IBC is called a block vector (BV). VVC uses a similar AMVP mode in inter-frame prediction to predict BV and allows BVD to be encoded using 1 or 4 pixel resolution.
[0087] HEVC SCC can effectively improve the video coding quality in computer-generated screen content scenarios. IBC is the module in SCC that contributes the most to the improvement of video RD quality. However, IBC technology requires point-by-point search within the valid coded area as much as possible to find the position of the most matching reference block. Such full pixel search will lead to huge coding complexity.
[0088] In order to reduce the complexity and search the valid encoded area as much as possible, the IBC hash search algorithm came into being. By scanning each CTU in the video frame line by line, the hash value of the corresponding block is obtained at each possible pixel search position, and the position is added to the linked list corresponding to the same hash value (index value) in the hash table. In this way, an IBC hash table can be created in the valid encoded area. The table consists of many one-way linked lists, each of which corresponds to a hash index value.
[0089] When performing IBC encoding on a coding block, its hash value is first calculated, and then the corresponding linked list is found in the IBC Hash table based on the hash value, so that the reference position with the same hash information is found through each node in the linked list, and the position of the best matching block is found in these nodes. Because the position of each node in the linked list is not continuous, the number of search points can be greatly reduced, and because the hash values of these nodes are the same, it means that the reference blocks they represent have similar content or texture information to the current block, so the encoding performance of the full search method can be basically retained.
[0090] In the related art, before encoding a CTU, the IBC Hash table will scan the hash information of all possible reference blocks in the CTU area to expand the IBC Hash table. Since the storage order of the nodes in the one-way linked list in the IBC Hash table is first-in-last-out, and the encoding order is usually from left to right and from top to bottom, the last reference block position inserted into the one-way linked list will be placed at the starting position of the corresponding one-way linked list. Then, the position of the starting reference block of the updated one-way linked list in the corresponding IBC Hash table may point to the lower right corner area of the current CTU. Since these areas have not yet been IBC encoded, these areas are invalid for the CU in the upper left corner of the current LCU that has not yet been IBC encoded.
[0091] However, the search in the one-way linked list starts from the starting position, filtering out the reference block positions in the uncoded area of the CTU until the reference block positions in the valid coded area of the CTU are found. The process of parsing and excluding the one-way linked list nodes located in the invalid reference area of the CTU consumes more computing resources.
[0092] The method provided by the embodiment of the present disclosure can be applied to a video encoder or video compression product using IBC, and can be applied to lossy data compression encoding or lossless data compression encoding. The data involved in the encoding process refers to one of the following examples or a combination thereof:
[0093] 1) One-dimensional data;
[0094] 2) Two-dimensional data;
[0095] 3) Multidimensional data;
[0096] 4) Graphics;
[0097] 5) Image;
[0098] 6) Sequence of images;
[0099] 7) Video;
[0100] 8) Three-dimensional scene;
[0101] 9) Sequences of continuously changing three-dimensional scenes;
[0102] 10) Virtual reality scenes;
[0103] 11) A sequence of continuously changing virtual reality scenes;
[0104] 12) Images in pixel form;
[0105] 13) Transform domain data of the image;
[0106] 14) A collection of bytes of two or more dimensions;
[0107] 15) A set of bits of two or more dimensions;
[0108] 16) A collection of pixels;
[0109] 17) A set of three-component pixels (Y, U, V);
[0110] 18) A set of three-component pixels (Y, Cb, Cr);
[0111] 19) A set of three-component pixels (Y, Cg, Co);
[0112] 20) A set of three-component pixels (R, G, B);
[0113] 21) A set of four-component pixels (C, M, Y, K);
[0114] 22) A set of four-component pixels (R, G, B, A);
[0115] 23) A set of four-component pixels (Y, U, V, A);
[0116] 24) A set of four-component pixels (Y, Cb, Cr, A);
[0117] 25) A set of four-component pixels (Y, Cg, Co, A).
[0118] When the data is an image, a sequence of images, or a video listed above, a coding block is a coding area of an image, and should include at least one of the following: a group of images, a predetermined number of images, an image, a frame of an image, a field of an image, a sub-image of an image, a slice, a macroblock, a maximum coding unit LCU, a coding tree unit CTU, and a coding unit CU.
[0119] Figure 3 The figure schematically shows a video encoding method according to an embodiment of the present disclosure. Figure 3 The embodiment is described by taking the encoding end as an example. Figure 3 As shown, the method provided by the embodiment of the present disclosure may include the following steps.
[0120] In step S310, a current video to be encoded is obtained, where the current video to be encoded includes a current image, the current image includes a current maximum coding unit, and the current maximum coding unit includes a current block.
[0121] In an embodiment of the present disclosure, at the encoding end, when encoding the current block to be encoded (i.e., the current block), the current block to be encoded is a sub-image, including at least one of the following: CU, PU, TU. In the following examples, CU is used as an example for illustration, but the present disclosure is not limited thereto. The pixels in the encoding block are encoded using an intra-block copy mode, that is, an IBC encoding information compressed data stream is generated, and the IBC encoding information compressed data stream is transmitted to the encoding end.
[0122] In step S320, a hash value of the current block and an address of the current block in the current maximum coding unit are obtained.
[0123] In the disclosed embodiment, the hash value of the current block may be calculated using the gradient and DC (Direct Current, direct current, brightness component value of a pixel) coefficient of the current block.
[0124] For example, assuming that the size of the current block is 8x8, that is, there are 8x8 pixels in total, the horizontal and vertical gradients corresponding to each pixel can be obtained, and then summed, and the pixel sums of the four 4x4 blocks corresponding to 8x8 are obtained to obtain the DC coefficient. Only the highest 3 bits of the pixel sum of each 4x4 block are taken. In order to save bandwidth, only the highest 3 bits of the first three 4x4 blocks are used here, that is, the upper 9 bits of the 16-bit hash value, and the remaining lower 7 bits are used to identify the effective value of the gradient. However, the present disclosure does not limit the calculation method of the hash value of the block, and it is only used here for illustration.
[0125] In step S330, a target linked list whose hash index value matches the hash value of the current block is determined from the intra-block copy hash table of the current maximum coding unit.
[0126] In an exemplary embodiment, the method may further include: obtaining, in sequence according to a scanning order, hash values of candidate reference blocks within the current maximum coding unit and their addresses within the current maximum coding unit; inserting, according to the hash values of the candidate reference blocks, the candidate reference blocks into a linked list corresponding to the intra-block copy hash table as nodes in the corresponding linked list; and storing the addresses of the candidate reference blocks within the current maximum coding unit in the corresponding nodes in the linked list.
[0127] In an exemplary embodiment, the scanning order may be a left-to-right, top-to-bottom scanning order according to the way the current maximum coding unit is divided into blocks. Video coding uses a left-to-right, top-to-bottom scanning order, which can fully utilize the encoded blocks for intra-frame prediction.
[0128] In an exemplary embodiment, in an exemplary embodiment, the address of the current block within the current maximum coding unit may be the coordinates of the upper left corner pixel of the current block within the current maximum coding unit, and the address of the candidate reference block within the current maximum coding unit may be the coordinates of the upper left corner pixel of the candidate reference block within the current maximum coding unit.
[0129] In an exemplary embodiment, the nodes in the linked list in the intra block copy hash table are first-in-last-out.
[0130] In an exemplary embodiment, the lower right corner block of the current maximum coding unit is the starting node of the linked list. When performing an intra-block copy hash value search on each current block, the stored current block is directly used to start the search at the address of the hash index linked list node.
[0131] In the embodiment of the present disclosure, an IBC hash table of the current LCU can be constructed. When the IBC hash table of the current LCU is updated, the address of each candidate reference block can be stored in the node of the linked list corresponding to the IBC hash table. For example, the address of each candidate reference block can include the coordinates of the upper left corner pixel of each candidate reference block in the current LCU, but the present disclosure is not limited to this. In this way, when performing an IBC hash search on each current block, the addresses of each stored candidate reference block can be directly used to start the IBC hash search of the current block, which can reduce the number of invalid nodes of the linked list in the IBC hash table as much as possible, thereby improving the encoding speed of the IBC module without reducing the video quality.
[0132] In step S340, at least part of the invalid nodes in the target linked list are excluded according to the address of the current block in the current maximum coding unit, and the remaining nodes in the target linked list are obtained, wherein the invalid nodes correspond to candidate reference blocks in the uncoded area of the current maximum coding unit.
[0133] In an exemplary embodiment, excluding at least some of the invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit may include: obtaining the address of the node in the target linked list in the current maximum coding unit; excluding the node whose address's ordinate is greater than the ordinate of the address of the current block in the target linked list as the at least some of the invalid nodes. For example, refer to the following Figure 4 and 5 .
[0134] In an exemplary embodiment, excluding at least some invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit may further include: excluding nodes whose ordinates of the addresses of the nodes in the target linked list are equal to the ordinates of the addresses of the current block and whose abscissas of the addresses of the nodes in the target linked list are greater than the abscissas of the addresses of the current block, and treating them as the at least some invalid nodes. For example, the following may be referred to: Figure 4 and 5 .
[0135] In step S350, a matching reference block of the current block is searched from the remaining nodes to perform intra block copy encoding on the current block.
[0136] For example, the position of the matching reference block of the current block may be found in the remaining nodes through SAD (Sum of absolute differences).
[0137] The improved video encoding method of the disclosed embodiment directly uses the address of each current block in its corresponding current maximum coding unit to exclude at least part of the invalid nodes in the target linked list in the IBC hash table of the corresponding current maximum coding unit when performing IBC hash search on each current block. When performing IBC encoding on the current block, it is only necessary to search for the matching reference block of the current block in the remaining nodes of the target linked list after excluding the at least part of the invalid nodes. On the one hand, the number of invalid nodes in the target linked list in the IBC hash table can be reduced, thereby improving the IBC encoding speed and encoding efficiency without reducing the video quality. On the other hand, less computing resources can be consumed, and the encoding complexity can be reduced while ensuring that the video RD quality remains unchanged.
[0138] Figure 4 Taking the current LCU size of 64x64, which is divided into 64 8x8 CUs as an example, the video encoding method provided by the embodiment of the present disclosure is illustrated to explain the fast addressing method of IBC Hash search.
[0139] In HEVC SCC, each video frame consists of multiple LCUs. Before encoding an LCU, the IBC hash table will update the IBC hash table in a left-to-right and top-to-bottom order based on the 8x8 block position information of all possible reference positions in the LCU area, so that the number of nodes in the hash one-way linked list corresponding to each hash index value in the IBC hash table increases, and the coordinates of the starting nodes of each one-way linked list may point to the lower right corner of the corresponding LCU.
[0140] For example, when Figure 4 When a black 8x8 CU (current block) in an LCU shown in the figure is subjected to IBC encoding, its hash value can be calculated first, and the hash value of the current block is used as a hash index to find a target linked list with the same hash index value in the IBC hash table.
[0141] exist Figure 4 It can be found that when the black 8x8 current block is IBC encoded, most of the positions corresponding to the nodes in the linked list in the IBCash table after the current LCU expansion have not been encoded, and are in the invalid hash table range, as shown by the thin dotted arrow. The valid hash table range in the valid encoded area is shown by the thin solid arrow, that is, the encoded area in the thick solid frame.
[0142] Then the target linked list corresponding to the hash value of the black 8x8 current block, the path in the uncoded area (invalid hash search path) is represented by a thick dotted line. It can be found that its starting node is located in the last row of the current LCU 8x8 block, and the subsequent nodes of the target linked list can be obtained in sequence, gradually pointing to the black 8x8 current block from the last row. It can be found that at least 6 nodes of the target linked list must be analyzed to find the address of the 8x8 current block in the target linked list. The process of analyzing these 6 nodes is completely unnecessary, and they are all serial judgment processing, which will bring more computing load to the processor.
[0143] By using the method provided by the embodiment of the present disclosure, when the nodes of the linked list in the IBC hash table are expanded in the current LCU, the address corresponding to each 8x8 block is stored in each node of the linked list in the IBC hash table. Then, for the 8x8 current block to be encoded, the node corresponding to the valid candidate reference block can be directly found through the address of the node of the target linked list stored in the IBC hash table, and may also include a small number of nodes corresponding to invalid candidate reference blocks, thereby avoiding unnecessary node analysis.
[0144] like Figure 4 As shown, the address of the black current block may be the coordinate (8, 16) of its upper left corner relative to the origin O, where it is assumed that the horizontal rightward direction is the positive direction of the abscissa (X axis) and the vertical downward direction is the ordinate (Y axis). The coordinates of each block in the current LCU may be determined similarly.
[0145] for Figure 4The 8x8 block located in the third row and second column can be removed from the fourth row (the vertical coordinates are all 24, which is greater than the vertical coordinate 16 of the current block) to the eighth row (the vertical coordinates are all 56, which is greater than the vertical coordinate 16 of the current block) in the corresponding IBC hash target linked list by the method provided by the embodiment of the present disclosure, and the right node of the third row and second column (whose vertical coordinate is 16, equal to the vertical coordinate of the current block; its horizontal coordinate is greater than or equal to 16, that is, its horizontal coordinate is greater than the horizontal coordinate of the current block) can also be removed. Therefore, the corresponding target linked list has only three nodes corresponding to the current LCU, including two valid candidate reference blocks (encoded, (connected in series by a valid Hash search path) and one invalid candidate reference block (unencoded, connected in series by an invalid Hash search path). Therefore, the method provided by the embodiment of the present disclosure can reduce the number of invalid nodes in the IBC hash linked list in the current LCU, thereby improving the encoding speed of the IBC module without reducing the IBC RD compression quality.
[0146] For example, Figure 5 As shown, in the embodiment of the present disclosure, it is still assumed that the size of an LCU is 64x64 (but the present disclosure is not limited to this, it is only used for illustration, for example, it can also be 128x128, 256x128, etc.), first divided into four 32x32 blocks, and the four 32x32 blocks are encoded in order from left to right and from top to bottom; then each 32x32 block is divided into four 16x16 blocks, similarly, in each 32x32 block, each 16x16 block is encoded in order from left to right and from top to bottom; then each 16x16 block is divided into four 8x8 blocks, similarly, in each 16x16 block, each 8x8 block is encoded in order from left to right and from top to bottom.
[0147] Continue to refer Figure 5 Here, it is assumed that the first 16x16 block in the upper left corner includes four 8x8 blocks numbered 0, 1, 2, and 3 from left to right and from top to bottom. The block numbered 0 is encoded first, then the block numbered 1, then the block numbered 2, and then the block numbered 3. The encoding order or scanning order of subsequent blocks is similar to this.
[0148] Among them, when encoding the block numbered 1, the blocks numbered 2 and 3 have not been encoded yet. Based on the fact that the vertical coordinate 0 of the block numbered 1 is smaller than the vertical coordinate 8 of the blocks numbered 2 and 3, the blocks numbered 2 and 3 can be excluded as invalid subsequent reference blocks or invalid nodes.
[0149] It should be noted that the size of each maximum coding unit, the size and number of blocks divided into each maximum coding unit, and the determination of the position or coordinates of each block are not limited to the above examples.
[0150] After testing, it can be seen that when the SCC YUV420 encoder is in the All intra (full frame) single-thread mode, after adopting the method provided by the embodiment of the present disclosure, the encoding complexity is reduced by 2.38% while the video RD quality remains unchanged; when the SCC YUV420 encoder is in the All intra (full frame) single-thread mode, after adopting the method provided by the embodiment of the present disclosure, the encoding complexity is reduced by 9.53% while the video RD quality remains unchanged.
[0151] The video encoding method provided by the embodiment of the present disclosure stores the address of each subsequent reference block CU in the node of the linked list corresponding to the hash index when updating the IBC hash table of the current LCU, so that when performing an IBC hash search on each current block to be encoded, the address of the node of the stored target linked list and the address of the current block can be directly used to start the IBC hash search, so that the number of invalid nodes starting from the end of the current LCU in the target linked list in the parsed IBC hash table can be reduced as much as possible, so as to quickly enter the valid node area to improve the speed of the IBC hash search, and improve the encoding speed of the IBC module without reducing the video quality.
[0152] The video encoding method provided by the embodiment of the present disclosure can be used in a HEVC SCC encoder whose input source data is in a format such as YUV420 / 422 / 444, etc. It can be applied to various application scenarios such as video conferencing and online games.
[0153] Furthermore, the embodiment of the present disclosure also provides a video encoding device 600, which may include: a video acquisition unit 610 to be encoded, a coding block information acquisition unit 620, a coding block linked list determination unit 630, a coding invalid block exclusion unit 640 and an intra-frame block copy coding unit 650.
[0154] The to-be-encoded video acquisition unit 610 may be used to acquire a current to-be-encoded video, where the current to-be-encoded video includes a current image, the current image includes a current maximum coding unit, and the current maximum coding unit includes a current block.
[0155] The coding block information acquisition unit 620 may be configured to acquire a hash value of the current block and an address of the current block within the current maximum coding unit.
[0156] The coding block linked list determination unit 630 may be configured to determine, from the intra-block copy hash table of the current maximum coding unit, a target linked list whose hash index value matches the hash value of the current block.
[0157] The coding invalid block exclusion unit 640 can be used to exclude at least part of the invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit, and obtain the remaining nodes in the target linked list, wherein the invalid nodes correspond to candidate reference blocks in the uncoded area of the current maximum coding unit.
[0158] The intra block copy encoding unit 650 may be configured to search for a matching reference block of the current block from the remaining nodes to perform intra block copy encoding on the current block.
[0159] In an exemplary embodiment, the video encoding device 600 may further include: a candidate reference block address acquisition unit, which can be used to sequentially acquire the hash values of the candidate reference blocks in the current maximum coding unit and their addresses in the current maximum coding unit according to a scanning order; a candidate reference block node generation unit, which can be used to insert the candidate reference block into a linked list corresponding to the intra-frame block copy hash table according to the hash value of the candidate reference block as a node in the corresponding linked list; a candidate reference block address storage unit, which can be used to store the address of the candidate reference block in the current maximum coding unit in the corresponding node in the linked list.
[0160] In an exemplary embodiment, the scanning order may be a scanning order from left to right and from top to bottom according to the way in which the current maximum coding unit is divided into blocks.
[0161] In an exemplary embodiment, the address of the current block within the current maximum coding unit may be the coordinates of the upper left corner pixel of the current block within the current maximum coding unit, and the address of the candidate reference block within the current maximum coding unit may be the coordinates of the upper left corner pixel of the candidate reference block within the current maximum coding unit.
[0162] In an exemplary embodiment, the coding invalid block exclusion unit 640 may include: a node address acquisition unit, which can be used to obtain the address of the node in the target linked list within the current maximum coding unit; a first node exclusion unit, which can be used to exclude the node whose vertical coordinate of the address of the node in the target linked list is greater than the vertical coordinate of the address of the current block, and treat it as the at least partially invalid node.
[0163] In an exemplary embodiment, the encoding invalid block exclusion unit 640 may also include: a second node exclusion unit, which can be used to exclude nodes whose vertical coordinates of the addresses of the nodes in the target linked list are equal to the vertical coordinates of the addresses of the current block, and whose horizontal coordinates of the addresses of the nodes in the target linked list are greater than the horizontal coordinates of the addresses of the current block, and treat them as the at least partially invalid nodes.
[0164] In an exemplary embodiment, the nodes in the linked list in the intra block copy hash table may be first-in-last-out.
[0165] In an exemplary embodiment, the lower right corner block of the current maximum coding unit is the starting node of the linked list. When performing an intra-block copy hash value search on each current block, the stored current block is directly used to start the search at the address of the hash index linked list node.
[0166] The specific implementation of each unit in the video encoding device provided by the embodiment of the present disclosure can refer to the content of the above-mentioned video encoding method, which will not be repeated here.
[0167] It should be noted that although several units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0168] The embodiments of the present disclosure provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the video encoding method described in the above embodiments is implemented.
[0169] An embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a storage device configured to store at least one program, so that when the at least one program is executed by the at least one processor, the at least one processor implements the video encoding method as described in the above embodiment.
[0170] Figure 7 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown.
[0171] It should be noted that Figure 7 The electronic device 700 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure. The electronic device 700 can be any terminal device and / or server.
[0172] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0173] like Figure 7 As shown, electronic device 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703. In RAM 703, various programs and data required for system operation are also stored. CPU 701, ROM 702 and RAM 703 are connected to each other through bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0174] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0175] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the method and / or device of the present application are executed.
[0176] It should be noted that the computer-readable storage medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with at least one wire, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM (Erasable Programmable Read Only Memory, Erasable Programmable Read Only Memory) 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 above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
[0177] The flowchart and block diagram in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the method, device and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains at least one executable instruction for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0178] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0179] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment. For example, the electronic device may implement the following Figure 3 The steps shown.
[0180] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations provided in the above embodiments.
[0181] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0182] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0183] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A video encoding method, characterized in that: include: Acquire a current video to be encoded, wherein the current video to be encoded includes a current image, the current image includes a current maximum coding unit, and the current maximum coding unit includes a current block; Obtaining a hash value of the current block and an address of the current block in the current maximum coding unit; Determine, from the intra-block copy hash table of the current maximum coding unit, a target linked list whose hash index value matches the hash value of the current block; Eliminate at least part of invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit, and obtain remaining nodes in the target linked list, wherein the invalid nodes correspond to candidate reference blocks in an uncoded area of the current maximum coding unit; Searching for a matching reference block of the current block from the remaining nodes to perform intra-block copy encoding on the current block; Wherein, excluding at least part of the invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit includes: Obtaining the address of the node in the target linked list within the current maximum coding unit; Nodes in the target linked list whose addresses have ordinates greater than the ordinates of the addresses of the current block are excluded and regarded as the at least partially invalid nodes.
2. The video encoding method according to claim 1, characterized in that: Also includes: Obtaining, in sequence according to a scanning order, hash values of candidate reference blocks in the current maximum coding unit and addresses thereof in the current maximum coding unit; According to the hash value of the candidate reference block, insert the candidate reference block into the linked list corresponding to the intra block copy hash table as a node in the corresponding linked list; The corresponding node in the linked list stores the address of the candidate reference block within the current maximum coding unit.
3. The video encoding method according to claim 2, characterized in that: The scanning order is a scanning order from left to right and from top to bottom according to the way in which the current maximum coding unit is divided into blocks.
4. The video encoding method according to claim 3, characterized in that: The address of the current block in the current maximum coding unit is the coordinate of the upper left corner pixel of the current block in the current maximum coding unit, and the address of the candidate reference block in the current maximum coding unit is the coordinate of the upper left corner pixel of the candidate reference block in the current maximum coding unit.
5. The video encoding method according to any one of claims 1 to 4, characterized in that: Excluding at least part of the invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit, further comprising: Exclude nodes whose ordinates of addresses of nodes in the target linked list are equal to the ordinates of addresses of the current block and whose abscissas of addresses of nodes in the target linked list are greater than the abscissas of addresses of the current block, and treat them as at least partially invalid nodes.
6. The video encoding method according to claim 1, characterized in that: The nodes in the linked list in the intra-block copy hash table are first-in-last-out.
7. The video encoding method according to claim 6, characterized in that: The lower right corner block of the current maximum coding unit is the starting node of the linked list. When performing an intra-block copy hash value search on each current block, the stored address of the hash index linked list node is directly used to start the search.
8. A video encoding device, characterized in that: include: A to-be-encoded video acquisition unit, configured to acquire a current to-be-encoded video, wherein the current to-be-encoded video includes a current image, the current image includes a current maximum coding unit, and the current maximum coding unit includes a current block; A coding block information acquisition unit, used to acquire a hash value of the current block and an address of the current block in the current maximum coding unit; A coding block linked list determining unit, configured to determine a target linked list whose hash index value matches the hash value of the current block from the intra-block copy hash table of the current maximum coding unit; a coding invalid block exclusion unit, configured to exclude at least part of invalid nodes in the target linked list according to the address of the current block in the current maximum coding unit, and obtain remaining nodes in the target linked list, wherein the invalid nodes correspond to candidate reference blocks in an uncoded area of the current maximum coding unit; an intra-block copy encoding unit, configured to search for a matching reference block of the current block from the remaining nodes, so as to perform intra-block copy encoding on the current block; Wherein, the coding invalid block exclusion unit includes: A node address acquisition unit, used to acquire the address of the node in the target linked list within the current maximum coding unit; The first node exclusion unit is used to exclude the nodes in the target linked list whose addresses have vertical coordinates greater than the vertical coordinates of the addresses of the current block, and treat them as the at least partially invalid nodes.
9. The video encoding device according to claim 8, characterized in that: Also includes: A candidate reference block address acquisition unit, configured to sequentially acquire hash values of candidate reference blocks in the current maximum coding unit and addresses thereof in the current maximum coding unit according to a scanning order; a candidate reference block node generating unit, configured to insert the candidate reference block into a linked list corresponding to the intra block copy hash table as a node in the corresponding linked list according to a hash value of the candidate reference block; The candidate reference block address storage unit is used to store the address of the candidate reference block in the current maximum coding unit in the corresponding node in the linked list.
10. The video encoding device according to claim 9, characterized in that: The scanning order is a scanning order from left to right and from top to bottom according to the way in which the current maximum coding unit is divided into blocks.
11. The video encoding device according to claim 10, characterized in that: The address of the current block in the current maximum coding unit is the coordinate of the upper left corner pixel of the current block in the current maximum coding unit, and the address of the candidate reference block in the current maximum coding unit is the coordinate of the upper left corner pixel of the candidate reference block in the current maximum coding unit.
12. The video encoding device according to any one of claims 8 to 11, characterized in that: The coding invalid block exclusion unit also includes: The second node exclusion unit is used to exclude the nodes whose vertical coordinates of the addresses of the nodes in the target linked list are equal to the vertical coordinates of the addresses of the current block and whose horizontal coordinates of the addresses of the nodes in the target linked list are greater than the horizontal coordinates of the addresses of the current block, and to exclude them as the at least partially invalid nodes.
13. The video encoding device according to claim 8, characterized in that The nodes in the linked list in the intra-block copy hash table are first-in-last-out.
14. The video encoding device according to claim 13, characterized in that: The lower right corner block of the current maximum coding unit is the starting node of the linked list. When performing an intra-block copy hash value search on each current block, the stored address of the hash index linked list node is directly used to start the search.
15. An electronic device, characterized in that: include: at least one processor; A storage device configured to store at least one program, when the at least one program is executed by the at least one processor, enables the at least one processor to implement the video encoding method according to any one of claims 1 to 7.
16. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the video encoding method according to any one of claims 1 to 7 is implemented.
17. A computer program product, comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for executing the video encoding method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Matching coding method using Hash search
CN110287149A