Encoding method, encoder and electronic equipment

CN121128169APending Publication Date: 2025-12-12GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380097082.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing digital video compression technologies still have bandwidth and traffic pressures in transmission and storage, especially in the context of Internet video, and it is difficult to meet the needs of high video clarity.

Method used

By introducing a search mechanism for the same-site location in the encoder, screening with the initial location, the motion estimation parameters are optimized, thereby improving coding performance and motion estimation effect. The specific method includes determining the location of the same site within the initial macropixel, further determining the search location therein, and performing a local grid search within the search area to correct the motion parameters.

Benefits of technology

The motion estimation accuracy and encoding performance of the encoder are improved, especially when processing light field video, the correlation of the light field image is better utilized, and the compression efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121128169A_ABST
    Figure CN121128169A_ABST
Patent Text Reader

Abstract

The invention provides a coding method, a coder and electronic equipment, and the method comprises the steps: carrying out the motion estimation of a current block in a current image, and determining a first motion parameter; the first motion parameter points to an initial position in a reference image of the current image; the initial position is located in an initial macro pixel of the reference image; determining at least one co-location point position of the initial position based on the position of the initial position in the initial macro pixel; determining at least one search position in the initial position and the at least one co-location point position; determining at least one first position except any one search position in a first search area where any one search position in the at least one search position is located; a second motion parameter of the reference block is determined based on the at least one search position and the at least one first position. According to the method, the motion estimation effect and the coding performance of the encoder can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Coding method, encoder, and electronic device Technical Field

[0001] The embodiments of the present application relate to the field of coding and decoding technology, and more specifically, to a coding method, an encoder, and an electronic device. Background Art

[0002] Digital video compression technology mainly compresses huge digital image video data for easy transmission and storage.

[0003] With the surge in Internet videos and people's increasing demand for video clarity, although existing digital video compression standards can save a lot of video data, there is still a need to pursue better digital video compression technology to reduce the bandwidth and traffic pressure of digital video transmission.

[0004] Summary of the Invention

[0005] The present application provides a coding method, an encoder, and an electronic device, which can improve the motion estimation effect and coding performance of the encoder.

[0006] In a first aspect, the present application provides an encoding method, comprising:

[0007] Performing motion estimation on a current block in a current image to determine a first motion parameter of the current block, wherein the first motion parameter points to an initial position in a reference image of the current image, and the initial position is located within an initial macropixel of the reference image;

[0008] determining at least one co-located position of the initial position based on the position of the initial position within the initial macropixel;

[0009] determining at least one search position among the initial position and the at least one co-located position;

[0010] Determine at least one first position other than any one of the at least one search position within a first search area where the at least one search position is located, wherein the first search area is smaller than or equal to the macropixel where the at least one search position is located;

[0011] Based on the at least one search position and the at least one first position, a second motion parameter of the reference block is determined.

[0012] In a second aspect, the present application provides an encoder, comprising:

[0013] an estimating unit, configured to perform motion estimation on a current block in a current image and determine a first motion parameter of the current block; the first motion parameter points to an initial position in a reference image of the current image; the initial position is located within an initial macropixel of the reference image;

[0014] Identify units for:

[0015] determining at least one co-located position of the initial position based on the position of the initial position within the initial macropixel;

[0016] determining at least one search position among the initial position and the at least one co-located position;

[0017] Determine at least one first position other than any one of the at least one search position within a first search area where the at least one search position is located, wherein the first search area is smaller than or equal to the macropixel where the at least one search position is located;

[0018] Based on the at least one search position and the at least one first position, a second motion parameter of the reference block is determined.

[0019] In a third aspect, the present application provides an encoder, comprising:

[0020] a processor adapted to implement computer instructions; and,

[0021] A computer-readable storage medium stores computer instructions, wherein the computer instructions are suitable for being loaded by a processor and executing the encoding method in the second aspect or its various implementations mentioned above.

[0022] In one implementation, there are one or more processors and one or more memories.

[0023] In one implementation, the computer-readable storage medium may be integrated with the processor, or the computer-readable storage medium may be provided separately from the processor.

[0024] In a fourth aspect, the present application provides a computer-readable storage medium storing computer instructions. When the computer instructions are read and executed by a processor of a computer device, the computer device executes the encoding method involved in the first aspect mentioned above.

[0025] In a fifth aspect, the present application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the encoding method of the first aspect mentioned above.

[0026] In a sixth aspect, the present application provides a code stream, which is generated by the method described in the first aspect above.

[0027] Based on the above technical solution, for the encoding method provided in the embodiment of the present application, the encoder takes the position pointed to by the first motion parameter determined by motion estimation as the initial position, and then determines at least one search position in the initial position and at least one co-location position of the initial position, and then determines at least one first position other than the any one search position in the first search area where any one of the at least one search position is located, and then determines the second motion parameter of the reference block based on the at least one search position and the at least one first position; this is equivalent to introducing the at least one co-location position, combining the initial position for screening to obtain the at least one search position, and then correcting the first motion parameter based on the at least one search position and at least one first position determined in the first search area where any one of the at least one search position is located, and obtaining the corrected second motion parameter, which can improve the accuracy of the second motion parameter, and thus improve the motion estimation effect and encoding performance of the encoder. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] FIG1 is a schematic block diagram of a coding and decoding system provided in an embodiment of the present application.

[0029] FIG2 is a schematic block diagram of an encoder provided in an embodiment of the present application.

[0030] FIG3 is a schematic structural diagram of the relationship between a coding tree unit and a coding unit provided in an embodiment of the present application.

[0031] FIG4 is a schematic block diagram of a decoder provided in an embodiment of the present application.

[0032] FIG5 is an example of a light field video transmission process provided by an embodiment of the present application.

[0033] FIG6 is an example of the initial position and the co-location position provided in an embodiment of the present application.

[0034] FIG. 7 is an example of a light field image provided by an embodiment of the present application.

[0035] FIG8 is a schematic flowchart of the encoding method provided in an embodiment of the present application.

[0036] FIG9 is an example of a search principle for at least one first position provided in an embodiment of the present application.

[0037] FIG10 is an example of the co-location provided in an embodiment of the present application.

[0038] FIG11 is an example of at least one search location provided in an embodiment of the present application.

[0039] FIG12 is another example of at least one search location provided by an embodiment of the present application.

[0040] FIG13 is a schematic block diagram of an encoder provided in an embodiment of the present application.

[0041] FIG14 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0043] It should be noted that the terms used in the implementation method part of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0044] For example, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The term "at least one" is only a description of the combination relationship of enumerated objects, indicating that one or more items may exist. For example, at least one of the following: A, B, C can mean the following combinations: A exists alone, B exists alone, C exists alone, A and B exist at the same time, A and C exist at the same time, B and C exist at the same time, and A, B, and C exist at the same time. The term "multiple" refers to two or more. The character " / " generally indicates that the related objects before and after are in an "or" relationship.

[0045] For another example, the term "corresponding" may indicate that there is a direct or indirect correspondence between the two, or that there is an association relationship between the two, or a relationship between indication and being indicated, configuration and being configured, etc. The term "indication" may be a direct indication, an indirect indication, or an indication of an association relationship. For example, A indicates B, which may mean that A directly indicates B, for example, B can be obtained through A; it may also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it may also mean that there is an association relationship between A and B. The term "predefined" or "preconfigured" may refer to the pre-storage of corresponding codes, tables or other relevant information that can be used for indication in a device (for example, including an encoder or decoder), or it may refer to an agreement agreed upon by a protocol. "Protocol" may refer to any standard protocol in the field of encoding and decoding, and this application does not limit this. The term "when..." may be interpreted as "if" or "if" or "when..." or "in response to" and similar descriptions. Similarly, depending on the context, the phrase "if determined" or "if (stated condition or event) is detected" can be interpreted as "when determined" or "in response to determining" or "when (stated condition or event) is detected" or "in response to detecting (stated condition or event)" and similar descriptions. The terms "first", "second", "third", "fourth", "Ath", "Bth" and the like are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. Among them, digital video compression technology is mainly used to compress huge digital image video data for easy transmission and storage.

[0046] The solution provided by the embodiment of the present application can be applied to the field of digital compression technology.

[0047] For example, the solution provided in the embodiments of the present application can be applied in the field of video coding technology.

[0048] Among them, the field of video coding technology includes but is not limited to at least one of the following: image coding and decoding field, video coding and decoding field, hardware video coding and decoding field, dedicated circuit video coding and decoding field and real-time video coding and decoding field. In addition, the solution provided in the embodiment of the present application can be combined with the following standards: Audio Video Coding Standard (AVS), second-generation AVS standard (AVS2) or third-generation AVS standard (AVS3). For example, including but not limited to: H.264 / Audio Video Coding (AVC) standard, H.265 / High Efficiency Video Coding (HEVC) standard and H.266 / Versatile Video Coding (VVC) standard. In addition, the solution provided in the embodiment of the present application can be used for lossy compression of images, and can also be used for lossless compression of images. Among them, the lossless compression can be visually lossless compression or mathematically lossless compression.

[0049] The video coding standard may adopt a block-based hybrid coding framework.

[0050] The hybrid coding framework includes modules such as prediction, transform, quantization, entropy coding, and in-loop filtering. The prediction module includes intra-frame prediction and / or inter-frame prediction. Because adjacent pixels within a video frame are strongly correlated, intra-frame prediction is used in video coding and decoding to eliminate spatial redundancy between adjacent pixels. Intra-frame prediction only references information from the same frame to predict pixel information within the current block. Because adjacent frames in a video have strong similarities, inter-frame prediction is used in video coding and decoding to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency. Inter-frame prediction includes motion estimation and motion compensation. Inter-frame prediction references image information from different frames and uses motion estimation to search for the motion vector information that best matches the current block. Transformation converts the predicted image block to the frequency domain, redistributing the energy. Combined with quantization, it removes information that is insensitive to the human eye, eliminating visual redundancy. Entropy coding eliminates character redundancy based on the current context model and the probabilistic information of the binary bitstream.

[0051] The basic process of the video encoder is as follows:

[0052] The encoder first divides a frame of image into blocks; then predicts the current block in the current image to obtain the predicted block of the current block; then subtracts the predicted block from the original block of the current block to obtain the residual block; transforms and quantizes the residual block to obtain a quantization coefficient matrix; then entropy codes the quantization coefficient matrix to obtain the output bitstream.

[0053] The basic process of the video decoder is as follows:

[0054] The decoder predicts the current block to obtain a predicted block. It also parses the bitstream to obtain a quantization coefficient matrix, which it then dequantizes and inversely transforms to produce a residual block. The predicted and residual blocks are then combined to form a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to produce the decoded image.

[0055] It is worth noting that the current block may be a current coding unit (CU) or a current prediction unit (PU), etc.

[0056] In addition, the encoder also needs to perform similar operations as the decoder to obtain a decoded image. The decoded image can be a reference frame for inter-frame prediction for subsequent frames. The block division information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information determined by the encoder need to be written into the bitstream if necessary. The decoder determines the same block division information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information as the encoder by parsing and analyzing the existing information, thereby ensuring that the decoded image obtained by the encoder and the decoder are the same. The decoded image obtained by the encoder is also usually called a reconstructed image. The codec can divide the current block into prediction units during prediction and into transformation units during transformation. The division of prediction units and transformation units can be different. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized, and this application does not make specific restrictions on this.

[0057] For ease of understanding, the video encoding and decoding system involved in the embodiment of the present application is first introduced with reference to FIG1 .

[0058] FIG1 is a schematic block diagram of a coding and decoding system involved in an embodiment of the present application.

[0059] As shown in FIG1 , the encoding and decoding system 100 includes an encoding device 110 and a decoding device 120 .

[0060] The encoding device 110 is used to encode (which can be understood as compressing) video or image data to generate a code stream, and transmit the code stream to the decoding device 120. The decoding device 120 decodes the code stream generated by the encoding device 110 to obtain decoded video or image data.

[0061] The encoding device 110 can be understood as a device capable of encoding a video or image, and the decoding device 120 can be understood as a device capable of decoding a video or image. The encoding device 110 can modulate the encoded data according to a communication standard and transmit the modulated data to the decoding device 120. The encoding device 110 or the decoding device 120 includes a wider range of devices, such as smartphones, desktop computers, mobile computing devices, notebook computers (e.g., laptops), tablet computers, set-top boxes, televisions, cameras, display devices, digital media players, video game consoles, and in-vehicle computers.

[0062] The encoding device 110 may transmit the encoded data (eg, a code stream) to the decoding device 120 via the channel 130 .

[0063] Channel 130 may include one or more media and / or devices capable of transmitting encoded data from encoding device 110 to decoding device 120. Channel 130 may include one or more communication media that enable encoding device 110 to transmit encoded data directly to decoding device 120 in real time. Communication media may include wireless communication media, such as radio frequency spectrum. Communication media may also include wired communication media, such as one or more physical transmission lines. Channel 130 may include a storage medium that can store data encoded by encoding device 110. Storage media include various locally accessible data storage media, such as optical disks, DVDs, and flash memory. Decoding device 120 may retrieve the encoded data from the storage medium. Channel 130 may also include a storage server that can store the data encoded by encoding device 110. Decoding device 120 may download the stored encoded data from the storage server. Alternatively, the storage server may store the encoded data and transmit it to decoding device 120, such as a web server (e.g., for a website) or a File Transfer Protocol (FTP) server.

[0064] The encoding device 110 includes an encoder 112 and an output interface 113 .

[0065] The output interface 113 may include a modulator / demodulator (modem) and / or a transmitter. The encoder 112 transmits the encoded data directly to the decoding device 120 via the output interface 113. The encoded data may also be stored on a storage medium or storage server for subsequent reading by the decoding device 120.

[0066] In addition to the encoder 112 and the input interface 113 , the encoding device 110 may also include a video source 111 or an image source.

[0067] Video source 111 may include at least one of a video capture device (e.g., a video camera), a video archive, a video input interface, and a computer graphics system. The video input interface is used to receive video data from a video content provider, and the computer graphics system is used to generate video data. Encoder 112 encodes the video data from video source 111 to generate a bitstream. The video data may include one or more pictures or a sequence of pictures. The bitstream contains encoding information for the picture or picture sequence in the form of a bitstream. The encoding information may include the encoded picture data and associated data. The associated data may include a sequence parameter set (SPS), a picture parameter set (PPS), and other syntax structures. An SPS may contain parameters applicable to one or more sequences. A PPS may contain parameters applicable to one or more pictures. A syntax structure is a set of zero or more syntax elements arranged in a specified order within the bitstream.

[0068] The decoding device 120 includes an input interface 121 and a decoder 122. The input interface 121 may include a receiver and / or a modem.

[0069] The decoding device 120 may include a display device 123 in addition to the input interface 121 and the decoder 122 .

[0070] The input interface 121 can receive the encoded data via the channel 130. The decoder 122 is configured to decode the encoded data to obtain decoded data and transmit the decoded data to the display device 123. The display device 123 displays the decoded data. The display device 123 can be integrated with the decoding device 120 or external to the decoding device 120. The display device 123 can include various display devices, such as a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or other types of display devices.

[0071] It should be understood that Figure 1 is only an example of the present application and should not be understood as a display of the present application. That is to say, the technical solution of the embodiment of the present application is not limited to the system framework shown in Figure 1. For example, the technology of the present application can also be applied to unilateral video encoding or unilateral video decoding.

[0072] The following is an introduction to the video encoding framework involved in the embodiments of the present application.

[0073] FIG2 is a schematic block diagram of a video encoder 200 according to an embodiment of the present application.

[0074] It should be understood that the video encoder 200 can be applied to image data in luminance and chrominance (YCbCr, YUV) format. For example, the YUV ratio can be 4:2:0, 4:2:2, or 4:4:4, where Y represents brightness (Luma), Cb (U) represents blue chrominance, Cr (V) represents red chrominance, and U and V represent chrominance (Chroma) used to describe color and saturation. For example, in terms of color format, 4:2:0 means that every 4 pixels have 4 luminance components and 2 chrominance components (YYYYCbCr), 4:2:2 means that every 4 pixels have 4 luminance components and 4 chrominance components (YYYYCbCrCbCr), and 4:4:4 represents full pixel display (YYYYCbCrCbCrCbCrCbCr). Of course, it can also be applied to image data in red-green-blue (RGB) format, but this application does not specifically limit this.

[0075] After the video encoder 200 reads the video stream, it can divide each frame of the video stream into several coding tree units (CTUs). In some examples, CTUs may be referred to as "tree blocks", "largest coding units" (LCUs) or "coding tree blocks" (CTBs). Each CTU can be associated with a pixel block of equal size within the image. Each pixel can correspond to one luminance (luminance or luma) sample and two chrominance (chroma) samples. Therefore, each CTU can be associated with one luminance sample block and two chrominance sample blocks. The size of a CTU can be, for example, 128×128, 64×64, 32×32, etc. Figure 3 is a schematic structural diagram of the relationship between the coding tree unit and the coding unit provided in an embodiment of the present application. As shown in Figure 3, a CTU can be further divided into several coding units (CUs) for encoding, and the CU can be a rectangular block or a square block. A CU can be further divided into prediction units (PUs) and transform units (TUs), allowing for separation of coding, prediction, and transform, and greater flexibility in processing. In one example, a CTU is divided into CUs using a tree (e.g., a quadtree), and a CU is divided into TUs and PUs using a tree (e.g., a quadtree).

[0076] The video encoder and video decoder can support various PU sizes.

[0077] Assuming that the size of a particular CU is 2N×2N, the video encoder and video decoder may support PU sizes of 2N×2N or N×N for intra prediction, and support symmetric PUs of 2N×2N, 2N×N, N×2N, N×N, or similar sizes for inter prediction. The video encoder and video decoder may also support asymmetric PUs of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.

[0078] As shown in Figure 2, the video encoder 200 may include: a prediction unit 210, a residual unit 220, a transform / quantization unit 230, an inverse transform / quantization unit 240, a reconstruction unit 250, a loop filter unit 260, a decoded image buffer 270, and an entropy coding unit 280. It should be noted that the video encoder 200 may include more, fewer, or different functional components. In this application, the current block may be referred to as the current coding unit (CU) or the current prediction unit (PU), etc. The prediction block may also be referred to as a predicted image block or an image prediction block, and the reconstructed image block may also be referred to as a reconstructed block or an image reconstructed image block.

[0079] The prediction unit 210 includes an inter-frame prediction unit 211 and an intra-frame prediction unit 212. Because there is a strong correlation between adjacent pixels in a video image, intra-frame prediction is used in video coding and decoding to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent images in a video, inter-frame prediction is used to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0080] The inter-frame prediction unit 211 is capable of inter-frame prediction, which includes motion estimation and motion compensation. It can reference image information from different frames. Inter-frame prediction uses motion information to find a reference block from a reference frame and then generates a prediction block based on the reference block to eliminate temporal redundancy. The reference frame can be a P-frame and / or a B-frame. P-frames refer to forward-predicted frames, and B-frames refer to bidirectionally predicted frames. Inter-frame prediction uses motion information to find a reference block and then generates a prediction block based on the reference block. Motion information includes the frame list to which the reference frame belongs, the frame index, and the motion vector. The motion vector can be integer-pixel or fractional-pixel. If the motion vector is fractional-pixel, interpolation filtering is used in the reference frame to generate the required fractional-pixel block. The reference block is the integer-pixel or fractional-pixel block found based on the motion vector. Some technologies directly use the reference block as the prediction block, while others further process the reference block to generate a prediction block. Reprocessing a reference block to generate a prediction block can also be understood as using the reference block as the prediction block and then processing the prediction block to generate a new prediction block.

[0081] The intra-frame prediction unit 212 only refers to the information of the same frame image to predict the pixel information in the current code image block to eliminate spatial redundancy. The reference frame used for intra-frame prediction can be an I frame.

[0082] Intra-frame prediction uses multiple prediction modes. Both angular and non-angular prediction modes can be used to predict the image block to be coded, yielding a prediction block. Based on the rate-distortion information calculated from the prediction block and the image block to be coded, the optimal prediction mode for the image block to be coded is selected and written into the bitstream for transmission to the decoder. The decoder parses the prediction mode, predicts the predicted block for the target decoding block, and overlays it with the time-domain residual block obtained from the bitstream to reconstruct the block.

[0083] Taking the H series of international digital video coding standards as an example, the H.264 / AVC standard has 8 angle prediction modes and 1 non-angle prediction mode, and H.265 / HEVC is expanded to 33 angle prediction modes and 2 non-angle prediction modes. The intra-frame prediction modes used by HEVC are planar mode, direct current (DC) and 33 angle modes, a total of 35 prediction modes. The intra-frame modes used by VVC are planar, DC and 65 angle modes, a total of 67 prediction modes, which include traditional prediction modes and non-traditional prediction modes. Non-traditional prediction modes may include matrix weighted intra-frame prediction (MIP) mode. Traditional prediction modes include: planar mode with mode number 0, DC mode with mode number 1, and angle prediction modes with mode numbers 2 to 66. It should be noted that with the increase of angle modes, the prediction results of intra-frame prediction will be more accurate and more in line with the needs of the development of high-definition and ultra-high-definition digital video. The above-mentioned intra-frame prediction mode is only an example of this application and should not limit this application.

[0084] The residual unit 220 may generate a residual block for the CU based on the pixel blocks of the CU and the prediction blocks of the PUs of the CU. For example, the residual unit 220 may generate the residual block for the CU such that each sample in the residual block has a value equal to the difference between the sample in the pixel blocks of the CU and the corresponding sample in the prediction blocks of the PUs of the CU.

[0085] The transform / quantization unit 230 may quantize the transform coefficients. The transform / quantization unit 230 may quantize the transform coefficients associated with the TUs of a CU based on a quantization parameter (QP) value associated with the CU. The video encoder 200 may adjust the degree of quantization applied to the transform coefficients associated with the CU by adjusting the QP value associated with the CU.

[0086] The inverse transform / quantization unit 240 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficients to reconstruct a residual block from the quantized transform coefficients.

[0087] Reconstruction unit 250 may add samples of the reconstructed residual block to corresponding samples of one or more prediction blocks generated by prediction unit 210 to generate a reconstructed image block associated with the TU. By reconstructing the sample blocks of each TU of a CU in this manner, video encoder 200 can reconstruct the pixel blocks of the CU.

[0088] The loop filter unit 260 processes the inverse-transformed and inverse-quantized pixels to compensate for distortion and provide a better reference for subsequent pixel encoding. For example, it can perform deblocking filtering to reduce the blocking artifacts of pixel blocks associated with the CU. In some embodiments, the loop filter unit 260 includes a deblocking filter (DBF) unit and a sample adaptive offset / adaptive loop filter (SAO / ALF) unit. The DBF unit is used to remove blocking artifacts, while the SAO / ALF unit is used to remove ringing artifacts.

[0089] The decoded image buffer 270 may store reconstructed pixel blocks.

[0090] The inter-frame prediction unit 211 can use the reference image containing the reconstructed pixel block in the decoded image buffer 270 to perform inter-frame prediction on the PU of other images. In addition, the intra-frame prediction unit 212 can use the reconstructed pixel block in the decoded image buffer 270 to perform intra-frame prediction on other PUs in the same image as the CU.

[0091] The entropy coding unit 280 may receive the quantized transform coefficients from the transform / quantization unit 230. The entropy coding unit 280 may perform one or more entropy coding operations on the quantized transform coefficients to generate entropy-coded data.

[0092] FIG4 is a schematic block diagram of a video decoder according to an embodiment of the present application.

[0093] 4 , the video decoder 300 includes an entropy decoding unit 310, a prediction unit 320, an inverse quantization / transformation unit 330, a reconstruction unit 340, a loop filter unit 350, and a decoded picture buffer 360. It should be noted that the video decoder 300 may include more, fewer, or different functional components.

[0094] The video decoder 300 may receive a bitstream. The entropy decoding unit 310 may parse the bitstream to extract syntax elements from the bitstream. As part of parsing the bitstream, the entropy decoding unit 310 may parse the entropy-encoded syntax elements in the bitstream. The prediction unit 320, the inverse quantization / transform unit 330, the reconstruction unit 340, and the loop filter unit 350 may decode the video data based on the syntax elements extracted from the bitstream, thereby generating decoded video data.

[0095] The prediction unit 320 includes an intra prediction unit 322 and an inter prediction unit 321 .

[0096] The intra-prediction unit 322 may perform intra-prediction to generate a prediction block for the PU. The intra-prediction unit 322 may use an intra-prediction mode to generate a prediction block for the PU based on pixel blocks of spatially neighboring PUs. The intra-prediction unit 322 may also determine the intra-prediction mode for the PU based on one or more syntax elements parsed from the codestream.

[0097] The inter-frame prediction unit 321 may construct a first reference picture list (List 0) and a second reference picture list (List 1) based on syntax elements parsed from the codestream. In addition, if a PU is encoded using inter-frame prediction, the entropy decoding unit 310 may parse the motion information of the PU. The inter-frame prediction unit 321 may determine one or more reference blocks for the PU based on the motion information of the PU. The inter-frame prediction unit 321 may generate a prediction block for the PU based on the one or more reference blocks of the PU.

[0098] The inverse quantization / transform unit 330 may inversely quantize (i.e., dequantize) the transform coefficients associated with the TU. The inverse quantization / transform unit 330 may use the QP value associated with the CU of the TU to determine the degree of quantization. After inverse quantizing the transform coefficients, the inverse quantization / transform unit 330 may apply one or more inverse transforms to the inverse quantized transform coefficients to generate a residual block associated with the TU.

[0099] The reconstruction unit 340 uses the residual block associated with the TU of the CU and the prediction block of the PU of the CU to reconstruct the pixel block of the CU. For example, the reconstruction unit 340 can add samples of the residual block to corresponding samples of the prediction block to reconstruct the pixel block of the CU to obtain a reconstructed image block.

[0100] The loop filtering unit 350 may perform a deblocking filtering operation to reduce blocking artifacts of pixel blocks associated with a CU.

[0101] The video decoder 300 may store the reconstructed image of the CU in the decoded image buffer 360. The video decoder 300 may use the reconstructed image in the decoded image buffer 360 as a reference image for subsequent prediction, or transmit the reconstructed image to a display device for presentation.

[0102] Combining Figures 2 and 4, the basic process of video encoding and decoding is as follows:

[0103] At the encoding end, a frame of an image is divided into image blocks. For the current block, the prediction unit 210 uses intra-frame prediction or inter-frame prediction to predict the prediction block of the current block (i.e., the block to be encoded). The residual unit 220 can calculate a residual block based on the predicted block and the original block of the current block (i.e., the block to be encoded), which is the difference between the predicted block and the original block. This residual block can also be referred to as residual information. This residual block is transformed and quantized by the transform / quantization unit 230, thereby removing information that is insensitive to the human eye and eliminating visual redundancy. Optionally, the residual block before transformation and quantization by the transform / quantization unit 230 can be referred to as a time-domain residual block, and the time-domain residual block after transformation and quantization by the transform / quantization unit 230 can be referred to as a frequency residual block or a frequency-domain residual block. The entropy coding unit 280 receives the quantized change coefficients output by the change quantization unit 230 and can perform entropy coding on the quantized change coefficients to output a bitstream. For example, the entropy coding unit 280 can eliminate character redundancy based on the target context model and probability information of the binary bitstream.

[0104] At the decoding end, the entropy decoding unit 310 can parse the code stream to obtain the prediction information, quantization coefficient matrix, etc. of the current block (i.e., the block to be decoded). The prediction unit 320 uses intra-frame prediction or inter-frame prediction based on the prediction information to predict the prediction block of the current block (i.e., the block to be decoded). The inverse quantization / transformation unit 330 uses the quantization coefficient matrix obtained from the code stream to inverse quantize and inverse transform the quantization coefficient matrix to obtain a residual block. The reconstruction unit 340 adds the prediction block and the residual block to obtain a reconstructed block. The reconstructed blocks constitute a reconstructed image, and the loop filtering unit 350 performs loop filtering on the reconstructed image based on the image or block to obtain a decoded image. It is worth noting that the encoding end also needs to use operations similar to those of the decoder to obtain a decoded image. The decoded image can also be called a reconstructed image, and the reconstructed image can be a subsequent frame as a reference frame for inter-frame prediction.

[0105] In addition, the block division information determined by the encoder, as well as mode information or parameter information such as prediction, transform, quantization, entropy coding, and loop filtering, etc., are carried in the bitstream when necessary. The decoder parses the bitstream and analyzes the existing information to determine the same block division information, prediction, transform, quantization, entropy coding, loop filtering, etc. mode information or parameter information as the encoder, thereby ensuring that the decoded image obtained by the encoder and the decoder are the same.

[0106] It should be noted that, due to the need for parallel processing, images can be divided into slices, etc., and slices in the same image can be processed in parallel, that is, there is no data dependency between them. The term "frame" can be understood as an image or a slice, etc. In addition, of course, Figures 1 to 4 are only examples of the present application and should not be understood as limiting the present application. In other alternative embodiments, the decoding method and encoding method provided in the embodiments of the present application can also be applied to any other type of coding and decoding system, coding framework or decoding framework that meets its application conditions. For example, with the development of technology, some modules in the system or framework mentioned above or some steps in the above process may be optimized. In this case, the decoding method and encoding method provided in the embodiments of the present application can also be applied to the system, framework and process optimized thereon.

[0107] This application is applicable to the encoding and decoding of light field videos.

[0108] Light field video, captured by multiple cameras or camera arrays, is a research topic within the MPEG Lenslet Video Coding (LVC) Working Group. Unlike conventional camera imaging models, light field video uses a microlens array in front of the imaging plane. This allows light from the same point on the object plane to be captured simultaneously by multiple microlenses, effectively capturing the same point from multiple angles.

[0109] FIG5 is an example of a light field video transmission process provided by an embodiment of the present application.

[0110] As shown in FIG5 , a light field video can be obtained by a capture / shooting device (e.g., a light field camera), processed into a light field video in a specific data format, and input into a codec. The codec encodes and decodes the light field video and outputs the light field video in a specific data format. The display device receives the light field video in the specific data format and displays it.

[0111] Due to its special imaging model, the visual effect of light field images is very different from that of traditional pictures, which also leads to the fact that compression methods for general images or videos are not effective when processing light field images or videos. The emergence of the LVC working group is to solve this problem and study compression methods that are more suitable for light field videos. However, it is worth noting that LVC can still use conventional video codec tools (AVC, HEVC or VVC, etc.) in the encoding and / or decoding part. For example, LVC can use the system described in Figure 1 or the framework shown in Figures 2 to 3.

[0112] The following describes the technologies related to the technical solutions provided in the embodiments of this application.

[0113] (1) Improvement of motion estimation search algorithm.

[0114] To improve the compression performance of light field videos, the arrangement of macropixels in light field images can be used to improve the motion estimation search algorithm in the inter-frame prediction stage. Motion estimation refers to finding a best-matching block in the reference image that minimizes the rate distortion of the current coded block in the current image. The optimization goal of the search algorithm is to find the best-matching block more quickly and accurately and point to it with the final motion vector. A specific improvement to the motion estimation search algorithm can be as follows: in the motion estimation stage, the position indicated by the preliminary predicted motion vector is used as the initial position (also called the initial point, initial search position, or initial search point). Within a certain search range, the co-location position within each macropixel (i.e., the location of the co-location point) is searched sequentially according to the macropixel arrangement template; then, the best position is selected between the initial position and the co-location position.

[0115] Among them, the position of the co-location position in the macro-pixel to which it belongs is the same as the position of the initial position in the macro-pixel to which it belongs. The spacing of the co-location positions is the spacing of macro-pixels. For example, the position of the image block corresponding to the co-location position in the macro-pixel to which it belongs is the same as the position of the image block corresponding to the initial position in the macro-pixel to which it belongs. The image block corresponding to the co-location position can be an image block with the upper left corner (or lower left corner, upper right corner, lower right corner, center position or other specific position) as the co-location position; similarly, the image block corresponding to the initial position can be an image block with the upper left corner (or lower left corner, upper right corner, lower right corner, center position or other specific position) as the initial position.

[0116] FIG6 is an example of the initial position and the co-location position provided in an embodiment of the present application.

[0117] As shown in FIG6 , the search range of the co-location position includes a plurality of macropixels, and the plurality of macropixels includes an initial macropixel, and the initial macropixel includes an image block corresponding to the initial position. In addition, for any macropixel other than the initial macropixel among the plurality of macropixels, the arbitrary macropixel includes an image block corresponding to the co-location position. The position of the image block corresponding to any co-location position in the macropixel where it is located is the same as the position of the initial position in the initial macropixel. Specifically, as shown in (a) in FIG6 , the image block corresponding to the initial position and the image block corresponding to the co-location position are both located in the middle of the macropixel to which they belong, and as shown in (b) in FIG6 , the image block corresponding to the initial position and the image block corresponding to the co-location position are both located in the lower right corner of the macropixel to which they belong.

[0118] FIG. 7 is an example of a light field image provided by an embodiment of the present application.

[0119] As shown in Figure 7, since light field images are composed of a series of regularly arranged macropixels, there is a strong correlation between adjacent macropixels based on the imaging principle of light field cameras. Therefore, during the motion estimation search process, searching for the collocated positions of each macropixel can more fully utilize the correlation of the light field image, resulting in more efficient compression performance.

[0120] It should be understood that the term “macro pixel” may also be referred to as “micro image”, “micro lens image” or other terms with similar meanings.

[0121] However, although this improved method takes into account the macropixel arrangement pattern of the light field image, since the best candidates for matching blocks are not necessarily arranged strictly according to the macropixel spacing, searching only for co-location positions within the macropixel may miss some local optimal points. In view of this, the present application provides a coding method that can fully utilize the correlation of light field images to a greater extent, thereby further optimizing the motion estimation effect of light field video compression. Specifically, the encoder can determine at least one search position from the initial position and at least one co-location position of the initial position, then determine at least one first position other than the any one search position within a first search area where any one of the at least one search positions is located, and then optimize the initial position based on the at least one search position and the at least one first position. For example, the encoder can appropriately add a local grid search based on the search for co-location positions within the macropixel, that is, perform an offset correction on the co-location positions based on the macropixel to maximize the correlation with the current block, thereby further optimizing the motion estimation effect of light field video compression.

[0122] FIG8 is a schematic flow chart of an encoding method 400 provided in an embodiment of the present application. It should be understood that the encoding method 400 can be executed by an encoder. For example, the encoding method 400 can be executed by the encoding device 110 or encoder 112 shown in FIG1 . Another example is that the encoding method 400 can be executed by the video encoder 200 shown in FIG2 . For ease of description, the following exemplary description of the encoding method 400 is provided using an encoder as the execution subject.

[0123] As shown in FIG8 , the encoding method 400 may include:

[0124] S410, the encoder performs motion estimation on a current block in a current image and determines a first motion parameter of the current block; the first motion parameter points to an initial position in a reference image of the current image; the initial position is located within an initial macropixel of the reference image.

[0125] Exemplarily, the current image and the reference image of the current image are light field images.

[0126] Exemplarily, the encoder may adopt an advanced motion vector prediction model (AMVP) mode or other types of prediction modes to perform motion estimation on the current block to obtain the first motion parameter.

[0127] Exemplarily, the initial position may be a position of a reference block pointed to by the first motion parameter in the reference image. Alternatively, the first motion parameter points to a reference block in the reference image, and the initial position is a position of the reference block. For example, the initial position may be the upper left corner, lower left corner, upper right corner, lower right corner, center, or other specific position of the reference block.

[0128] Exemplarily, the initial position may be the position of the pixel to which the first motion parameter points in the reference image.

[0129] It is worth noting that the term "position" can be equivalently replaced by "pixel point," "the location of the pixel point," or other descriptions with similar meanings, and this application does not specifically limit this. For example, the initial position can be equivalently replaced by the initial pixel point, the location of the initial pixel point, or other terms with similar meanings.

[0130] S420: The encoder determines at least one collocated position of the initial position based on the position of the initial position within the initial macropixel.

[0131] Exemplarily, for any one of the at least one collocated position, a position of the any one collocated position within the macropixel where the any one collocated position is located is the same as a position of the initial position within the initial macropixel.

[0132] For example, the position of the image block corresponding to any one of the collocated positions within the macropixel where the collocated position is located is the same as the position of the image block corresponding to the initial position within the initial macropixel. The image block corresponding to any one of the collocated positions may be an image block whose upper left corner (or lower left corner, upper right corner, lower right corner, center position, or other specific position) is the collocated position; similarly, the image block corresponding to the initial position may be an image block whose upper left corner (or lower left corner, upper right corner, lower right corner, center position, or other specific position) is the initial position.

[0133] It should be understood that the image block corresponding to any one of the co-location positions and the image block corresponding to the initial position can be specifically referred to the example in FIG6 , and will not be described again here to avoid repetition.

[0134] S430: The encoder determines at least one search position among the initial position and the at least one co-located position.

[0135] Exemplarily, the encoder may determine the initial position and a portion of the at least one co-located position as the at least one search position.

[0136] Exemplarily, the encoder may determine all positions in the initial position and the at least one co-located position as the at least one search position.

[0137] S440, the encoder determines at least one first position other than any one of the at least one search positions within a first search area where the any one search position is located; the first search area is smaller than or equal to the macro pixel where the any one search position is located.

[0138] Exemplarily, the first search area includes an area centered on any one of the search positions.

[0139] Exemplarily, the center position of the first search area is the center, upper left corner, lower left corner, upper right corner or lower right corner or other position of the macro pixel where any one of the search positions is located.

[0140] Exemplarily, the scope of the first search area may be a predefined search area. For example, the first search area may be implemented by pre-storing a corresponding code, table, or other method for indicating relevant information in an encoder, or the scope of the first search area may be agreed upon or defined by a standard protocol.

[0141] Exemplarily, the range of the first search area may be any value, for example, any positive integer.

[0142] Exemplarily, the first search area may be equal to the macropixel where the arbitrary search position is located. In this case, the concept of the first search area may not be introduced. That is, the encoder determines the at least one first position within the macropixel where the arbitrary search position is located.

[0143] Exemplarily, the first search area may be smaller than the macropixel in which the arbitrary search position is located. In this case, the first search area may also be referred to as a local search area. That is, the encoder determines the at least one first position within a local area within the macropixel in which the arbitrary search position is located.

[0144] Exemplarily, the encoder may search for the at least one first position within the first search area using any search method. For example, the encoder may search for the at least one first position within the first search area using a grid search method (also referred to as a mesh search method). For another example, the encoder may search for the at least one first position within the first search area using a random sampling method.

[0145] FIG9 is an example of a search principle for at least one first position provided in an embodiment of the present application.

[0146] As shown in Figure 9, the encoder can search for the at least one first position within the first search area using a grid search method. Specifically, assuming that the first search area includes 7×7 pixels and the search spacing of the grid search is 1 pixel, the encoder determines the pixel points at the intersection of the 1st, 3rd, 5th, and 7th rows and the 1st, 3rd, 5th, and 7th columns of the 7×7 pixels as the searched 4×4 pixels, i.e., the at least one first position.

[0147] S450: The encoder determines a second motion parameter of the reference block based on the at least one search position and the at least one first position.

[0148] Exemplarily, the encoder may determine an optimal position among the at least one search position and the at least one first position, and determine a motion parameter pointing to the optimal position as the second motion parameter.

[0149] Exemplarily, the encoder may consider other positions based on the at least one search position and the at least one first position, that is, the encoder may determine an optimal position among the at least one search position, the at least one first position, and the other positions to be considered, and determine the motion parameters pointing to the optimal position as the second motion parameters. For example, when the at least one search position does not include the initial position, the other positions may include the initial position or a position determined within the search area where the initial position is located.

[0150] Exemplarily, the second motion parameter may be a final motion parameter.

[0151] Exemplarily, the second motion parameter may be a motion parameter that needs to be further optimized, that is, the encoder may further process the second motion parameter to obtain the final motion parameter.

[0152] It is worth noting that the term "motion parameter" is intended to include a motion vector or other motion parameter that can represent a position of an image block in a reference image relative to a specific position. The specific position can be a position in the reference image that is the same as the position of the current block in the current image.

[0153] Exemplarily, after obtaining the second motion parameter, the encoder can use the reference block pointed to by the second motion parameter to predict the current block to obtain a predicted block of the current block, and then determine the residual block of the current block based on the original block of the current block and the predicted block of the current block; further, the encoder can quantize and entropy encode the residual block to obtain a code stream, such as a code stream of a light field image or a light field video.

[0154] In this embodiment, the encoder takes the position pointed to by the first motion parameter determined by motion estimation as the initial position, then determines at least one search position between the initial position and at least one co-location position of the initial position, then determines at least one first position other than any one search position within a first search area where any one of the at least one search positions is located, and then determines the second motion parameter of the reference block based on the at least one search position and the at least one first position; this is equivalent to obtaining the at least one search position by screening based on the introduction of the at least one co-location position and the initial position, and then correcting the first motion parameter based on the at least one search position and at least one first position determined within the first search area where any one of the at least one search position is located, and obtaining the corrected second motion parameter, which can improve the accuracy of the second motion parameter, and thus improve the motion estimation effect and encoding performance of the encoder.

[0155] In some embodiments, the S420 may include:

[0156] determining at least one macropixel within a search range of the at least one co-located position;

[0157] In any one of the at least one macropixel, a position that is the same as the initial position in the initial macropixel is determined as the collocated position in the at least one collocated position.

[0158] Exemplarily, the value of the search range of the at least one co-location position may be a range that can cover multiple macro pixels.

[0159] Exemplarily, the search range of the at least one collocated position may be any value greater than the spacing between collocated positions. The spacing between collocated positions is equal to the spacing of macro pixels.

[0160] Exemplarily, the search range of the at least one co-location position may be a predefined search range. For example, the search range may be implemented by pre-storing a corresponding code, table, or other method for indicating relevant information in an encoder, or the search range of the at least one co-location position may be agreed upon or defined by a standard protocol.

[0161] Exemplarily, the encoder determines the at least one macro pixel within a search range of the at least one co-located position with the initial position as the center.

[0162] Exemplarily, the encoder determines the at least one macropixel based on a macropixel arrangement rule, and then determines, within any macropixel within the at least one macropixel, a collocated position of the at least one collocated position within the any macropixel based on a position of the initial position within the initial macropixel. The arrangement rule includes, but is not limited to, at least one of the following: macropixel shape, macropixel spacing, and macropixel arrangement direction.

[0163] Exemplarily, within each of the at least one macropixel, the encoder determines a position identical to the position of the initial position within the initial macropixel as the collocated position in the at least one collocated position. In other words, the position of the collocated position within each macropixel is identical to the position of the initial position within the initial macropixel.

[0164] FIG10 is an example of the co-location provided in an embodiment of the present application.

[0165] As shown in Figure 10, assuming that the macropixels are hexagonal and closely arranged, the search range for the collocated location includes multiple macropixels, including the initial macropixel where the initial location is located. For any macropixel other than the initial macropixel among the multiple macropixels, the collocated location is included within the macropixel; the position of any collocated location within the macropixel is the same as the position of the initial location within the initial macropixel. Specifically, as shown in Figure 10, the initial location and any collocated location are both the center positions of the macropixels to which they belong.

[0166] In some embodiments, the S430 may include:

[0167] The first N positions selected from the initial position and the at least one co-located position in ascending order of corresponding rate-distortion costs are determined as the at least one search position.

[0168] Exemplarily, the encoder determines the top N positions with the smallest rate-distortion costs among the initial position and the at least one co-located position as the at least one search position.

[0169] Exemplarily, N may be implemented by pre-saving corresponding codes, tables, or other methods that can be used to indicate relevant information in the encoder, or N may be agreed upon or defined by a standard protocol.

[0170] Illustratively, N can be any positive integer.

[0171] Exemplarily, the encoder sequentially selects the position with the smallest rate-distortion cost among the initial position and the at least one co-location position, the second smallest position, and so on, until the encoder selects N positions, and determines the selected N positions as the at least one search position.

[0172] Exemplarily, the encoder first determines the rate-distortion cost corresponding to the initial position and the rate-distortion cost corresponding to any one of the at least one co-location positions, and then, based on the rate-distortion cost corresponding to the initial position and the rate-distortion cost corresponding to any one search position, determines the first N positions selected in ascending order of the corresponding rate-distortion costs as the at least one search position.

[0173] It is worth noting that the present application does not limit whether the encoder sorts the initial position and the at least one co-location position according to the corresponding rate-distortion cost. For example, the encoder may first sort the initial position and the at least one co-location position according to the corresponding rate-distortion cost to obtain a first sequence; and then determine the first N positions in the first sequence as the at least one search position. For another example, the encoder may not sort the initial position and the at least one co-location position according to the corresponding rate-distortion cost, that is, directly traverse the initial position and the at least one co-location position N times, and determine the first N positions in the initial position and the at least one co-location position selected in ascending order according to the corresponding rate-distortion cost as the at least one search position. For example, when traversing for the first time, the position with the smallest rate-distortion cost among the initial position and the at least one co-location position is determined as the search position among the at least one search position; then, when traversing for the second time, the position with the second smallest rate-distortion cost among the initial position and the at least one co-location position is determined as the search position among the at least one search position, and so on, until the encoder selects N positions, and the selected N positions can be directly determined as the at least one search position.

[0174] It is worth noting that the term "rate-distortion cost" is intended to be a parameter used to characterize distortion and bit rate. For example, "rate-distortion cost" may include Peak Signal to Noise Ratio (PSNR), Mean Structural Similarity Index Measure (MSSIM) or other parameters with similar functions. This application does not specifically limit the calculation method of "rate-distortion cost". Of course, in other alternative embodiments, "rate-distortion cost" can also be replaced by a parameter that is only used to characterize distortion or bit rate to reduce complexity, and even "rate-distortion cost" can be replaced by other types of indicators used to characterize encoding performance or decoding performance, and this application does not specifically limit this.

[0175] In some embodiments, the S430 may include:

[0176] The first N positions of the initial position and the at least one co-located position, which are selected in descending order of similarity between the corresponding image blocks and the current block, are determined as the at least one search position.

[0177] Exemplarily, the encoder determines the position with the top N highest similarity to the current block among the initial position and the at least one co-located position as the at least one search position.

[0178] Exemplarily, the encoder first determines the similarity between the image block corresponding to the initial position and the current block, as well as the similarity between the image block corresponding to any one of the at least one co-location positions and the current block, and then, based on the obtained similarity, determines the first N positions selected in descending order of similarity as the at least one search position.

[0179] It is worth noting that the term "similarity" is intended to characterize the degree of similarity between an image block and a current block. For example, "similarity" may include the Mean Structural Similarity Index Measure (MSSIM) or other parameters with similar functions. For example, "similarity" may also be replaced by a parameter that only characterizes the degree of distortion of the corresponding image block relative to the current block. This application does not specifically limit the method for calculating "similarity."

[0180] In some embodiments, the S430 may include:

[0181] The first N positions of the initial position and the at least one co-located position in a first order are determined as the at least one search position.

[0182] Exemplarily, the first order may be an order from small to large according to the corresponding rate-distortion cost.

[0183] Exemplarily, the first order may be an order of descending similarity between the corresponding image blocks and the current block.

[0184] Exemplarily, the first order may be the encoding order of corresponding image blocks.

[0185] Exemplarily, the first order may be a predefined order. For example, the first order may be implemented by pre-storing a corresponding code, table, or other method for indicating relevant information in an encoder, or the first order may be agreed upon or defined by a standard protocol.

[0186] Exemplarily, the first order may be the order in which the encoder adapts a certain operation or selects (or determines) a certain parameter.

[0187] In some embodiments, the S450 may include:

[0188] The motion parameter pointing to the position with the minimum rate-distortion cost corresponding to the at least one search position and the at least one first position is determined as the second motion parameter.

[0189] Exemplarily, if the at least one search position includes the initial position, the encoder determines the motion parameters pointing to the position with the minimum rate-distortion cost between the at least one search position and the at least one first position as the second motion parameters. Of course, in other alternative embodiments, when the at least one search position does not include the initial position, the encoder may also determine the motion parameters pointing to the position with the minimum rate-distortion cost between the at least one search position and the at least one first position as the second motion parameters. This application does not impose specific limitations on this.

[0190] Exemplarily, if the at least one search position includes the initial position, the encoder first determines the rate-distortion cost corresponding to the search position and the rate-distortion cost corresponding to the first position, and then, based on the rate-distortion cost corresponding to the search position and the rate-distortion cost corresponding to the first position, determines the position with the minimum rate-distortion cost as the optimal position; the encoder then determines the motion parameter pointing to the optimal position as the second motion parameter. The term "rate-distortion cost" can be referred to in the above description and will not be repeated here to avoid repetition.

[0191] Exemplarily, when there are multiple positions corresponding to the minimum rate-distortion cost among the at least one search position and the at least one first position, the encoder may determine the motion parameters pointing to any one of the multiple positions as the second motion parameters. For example, the encoder may determine the motion parameters pointing to the position closest to the initial position among the multiple positions as the second motion parameters. For another example, the encoder may randomly select a position from the multiple positions and determine the motion parameters pointing to this position as the second motion parameters.

[0192] Of course, in other alternative embodiments, the encoder may determine the motion parameter pointing to the at least one search position and the at least one first position that satisfies the first condition as the second motion parameter. For example, the first condition may include: the rate-distortion cost is less than or equal to a preset threshold, or the first condition may include: the rate-distortion cost is equal to a minimum value (for example, the minimum of the rate-distortion cost corresponding to the at least one search position and the rate-distortion cost corresponding to the at least one first position). The first condition may be a predefined condition. For example, the first condition may be implemented by pre-saving a corresponding code, table, or other method that can be used to indicate relevant information in the encoder, or the first condition may be agreed upon or defined by a standard protocol.

[0193] In some embodiments, the S450 may include:

[0194] The motion parameter pointing to the position with the smallest rate-distortion cost among the at least one search position, the at least one first position and the unsearched position is determined as the second motion parameter; wherein the unsearched position includes the initial position and the at least one co-location position except the at least one search position.

[0195] Exemplarily, if the at least one search position includes the initial position, the encoder determines the motion parameters pointing to the position with the minimum rate-distortion cost among the at least one search position, the at least one first position, and the unsearched position as the second motion parameters. Of course, in other alternative embodiments, when the at least one search position does not include the initial position, the encoder may also determine the motion parameters pointing to the position with the minimum rate-distortion cost among the at least one search position, the at least one first position, and the unsearched position as the second motion parameters. This application does not impose specific limitations on this.

[0196] Exemplarily, if the at least one search position includes the initial position, the encoder first determines the rate-distortion cost corresponding to the search position, the rate-distortion cost corresponding to the first position, and the rate-distortion cost corresponding to the unsearched position. Then, based on the rate-distortion cost corresponding to the search position, the rate-distortion cost corresponding to the first position, and the rate-distortion cost corresponding to the unsearched position, the encoder determines the position with the minimum rate-distortion cost as the optimal position. The encoder then determines the motion parameter pointing to the optimal position as the second motion parameter. The term "rate-distortion cost" can be referred to in the above description and will not be repeated here to avoid repetition.

[0197] Exemplarily, when there are multiple positions among the at least one search position, the at least one first position, and the unsearched position that correspond to the position with the lowest rate-distortion cost, the encoder may determine the motion parameters pointing to any one of the multiple positions as the second motion parameters. For example, the encoder may determine the motion parameters pointing to the position closest to the initial position among the multiple positions as the second motion parameters. For another example, the encoder may randomly select a position from the multiple positions and determine the motion parameters pointing to this position as the second motion parameters.

[0198] Of course, in other alternative embodiments, the encoder may determine the motion parameter pointing to the at least one search position, the at least one first position, and the unsearched position that satisfies the second condition as the second motion parameter. For example, the second condition may include: the rate-distortion cost is less than or equal to a preset threshold, or the second condition may include: the rate-distortion cost is equal to a minimum value (for example, the minimum value of the rate-distortion cost corresponding to the at least one search position, the rate-distortion cost corresponding to the at least one first position, and the rate-distortion cost corresponding to the unsearched position). The second condition may be a predefined condition. For example, the second condition may be implemented by pre-saving a corresponding code, table, or other method that can be used to indicate relevant information in the encoder, or the second condition may be agreed upon or defined by a standard protocol.

[0199] In some embodiments, the S450 may include:

[0200] If the at least one search position does not include the initial position, then within a second search area where the initial position is located, determine at least one second position other than the initial position; the second search area is smaller than or equal to the initial macropixel; and based on the at least one search position, the at least one first position, the initial position and the at least one second position, determine the second motion parameter.

[0201] Exemplarily, the second search area includes an area centered on the initial position.

[0202] Exemplarily, the center position of the second search area is the center, upper left corner, lower left corner, upper right corner, lower right corner or other position of the initial macro pixel.

[0203] Exemplarily, the range of the second search area may be any value. For example, the range of the second search area may be any positive integer.

[0204] Exemplarily, the second search area may be a predefined search area. For example, the second search area may be implemented by pre-storing a corresponding code, table, or other method for indicating relevant information in an encoder, or the second search area may be agreed upon or defined by a standard protocol.

[0205] Exemplarily, the second search area may be equal to the initial macropixel, in which case the concept of the second search area may not be introduced. That is, the encoder determines the at least one second position within the initial macropixel.

[0206] Exemplarily, the second search area may be smaller than the initial macropixel. In this case, the second search area may also be referred to as a local search area. That is, the encoder determines the at least one second position within a local area within the initial macropixel.

[0207] Exemplarily, the encoder can search for the at least one second position in the second search area by any search method. For example, the encoder can search for the at least one second position in the second search area by a grid search method (also referred to as a grid search method). For another example, the encoder can search for the at least one second position in the second search area by a random sampling method. It is worth noting that the way the encoder searches for the at least one second position in the second search area is the same as or different from the way the encoder searches for the at least one first position in the first search area. For details, please refer to the scheme involved in Figure 9 above. To avoid repetition, it will not be described here.

[0208] In some embodiments, the encoder determines the motion parameter pointing to the position with the minimum rate-distortion cost among the at least one search position, the at least one first position, the initial position and the at least one second position as the second motion parameter.

[0209] Exemplarily, the encoder first determines the rate-distortion cost corresponding to the search position, the rate-distortion cost corresponding to the first position, the rate-distortion cost corresponding to the initial position, and the rate-distortion cost corresponding to the second position. Then, based on the rate-distortion cost corresponding to the search position, the rate-distortion cost corresponding to the first position, the rate-distortion cost corresponding to the initial position, and the rate-distortion cost corresponding to the second position, the encoder determines the position with the minimum rate-distortion cost as the optimal position. The encoder then determines the motion parameter pointing to the optimal position as the second motion parameter. The term "rate-distortion cost" can be referred to in the above description and will not be repeated here to avoid repetition.

[0210] Exemplarily, when there are multiple positions corresponding to the minimum rate-distortion cost among the at least one search position, the at least one first position, the initial position, and the at least one second position, the encoder may determine the motion parameters pointing to any one of the multiple positions as the second motion parameters. For example, the encoder may determine the motion parameters pointing to the position closest to the initial position among the multiple positions as the second motion parameters. For another example, the encoder may randomly select a position from the multiple positions and determine the motion parameters pointing to this position as the second motion parameters.

[0211] Of course, in other alternative embodiments, the encoder may determine the motion parameter that satisfies the third condition among the at least one search position, the at least one first position, the initial position, and the at least one second position as the second motion parameter. For example, the third condition may include: the rate-distortion cost is less than or equal to a preset threshold, or the third condition may include: the rate-distortion cost is equal to a minimum value (for example, the minimum value of the rate-distortion cost corresponding to the at least one search position, the rate-distortion cost corresponding to the at least one first position, the rate-distortion cost corresponding to the initial position, and the rate-distortion cost corresponding to the at least one second position). The third condition may be a predefined condition. For example, the third condition may be implemented by pre-saving a corresponding code, table, or other method that can be used to indicate relevant information in the encoder, or the third condition may be agreed upon or defined by a standard protocol.

[0212] In some embodiments, the encoder determines the motion parameter pointing to the position with the lowest rate-distortion cost among the at least one search position, the at least one first position, the initial position, the at least one second position and the unsearched position as the second motion parameter; wherein the unsearched position includes the initial position and the at least one co-located position except the at least one search position and the initial position.

[0213] Exemplarily, the encoder first determines the rate-distortion cost corresponding to the search position, the rate-distortion cost corresponding to the first position, the rate-distortion cost corresponding to the initial position, the rate-distortion cost corresponding to the second position, and the rate-distortion cost corresponding to the unsearched position. Then, based on the rate-distortion cost corresponding to the search position, the rate-distortion cost corresponding to the first position, the rate-distortion cost corresponding to the initial position, the rate-distortion cost corresponding to the second position, and the rate-distortion cost corresponding to the unsearched position, the encoder determines the position with the minimum rate-distortion cost as the optimal position. The encoder then determines the motion parameter pointing to the optimal position as the second motion parameter. The term "rate-distortion cost" can be referred to in the above description and will not be repeated here to avoid repetition.

[0214] Exemplarily, when there are multiple positions with the lowest rate-distortion cost among the at least one search position, the at least one first position, the initial position, the at least one second position, and the unsearched position, the encoder may determine the motion parameters pointing to any one of the multiple positions as the second motion parameters. For example, the encoder may determine the motion parameters pointing to the position closest to the initial position among the multiple positions as the second motion parameters. For another example, the encoder may randomly select a position from the multiple positions and determine the motion parameters pointing to this position as the second motion parameters.

[0215] Of course, in other alternative embodiments, the encoder may determine the motion parameter pointing to the at least one search position, the at least one first position, the initial position, the at least one second position, and the unsearched position that satisfies the fourth condition as the second motion parameter. For example, the fourth condition may include: the rate-distortion cost is less than or a preset threshold, or the fourth condition may include: the rate-distortion cost is equal to a minimum value (for example, the minimum value of the rate-distortion cost corresponding to the at least one search position, the rate-distortion cost corresponding to the at least one first position, the rate-distortion cost corresponding to the initial position, the rate-distortion cost corresponding to the at least one second position, and the rate-distortion cost corresponding to the unsearched position). The fourth condition may be a predefined condition. For example, the fourth condition may be implemented by pre-saving a corresponding code, table, or other method that can be used to indicate relevant information in the encoder, or the fourth condition may be agreed upon or defined by a standard protocol.

[0216] In some embodiments, the range of the second search area is the same as the range of the first search area.

[0217] Of course, in other alternative embodiments, the range of the second search area and the range of the first search area may also be different, and this application does not make any specific limitation on this.

[0218] For example, the range of the second search area may be larger than the range of the first search area.

[0219] In some embodiments, the S440 may include:

[0220] determining a first search distance;

[0221] Based on the first search distance, the at least one first position is searched within the first search area in a grid search manner.

[0222] Exemplarily, the first search spacing is a search spacing used by the encoder when performing a grid search in the first search area.

[0223] Exemplarily, the first search interval may be any value, for example, 0 or a positive integer.

[0224] In some embodiments, the encoder determines the first search distance based on a first distance between the arbitrary search position and the initial position.

[0225] Exemplarily, the encoder determines, based on a predefined first mapping relationship, the interval corresponding to the first distance in the first mapping relationship as the first search interval. The first mapping relationship may include multiple distances and intervals corresponding to each distance. The first mapping relationship may be implemented by pre-storing a corresponding code, table, or other method for indicating relevant information in the encoder, or the first mapping relationship may be agreed upon or defined by a standard protocol.

[0226] Exemplarily, the encoder determines the spacing corresponding to the interval in which the first distance is located as the first search spacing. For example, the encoder may determine the spacing corresponding to the interval in the second mapping relationship as the first search spacing based on a predefined second mapping relationship. The second mapping relationship may include multiple intervals and spacings corresponding to each interval. The second mapping relationship may be implemented by pre-saving a corresponding code, table, or other method that can be used to indicate relevant information in the encoder, or the second mapping relationship may be agreed upon or defined by a standard protocol.

[0227] Of course, in other alternative embodiments, when any one of the search positions is not the initial position, the first search distance may be determined based on the initial search distance used when performing a grid search on the search area where the initial position is located.

[0228] For example, the first search spacing may be the sum of the initial search spacing and a first value, and the first value may be determined based on the first distance. For example, the first value is positively correlated with the first distance, that is, the larger the first distance, the larger the first value. Since the image block corresponding to the search position closer to the initial position has a stronger correlation with the current block, the first value is positively correlated with the first distance. Therefore, a more intensive search may be performed for the search area where the search position close to the initial position is located, and a more sparse search may be performed or no search may be performed for the search area where the search position farther away is located. This can improve coding efficiency while ensuring the motion estimation effect and coding performance of the encoder.

[0229] In some embodiments, the first distance is positively correlated with the first search distance.

[0230] Exemplarily, the larger the first distance is, the larger the first search interval is.

[0231] Since the closer the macropixel is to the initial position, the stronger the correlation with the current block, the first distance is positively correlated with the first search interval. A more intensive search can be performed on the search area where the search position close to the initial position is located, and a more sparse search or no search can be performed on the search area where the search position farther away is located. This can improve the coding efficiency while ensuring the motion estimation effect and coding performance of the encoder.

[0232] In some embodiments, the encoder determines the first search distance based on a rate-distortion cost corresponding to any one search position.

[0233] Exemplarily, the encoder, based on a predefined third mapping relationship, determines the spacing corresponding to the rate-distortion cost corresponding to any one search position in the third mapping relationship as the first search spacing. The third mapping relationship may include multiple costs and spacings corresponding to each cost. The third mapping relationship may be implemented by pre-storing a corresponding code, table, or other method for indicating relevant information in the encoder, or the third mapping relationship may be agreed upon or defined by a standard protocol.

[0234] Exemplarily, the encoder determines the spacing corresponding to the interval where the rate-distortion cost corresponding to any one search position is located as the first search spacing. For example, the encoder may determine the spacing corresponding to the interval in the fourth mapping relationship as the first search spacing based on a predefined fourth mapping relationship. The fourth mapping relationship may include multiple intervals and spacings corresponding to each interval. The fourth mapping relationship may be implemented by pre-saving a corresponding code, table, or other method that can be used to indicate relevant information in the encoder, or the fourth mapping relationship may be agreed upon or defined by a standard protocol.

[0235] Of course, in other alternative embodiments, when the rate-distortion cost corresponding to any one search position is not the minimum value of the rate-distortion costs corresponding to the at least one search position, the first search interval may be determined based on the minimum value.

[0236] For example, the first search spacing may be the sum of a preset search spacing (for example, the search spacing used when performing a grid search in the search area where the search position with the minimum rate-distortion cost is located) and a second value, and the second value may be determined based on the difference between the rate-distortion cost corresponding to any one of the search positions and the minimum value. For example, the second value is positively correlated with the difference, that is, the larger the difference, the larger the second value. Since the image block corresponding to the search position with a smaller rate-distortion cost has a stronger correlation with the current block, the second value is positively correlated with the difference, and a more intensive search may be performed for the search area where the search position with a smaller rate-distortion cost is located, and a more sparse search or no search may be performed for the search area where the search position with a larger rate-distortion cost is located, thereby improving the coding efficiency while ensuring the motion estimation effect and coding performance of the encoder.

[0237] In some embodiments, the rate-distortion cost corresponding to any one search position is positively correlated with the first search distance.

[0238] Exemplarily, the greater the rate-distortion cost corresponding to any one search position, the greater the first search interval.

[0239] Since the image block corresponding to the search position with a smaller rate-distortion cost has a stronger correlation with the current block, the rate-distortion cost corresponding to any search position is positively correlated with the first search interval. A more intensive search can be performed for the search area where the search position with a smaller rate-distortion cost is located, and a more sparse search or no search can be performed for the search area where the search position with a larger rate-distortion cost is located. This can improve the coding efficiency while ensuring the motion estimation effect and coding performance of the encoder.

[0240] In some embodiments, the encoder determines the first search distance based on a first similarity between the image block corresponding to the any one search position and the current block.

[0241] Exemplarily, the encoder determines, based on a predefined fifth mapping relationship, the distance corresponding to the first similarity in the fifth mapping relationship as the first search distance. The fifth mapping relationship may include multiple similarities and distances corresponding to each similarity. The fifth mapping relationship may be implemented by pre-storing a corresponding code, table, or other method for indicating relevant information in the encoder, or the fifth mapping relationship may be agreed upon or defined by a standard protocol.

[0242] Exemplarily, the encoder determines the spacing corresponding to the interval where the first similarity is located as the first search spacing. For example, the encoder may determine the spacing corresponding to the interval in the sixth mapping relationship as the first search spacing based on a predefined sixth mapping relationship. The sixth mapping relationship may include multiple intervals and spacings corresponding to each interval. The sixth mapping relationship may be implemented by pre-saving a corresponding code, table, or other method that can be used to indicate relevant information in the encoder, or the sixth mapping relationship may be agreed upon or defined by a standard protocol.

[0243] Of course, in other alternative embodiments, when the first similarity is not the maximum value of the similarities between the corresponding image block in the at least one search position and the current block, the first search distance may be determined based on the maximum value.

[0244] For example, the first search spacing may be the sum of a preset search spacing (for example, a search spacing used when performing a grid search in the search area where the search position having the maximum similarity is located) and a third value, and the third value may be determined based on the difference between the first similarity and the maximum value. For example, the third value is negatively correlated with the difference, that is, the larger the difference, the smaller the third value. Since the image block corresponding to the search position with greater similarity has a stronger correlation with the current block, the third value is negatively correlated with the difference, and a more intensive search may be performed for the search area where the search position with greater similarity is located, and a more sparse search or no search may be performed for the search area where the search position with less similarity is located. This can improve the coding efficiency while ensuring the motion estimation effect and coding performance of the encoder.

[0245] In some embodiments, the first similarity is negatively correlated with the first search distance.

[0246] Since the image block corresponding to the search position with greater similarity has a stronger correlation with the current block, the first similarity is negatively correlated with the first search interval. A more intensive search can be performed for the search area where the search position with greater similarity is located, and a more sparse search or no search can be performed for the search area where the search position with smaller similarity is located. This can improve the encoding efficiency while ensuring the motion estimation effect and encoding performance of the encoder.

[0247] FIG11 is an example of at least one search location provided in an embodiment of the present application.

[0248] As shown in Figure 11, the encoder selects the four best positions from the initial position and the remaining co-located positions (for example, the corresponding rate-distortion values ​​are the top 4 smallest, or the corresponding image block has the top 4 highest similarity with the coding block). These four positions include the initial position. The search interval of the search area where these four positions are located is 2. The encoder performs a grid search on these four positions and the search area where each position is located, with an interval of two pixels, and selects the best position from these four positions and the searched positions, which is used as the position for determining motion parameters (such as motion vectors).

[0249] FIG12 is another example of at least one search location provided by an embodiment of the present application.

[0250] As shown in Figure 12, the encoder selects 6 optimal positions from the initial position and the remaining co-located positions (for example, the corresponding 6 smallest rate-distortion values, or the corresponding image block and the coding block have the highest similarity to the 6). These 6 positions include the initial position. The search interval of the search area where these 6 positions are located is 4. The encoder performs a grid search of these 6 positions and the search area where each position is located, with an interval of 4 pixels, and selects the optimal position from these 6 positions and the searched positions, which is used as the position for determining motion parameters (such as motion vectors).

[0251] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the embodiments mentioned above. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all fall within the scope of protection of the present application. For example, the various specific technical features described in the specific embodiments mentioned above can be combined in any suitable manner unless there is any contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, and as long as they do not violate the ideas of the present application, they should also be regarded as the contents disclosed in the present application.

[0252] It should also be understood that in the various method embodiments of the present application, the size of the serial numbers of the processes involved above does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0253] The following describes in detail an embodiment of the device of the present application in conjunction with FIG. 13 and FIG. 14 .

[0254] FIG13 is a schematic block diagram of an encoder provided in an embodiment of the present application.

[0255] As shown in FIG13 , the encoder 500 may include:

[0256] An estimation unit 510 is configured to perform motion estimation on a current block in a current image and determine a first motion parameter of the current block; the first motion parameter points to an initial position in a reference image of the current image; the initial position is located within an initial macropixel of the reference image;

[0257] The determining unit 520 is configured to:

[0258] determining at least one co-located position of the initial position based on the position of the initial position within the initial macropixel;

[0259] determining at least one search position among the initial position and the at least one co-located position;

[0260] Determine at least one first position other than any one of the at least one search position within a first search area where the at least one search position is located, wherein the first search area is smaller than or equal to the macropixel where the at least one search position is located;

[0261] Based on the at least one search position and the at least one first position, a second motion parameter of the reference block is determined.

[0262] In some embodiments, the determining unit 520 is specifically configured to:

[0263] The first N positions selected from the initial position and the at least one co-located position in ascending order of corresponding rate-distortion costs are determined as the at least one search position.

[0264] In some embodiments, the determining unit 520 is specifically configured to:

[0265] The motion parameter pointing to the position with the minimum rate-distortion cost corresponding to the at least one search position and the at least one first position is determined as the second motion parameter.

[0266] In some embodiments, the determining unit 520 is specifically configured to:

[0267] The motion parameter pointing to the position with the smallest rate-distortion cost among the at least one search position, the at least one first position and the unsearched position is determined as the second motion parameter; wherein the unsearched position includes the initial position and the at least one co-location position except the at least one search position.

[0268] In some embodiments, the at least one search position comprises the initial position.

[0269] In some embodiments, the determining unit 520 is specifically configured to:

[0270] If the at least one search position does not include the initial position, determining at least one second position other than the initial position within a second search area where the initial position is located; the second search area is smaller than or equal to the initial macropixel;

[0271] The second motion parameter is determined based on the at least one search position, the at least one first position, the initial position, and the at least one second position.

[0272] In some embodiments, the determining unit 520 is specifically configured to:

[0273] The motion parameter pointing to the position with the minimum rate-distortion cost among the at least one search position, the at least one first position, the initial position and the at least one second position is determined as the second motion parameter.

[0274] In some embodiments, the determining unit 520 is specifically configured to:

[0275] The motion parameter pointing to the position with the smallest rate-distortion cost among the at least one search position, the at least one first position, the initial position, the at least one second position and the unsearched position is determined as the second motion parameter; wherein the unsearched position includes the initial position and the at least one co-location position except the at least one search position and the initial position.

[0276] In some embodiments, the range of the second search area is the same as the range of the first search area.

[0277] In some embodiments, the determining unit 520 is specifically configured to:

[0278] determining a first search distance;

[0279] Based on the first search distance, the at least one first position is searched within the first search area in a grid search manner.

[0280] In some embodiments, the determining unit 520 is specifically configured to:

[0281] The first search distance is determined based on a first distance between the arbitrary search position and the initial position.

[0282] In some embodiments, the first distance is positively correlated with the first search distance.

[0283] In some embodiments, the determining unit 520 is specifically configured to:

[0284] The first search distance is determined based on a rate-distortion cost corresponding to any one of the search positions.

[0285] In some embodiments, the rate-distortion cost corresponding to any one search position is positively correlated with the first search distance.

[0286] In some embodiments, the determining unit 520 is specifically configured to:

[0287] The first search distance is determined based on a first similarity between the image block corresponding to the arbitrary search position and the current block.

[0288] In some embodiments, the first similarity is negatively correlated with the first search distance.

[0289] In some embodiments, the determining unit 520 is specifically configured to:

[0290] determining at least one macropixel within a search range of the at least one co-located position;

[0291] In any one of the at least one macropixel, a position that is the same as the initial position in the initial macropixel is determined as the collocated position in the at least one collocated position.

[0292] It should be understood that the device embodiment of the encoder and the method embodiment of the encoding method can correspond to each other, and similar descriptions can refer to the method embodiment. To avoid repetition, they are not described here. Specifically, the encoder 500 shown in Figure 13 can correspond to the corresponding subject in the encoding method 400 of the embodiment of the present application, and the aforementioned and other operations and / or functions of the various units in the encoder 500 are respectively for implementing the corresponding processes in various methods such as the encoding method 400.

[0293] It should also be understood that the various units in the encoder 500 that the embodiment of the present application is related to are divided based on logical functions. In practical applications, the function of a unit can also be realized by multiple units, or the function of multiple units is realized by one unit, or even, these functions can also be assisted by one or more other units. For example, part or all of the encoder 500 is merged into one or several other units. For another example, a certain (some) unit in the encoder 500 can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effect of the embodiment of the application. For another example, the encoder 500 can also include other units. In practical applications, these functions can also be assisted by other units and can be realized by the collaboration of multiple units.

[0294] According to another embodiment of the present application, the encoder 500 involved in the embodiment of the present application can be constructed by running a computer program (including program code) capable of executing each step involved in the corresponding method on a general-purpose computing device of a general-purpose computer including processing elements and storage elements such as a central processing unit (CPU), a random access memory medium (RAM), and a read-only memory medium (ROM), and realizing the encoding method of the embodiment of the present application. The computer program can be recorded on, for example, a computer-readable storage medium, and loaded into an electronic device through a computer-readable storage medium, and run therein to realize the corresponding method of the embodiment of the present application. In other words, the units involved above can be implemented in hardware form, or can be implemented by instructions in the form of software, or can be implemented in the form of a combination of hardware and software. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the integrated logic circuit of the hardware in the processor and / or the instructions in the form of software, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as the execution of the hardware decoding processor, or the execution is completed by the hardware and software combination in the decoding processor. Optionally, the software can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, and a register. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above-mentioned method embodiment in combination with its hardware.

[0295] FIG14 is a schematic structural diagram of an electronic device 600 provided in an embodiment of the present application.

[0296] As shown in Figure 14, the electronic device 600 includes at least a processor 610 and a computer-readable storage medium 620. The processor 610 and the computer-readable storage medium 620 may be connected via a bus or other means. The computer-readable storage medium 620 is used to store a computer program 621, which includes computer instructions. The processor 610 is used to execute the computer instructions stored in the computer-readable storage medium 620. The processor 610 is the computing core and control core of the electronic device 600 and is suitable for implementing one or more computer instructions, specifically loading and executing one or more computer instructions to implement the corresponding method flow or corresponding function.

[0297] For example, the processor 610 may also be referred to as a central processing unit (CPU). The processor 610 may include, but is not limited to, a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, discrete hardware components, and the like.

[0298] Exemplarily, the computer-readable storage medium 620 may be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it may be at least one computer-readable storage medium located away from the aforementioned processor 610. Specifically, the computer-readable storage medium 620 includes, but is not limited to: volatile memory and / or non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0299] Exemplarily, the electronic device 600 may be a decoder or decoding framework involved in an embodiment of the present application; computer instructions are stored in the computer-readable storage medium 620; the computer instructions stored in the computer-readable storage medium 620 are loaded and executed by the processor 610 to implement the corresponding steps in the decoding method provided in an embodiment of the present application; in other words, the computer instructions in the computer-readable storage medium 620 are loaded by the processor 610 and the corresponding steps are executed, which will not be repeated here to avoid repetition.

[0300] According to another aspect of the present application, the present application also provides a coding and decoding system, including the encoder and decoder mentioned above.

[0301] According to another aspect of the present application, the present application also provides a computer-readable storage medium (Memory), which is a memory device in the electronic device 600 for storing programs and data. For example, a computer-readable storage medium 620. It can be understood that the computer-readable storage medium 620 here can include both the built-in storage medium in the electronic device 600 and, of course, the extended storage medium supported by the electronic device 600. The computer-readable storage medium provides a storage space, which stores the operating system of the electronic device 600. In addition, one or more computer instructions suitable for being loaded and executed by the processor 610 are also stored in the storage space. These computer instructions can be one or more computer programs 621 (including program codes).

[0302] According to another aspect of the present application, the present application also provides a computer program product or computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. For example, computer program 621. In this case, the data processing device 600 can be a computer, the processor 610 reads the computer instructions from the computer-readable storage medium 620, and the processor 610 executes the computer instructions so that the computer performs the encoding method provided in the various optional modes mentioned above. In other words, when implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process of the embodiment of the present application is run in whole or in part or the functions of the embodiment of the present application are implemented. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0303] According to another aspect of the present application, the present application further provides a code stream, which may be a code stream generated using the encoding method provided in an embodiment of the present application.

[0304] Those skilled in the art will appreciate that the units and process steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0305] Finally, it should be noted that the above content is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A coding method, characterized in that: include: Performing motion estimation on a current block in a current image to determine a first motion parameter of the current block; The first motion parameter points to an initial position in a reference image of the current image; The initial position is located within an initial macropixel of the reference image; determining at least one co-location position of the initial position based on the position of the initial position within the initial macropixel; determining at least one search position among the initial position and the at least one co-located position; Determine at least one first position other than any one of the at least one search positions in a first search area where the at least one search position is located; the first search area is smaller than or equal to the macro pixel where the at least one search position is located; Based on the at least one search position and the at least one first position, a second motion parameter of the reference block is determined.

2. The method according to claim 1, characterized in that Determining at least one search position among the initial position and the at least one co-location position comprises: The first N positions selected from the initial position and the at least one co-located position in the order of corresponding rate-distortion cost from small to large are determined as the at least one search position.

3. The method according to claim 1, characterized in that Determining at least one search position among the initial position and the at least one co-location position comprises: The first N positions among the initial position and the at least one co-location position selected in descending order of similarity between the corresponding image block and the current block are determined as the at least one search position.

4. The method according to any one of claims 1 to 3, characterized in that The determining, based on the at least one search position and the at least one first position, a second motion parameter of the reference block comprises: A motion parameter pointing to a position with the minimum rate-distortion cost corresponding to the at least one search position and the at least one first position is determined as the second motion parameter.

5. The method according to any one of claims 1 to 3, characterized in that The determining, based on the at least one search position and the at least one first position, a second motion parameter of the reference block comprises: The motion parameter pointing to the position with the smallest rate-distortion cost corresponding to the at least one search position, the at least one first position and the unsearched position is determined as the second motion parameter; wherein the unsearched position includes the initial position and the at least one co-location position except the at least one search position.

6. The method according to claim 4 or 5, characterized in that: The at least one search position includes the initial position.

7. The method according to any one of claims 1 to 3, characterized in that The determining, based on the at least one search position and the at least one first position, a second motion parameter of the reference block comprises: If the at least one search position does not include the initial position, determining at least one second position other than the initial position in a second search area where the initial position is located; the second search area is smaller than or equal to the initial macropixel; The second motion parameter is determined based on the at least one search position, the at least one first position, the initial position, and the at least one second position.

8. The method according to claim 7, characterized in that The determining the second motion parameter based on the at least one search position, the at least one first position, the initial position and the at least one second position comprises: The motion parameter pointing to the position with the smallest rate-distortion cost among the at least one search position, the at least one first position, the initial position and the at least one second position is determined as the second motion parameter.

9. The method according to claim 7, characterized in that: The determining the second motion parameter based on the at least one search position, the at least one first position, the initial position and the at least one second position comprises: The motion parameter pointing to the position with the smallest rate-distortion cost corresponding to the at least one search position, the at least one first position, the initial position, the at least one second position and the unsearched position is determined as the second motion parameter; wherein the unsearched position includes the initial position and the at least one co-location position excluding the at least one search position and the initial position.

10. The method according to any one of claims 7 to 9, characterized in that The range of the second search area is the same as the range of the first search area.

11. The method according to any one of claims 1 to 10, characterized in that The determining, within the first search area where any one of the at least one search positions is located, at least one first position other than the any one search position comprises: determining a first search distance; Based on the first search interval, the at least one first position is searched within the first search area in a grid search manner.

12. The method according to claim 11, characterized in that The determining of the first search distance comprises: The first search distance is determined based on a first distance between the any one search position and the initial position.

13. The method according to claim 12, characterized in that The first distance is positively correlated with the first search interval.

14. The method according to claim 11, characterized in that The determining of the first search distance comprises: The first search distance is determined based on a rate-distortion cost corresponding to any one of the search positions.

15. The method according to claim 14, characterized in that The rate-distortion cost corresponding to any one of the search positions is positively correlated with the first search distance.

16. The method according to claim 11, characterized in that The determining of the first search distance comprises: The first search distance is determined based on a first similarity between the image block corresponding to any one of the search positions and the current block.

17. The method according to claim 16, characterized in that The first similarity is negatively correlated with the first search distance.

18. The method according to any one of claims 1 to 17, characterized in that The determining, based on the position of the initial position within the initial macropixel, at least one co-location position of the initial position comprises: Determining at least one macropixel within a search range of the at least one co-located position; In any one of the at least one macropixel, a position that is the same as the position of the initial position in the initial macropixel is determined as the co-location position in the at least one co-location position.

19. The method according to any one of claims 1 to 18, characterized in that The current image and the reference image of the current image are light field images.

20. An encoder, characterized in that: include: an estimating unit, configured to perform motion estimation on a current block in a current image and determine a first motion parameter of the current block; The first motion parameter points to an initial position in a reference image of the current image; the initial position is located within an initial macropixel of the reference image; Identify units for: determining at least one co-location position of the initial position based on the position of the initial position within the initial macropixel; determining at least one search position among the initial position and the at least one co-located position; Determine at least one first position other than any one of the at least one search positions in a first search area where the at least one search position is located; the first search area is smaller than or equal to the macro pixel where the at least one search position is located; Based on the at least one search position and the at least one first position, a second motion parameter of the reference block is determined.

21. An electronic device, characterized in that: include: a processor adapted to execute a computer program; A computer-readable storage medium having a computer program stored therein, wherein the computer program, when executed by the processor, implements the method according to any one of claims 1 to 19.

22. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 19.

23. A computer program product comprising a computer program / instructions, characterized in that The computer program / instructions, when executed by a processor, implement the method according to any one of claims 1 to 19.

24. A code stream, characterized in that The code stream is a code stream generated by the method according to any one of claims 1 to 19.