CN112738524B - Image encoding method, image encoding device, storage medium, and electronic apparatus - Google Patents

Image encoding method, image encoding device, storage medium, and electronic apparatus Download PDF

Info

Publication number
CN112738524B
CN112738524B CN202110364582.1A CN202110364582A CN112738524B CN 112738524 B CN112738524 B CN 112738524B CN 202110364582 A CN202110364582 A CN 202110364582A CN 112738524 B CN112738524 B CN 112738524B
Authority
CN
China
Prior art keywords
block
image
current image
preset
image block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110364582.1A
Other languages
Chinese (zh)
Other versions
CN112738524A (en
Inventor
曹亚曦
俞鸣园
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huachuang Video Signal Technology Co Ltd
Original Assignee
Zhejiang Huachuang Video Signal Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Huachuang Video Signal Technology Co Ltd filed Critical Zhejiang Huachuang Video Signal Technology Co Ltd
Priority to CN202110364582.1A priority Critical patent/CN112738524B/en
Publication of CN112738524A publication Critical patent/CN112738524A/en
Application granted granted Critical
Publication of CN112738524B publication Critical patent/CN112738524B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding

Abstract

The present disclosure relates to an image encoding method, an apparatus, a storage medium and an electronic device, wherein a plurality of candidate blocks corresponding to a current image block of an image to be encoded in a video image are determined, the candidate blocks include an image block having the same size and the same position as the current image block and an image block having the same size and a preset interval from the current image block in a preset image associated with the image to be encoded; determining a target candidate block from a plurality of candidate blocks; acquiring a characteristic difference between the image characteristics of a target candidate block and the image characteristics of a current image block, and the compensation cost of motion compensation of the current image block and the target candidate block; under the condition that the characteristic difference and the compensation cost meet the preset vector acquisition condition, determining a motion vector corresponding to the current image block according to the target candidate block and the current image block; and coding the image to be coded according to the motion vector. Therefore, the complexity of video coding can be reduced, and the quality of the video conference can be improved.

Description

Image encoding method, image encoding device, storage medium, and electronic apparatus
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image encoding method, an image encoding device, a storage medium, and an electronic device.
Background
The video coding mainly comprises image acquisition, prediction, transformation quantization, entropy coding and the like, wherein the prediction comprises intra-frame prediction and inter-frame prediction, and because stronger time domain correlation exists in a video conference scene, the inter-frame prediction can remove the redundancy of video images in time, so that the data volume can be saved, and the purpose of video compression is achieved.
At present, the main video coding standard adopts a block-based motion compensation technology in an inter-frame prediction part, motion compensation needs to be performed on a block to be coded and all candidate blocks, and a candidate block with the minimum compensation cost is finally determined as an optimal matching block, so that the calculation complexity of an encoder is increased, the video coding efficiency is low, and the quality of a video conference is influenced.
Disclosure of Invention
In order to solve the above problems, the present disclosure provides an image encoding method, apparatus, storage medium, and electronic device.
In a first aspect, the present disclosure provides an image encoding method, the method comprising: determining a plurality of candidate blocks corresponding to a current image block of an image to be coded in a video image, wherein the candidate blocks comprise an image block which is in the same size as the current image block and is in the same position as the current image block in a preset image associated with the image to be coded, and an image block which is in the same size as the current image block and is away from the current image block at a preset interval;
determining a target candidate block from the plurality of candidate blocks;
acquiring a characteristic difference between the image characteristics of the target candidate block and the image characteristics of the current image block, and the compensation cost of motion compensation of the current image block and the target candidate block;
determining a motion vector corresponding to the current image block according to the target candidate block and the current image block under the condition that the feature difference and the compensation cost meet a preset vector acquisition condition, wherein the preset vector acquisition condition comprises that the feature difference is smaller than or equal to a feature difference threshold, and the compensation cost is smaller than or equal to a compensation cost threshold;
and coding the image to be coded according to the motion vector.
Optionally, the determining a target candidate block from the plurality of candidate blocks comprises:
and taking any candidate block of the candidate blocks except a preset candidate block as the target candidate block, wherein the preset candidate block is a candidate block with the same position as the current image block in an image closest to the current image block.
Optionally, the method further comprises:
under the condition that the feature difference and the compensation cost do not meet the preset vector acquisition condition, continuously determining a new target candidate block from the residual candidate blocks, acquiring a feature difference between the image feature of the new target candidate block and the image feature of the current image block, and the compensation cost for motion compensation of the current image block and the target candidate block, until under the condition that the feature difference and the compensation cost meet the preset vector acquisition condition, determining a motion vector corresponding to the current image block according to the new target candidate block and the current image block, and encoding the image to be encoded according to the motion vector;
wherein the remaining candidate blocks are candidate blocks of the plurality of candidate blocks other than the preset candidate block and not used as the target candidate block for determining the motion vector.
Optionally, the characteristic difference threshold is determined by:
and taking a feature difference value between the image features of the current image block and the image features of the preset candidate blocks as the feature difference value threshold.
Optionally, the compensation cost threshold is determined by:
acquiring a reference compensation cost for motion compensation of the preset candidate block and the current image block;
and taking the product of the reference compensation cost and a preset cost coefficient as the compensation cost threshold.
Optionally, the image features comprise one or more of gradient magnitude, texture direction and texture complexity.
In a second aspect, the present disclosure provides an image encoding apparatus, the apparatus comprising:
the candidate block determining module is used for determining a plurality of candidate blocks corresponding to a current image block of an image to be coded in a video image, wherein the candidate blocks comprise an image block which is in the same size as the current image block and is in the same position as the current image block in a preset image associated with the image to be coded and an image block which is in the same size as the current image block and is away from the current image block by a preset interval;
a target candidate block determination module for determining a target candidate block from a plurality of the candidate blocks;
the characteristic obtaining module is used for obtaining a characteristic difference value between the image characteristics of the target candidate block and the image characteristics of the current image block and the compensation cost of motion compensation of the current image block and the target candidate block;
a motion vector obtaining module, configured to determine a motion vector corresponding to the current image block according to the target candidate block and the current image block when the feature difference and the compensation cost meet a preset vector obtaining condition, where the preset vector obtaining condition includes that the feature difference is less than or equal to a feature difference threshold, and the compensation cost is less than or equal to a compensation cost threshold;
and the first coding module is used for coding the image to be coded according to the motion vector.
Optionally, the target candidate block determining module is specifically configured to:
and taking any candidate block of the candidate blocks except a preset candidate block as the target candidate block, wherein the preset candidate block is a candidate block with the same position as the current image block in an image closest to the current image block.
Optionally, the apparatus further comprises:
a second encoding module, configured to, when the feature difference and the compensation cost do not satisfy the preset vector acquisition condition, continue to determine a new target candidate block from remaining candidate blocks, and obtain a feature difference between an image feature of the new target candidate block and an image feature of the current image block, and a compensation cost for performing motion compensation on the current image block and the target candidate block, until when the feature difference and the compensation cost satisfy the preset vector acquisition condition, determine, according to the new target candidate block and the current image block, a motion vector corresponding to the current image block, and encode the image to be encoded according to the motion vector;
wherein the remaining candidate blocks are candidate blocks of the plurality of candidate blocks other than the preset candidate block and not used as the target candidate block for determining the motion vector.
Optionally, the motion vector obtaining module is further configured to:
and taking a feature difference value between the image features of the current image block and the image features of the preset candidate blocks as the feature difference value threshold.
Optionally, the motion vector obtaining module is further configured to:
acquiring a reference compensation cost for motion compensation of the preset candidate block and the current image block;
and taking the product of the reference compensation cost and a preset cost coefficient as the compensation cost threshold.
Optionally, the image features comprise one or more of gradient magnitude, texture direction and texture complexity.
In a third aspect, the present disclosure provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect described above.
In a fourth aspect, the present disclosure provides an electronic device comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of the first aspect.
According to the technical scheme, a plurality of candidate blocks corresponding to a current image block of an image to be coded in a video image are determined, wherein the candidate blocks comprise an image block which is in the same size as the current image block and is in the same position as the current image block in a preset image associated with the image to be coded and an image block which is in the same size as the current image block and is away from the current image block by a preset interval; determining a target candidate block from the plurality of candidate blocks; acquiring a characteristic difference between the image characteristics of the target candidate block and the image characteristics of the current image block, and the compensation cost of motion compensation of the current image block and the target candidate block; determining a motion vector corresponding to the current image block according to the target candidate block and the current image block under the condition that the feature difference and the compensation cost meet a preset vector acquisition condition, wherein the preset vector acquisition condition comprises that the feature difference is smaller than or equal to a feature difference threshold, and the compensation cost is smaller than or equal to a compensation cost threshold; and coding the image to be coded according to the motion vector. That is to say, the present disclosure does not need to obtain the compensation cost of motion compensation between each candidate block and the current image block, and when the feature difference between the image feature of the target candidate block and the image feature of the current image block is less than or equal to the feature difference threshold, and the compensation cost of motion compensation between the current image block and the target candidate block is less than or equal to the compensation cost threshold, the target candidate block may be directly used as the best matching block of the current image block, so that the computation complexity of the encoder may be reduced, the efficiency of video encoding may be improved, and the quality of the video conference may be improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a flowchart illustrating an image encoding method according to an exemplary embodiment of the present disclosure;
FIG. 2 is a flow chart illustrating another image encoding method according to an exemplary embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an image encoding apparatus according to an exemplary embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of another image encoding apparatus shown in an exemplary embodiment of the present disclosure;
FIG. 5 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
In the description that follows, the terms "first," "second," and the like are used for descriptive purposes only and are not intended to indicate or imply relative importance nor order to be construed.
First, an application scenario of the present disclosure will be explained. The video coding method and the video coding device can be applied to the coding process of the video images, the video images can be compressed into video code streams through video coding, and the data volume of videos is reduced, so that the network bandwidth in the video transmission process can be reduced, and the storage space is saved. In the process of video coding, because the brightness and the chroma of the image pixel points adjacent in time are relatively close and have strong correlation, the inter-frame prediction obtains a matching block which is closest to the current image block in a reference frame by methods such as motion search and the like, and records the motion information, such as a motion vector, between the current image block and the matching block.
In the related art, the Motion Vector of the current image Block may be obtained through TMVP (Temporal Motion Vector Prediction), ATMVP (Advanced Temporal Motion Vector Prediction), ETMVP (Enhanced Temporal Motion Vector Prediction), or Sub-Block Temporal Motion Vector Prediction) techniques, but all of the above techniques need to perform Motion compensation on the current image Block and each candidate Block, and finally determine the candidate Block with the smallest compensation cost as the best matching Block, so that the computational complexity of the encoder is increased, resulting in low efficiency of video encoding, thereby affecting the quality of the video conference.
In order to solve the above technical problem, the present disclosure provides an image encoding method, an apparatus, a storage medium, and an electronic device, where the image encoding method does not need to obtain a compensation cost for motion compensation of each candidate block and a current image block, and when a feature difference between an image feature of a target candidate block and an image feature of the current image block is less than or equal to a feature difference threshold and a compensation cost for motion compensation of the current image block and the target candidate block is less than or equal to a compensation cost threshold, the target candidate block may be directly used as a best matching block for the current image block, so that a computational complexity of an encoder may be reduced, an efficiency of video encoding may be improved, and a quality of a video conference may be improved.
The present disclosure is illustrated below with reference to specific examples.
Fig. 1 is a flowchart illustrating an image encoding method according to an exemplary embodiment of the present disclosure, and as shown in fig. 1, the method may include:
s101, determining a plurality of candidate blocks corresponding to a current image block of an image to be coded in a video image.
The candidate block may include a predetermined image associated with the image to be encoded, an image block having the same size and the same position as the current image block, and an image block having the same size and a predetermined interval from the current image block.
The video image may be a video to be transmitted during a video conference, the image to be encoded may be any frame image in the video image, and the current image block may be any image block in the image to be encoded. Taking the ETMVP technique as an example, the candidate block may include a co-located block having the same size and the same position as the current image block, and if the preset interval is 1, the candidate block also includes top, bottom, left, and right 4 image blocks adjacent to the co-located block.
In this step, after determining the image to be encoded, a preset image associated with the image to be encoded may be obtained first, where the preset image may be an encoded image closest to the image to be encoded in the video image, or multiple encoded images closest to the image to be encoded in the video image. After the preset image is obtained, the size of the current image block may be determined, and then a plurality of candidate blocks corresponding to the current image block may be determined in the preset image. For example, candidate blocks with the same size and the same position as the current image block in the preset image may be determined, and then image blocks with the same size and the same distance as the current image block and the preset interval from the current image block may be determined, where the preset interval may be determined according to a requirement on the encoding accuracy of an encoder, and an encoder with a higher requirement on the encoding accuracy may set a larger preset interval, for example, the preset interval may be 2, an encoder with a lower requirement on the encoding accuracy may set a smaller preset interval, for example, the preset interval may be 1, which is not limited by the present disclosure.
It should be noted that, in the case that the number of the preset images is more and the preset interval is larger, the encoding process is more complicated, and the encoding efficiency is affected, so that the preset images and the preset interval may be set according to a specific application scenario. After obtaining the plurality of candidate blocks, a candidate block list may be created based on the plurality of candidate blocks. Illustratively, continuing with the above-described ETMVP technique as an example, the candidate block list may be created in a preset list order, which may be a co-located block, a candidate block located above the co-located block, a candidate block located below the co-located block, a candidate block located to the left of the co-located block, and a candidate block located to the right of the co-located block. The list order may be other preset orders, and the disclosure is not limited thereto.
And S102, determining a target candidate block from the plurality of candidate blocks.
In this step, after determining a plurality of candidate blocks corresponding to the current image block, any candidate block may be determined as the target candidate block from the plurality of candidate blocks. For example, any candidate block may be selected from the candidate block list as the target candidate block, or candidate blocks may be selected from the candidate block list as the target candidate block in sequence.
S103, acquiring a feature difference between the image features of the target candidate block and the current image block, and a compensation cost for motion compensation of the current image block and the target candidate block.
Wherein the image features may include one or more of gradient magnitude, texture direction, and texture complexity.
In this step, after the target candidate block is determined, a feature difference between the image feature of the target candidate block and the image feature of the current image block may be obtained by a method in the prior art, which is not described herein again. For example, if the image feature includes a texture complexity, a complexity difference between the texture complexity of the target candidate block and the texture complexity of the current image block may be obtained; if the image feature includes a texture direction and a texture complexity, a direction difference between the texture direction of the target candidate block and the texture direction of the current image block may be obtained first, and then a complexity difference between the texture complexity of the target candidate block and the texture complexity of the current image block may be obtained, where the finally obtained feature difference includes the direction difference and the complexity difference.
Further, the compensation cost for motion compensation of the current image block and the target candidate block may be obtained by a method in the prior art, which is not described herein again.
And S104, under the condition that the characteristic difference and the compensation cost meet the preset vector acquisition condition, determining a motion vector corresponding to the current image block according to the target candidate block and the current image block.
The preset vector obtaining condition may include that the feature difference is smaller than or equal to a feature difference threshold, and the compensation cost is smaller than or equal to a compensation cost threshold. The feature difference threshold and the compensation cost threshold may be preset empirically, and in the case that the image feature includes a plurality of features, the feature difference threshold also includes a plurality of features, for example, if the image feature includes a texture direction and a texture complexity, the feature difference threshold includes a direction difference threshold and a complexity difference threshold.
In this step, after obtaining a feature difference between the image features of the target candidate block and the image features of the current image block and a compensation cost for performing motion compensation on the current image block and the target candidate block, the feature difference and the feature difference threshold may be compared, and the compensation cost threshold may be compared when the feature difference is smaller than or equal to the feature difference threshold. For example, if the image feature includes texture complexity, the obtained complexity difference may be compared with a complexity difference threshold, and the compensation cost is compared with the compensation cost threshold when the complexity difference is smaller than or equal to the complexity difference threshold; if the image feature includes a texture direction and a texture complexity, the direction difference and the direction difference threshold may be compared, and then the complexity difference and the complexity difference threshold are compared, and then the compensation cost and the compensation cost threshold are compared when the direction difference is smaller than or equal to the direction difference threshold and the complexity difference is smaller than or equal to the complexity difference threshold.
Further, when the compensation cost is less than or equal to the compensation cost threshold, the target candidate block may be used as a best matching block for the current image block, and a motion vector corresponding to the current image block is determined according to the target candidate block and the current image block by a method in the prior art, which is not described herein again.
It should be noted that, the present disclosure may compare the feature difference value with the feature difference threshold value, and further compare the compensation cost with the compensation cost threshold value when the feature difference value is smaller than or equal to the feature difference threshold value; the compensation cost and the compensation cost threshold may be compared first, and the feature difference threshold are compared when the compensation cost is less than or equal to the compensation cost threshold, which is not limited in the present disclosure.
And S105, coding the image to be coded according to the motion vector.
In this step, after determining the motion vector corresponding to the current image block, the image to be encoded may be encoded according to the motion vector by a method in the prior art, which is not described herein again.
By adopting the method, the compensation cost of motion compensation of each candidate block and the current image block is not required to be obtained, and the target candidate block can be directly used as the best matching block of the current image block under the condition that the feature difference between the image features of the target candidate block and the image features of the current image block is less than or equal to the feature difference threshold and the compensation cost of motion compensation of the current image block and the target candidate block is less than or equal to the compensation cost threshold, so that the calculation complexity of an encoder can be reduced, the efficiency of video encoding is improved, and the quality of a video conference is improved.
Fig. 2 is a flowchart illustrating another image encoding method according to an exemplary embodiment of the present disclosure, which may include, as shown in fig. 2:
s201, determining a plurality of candidate blocks corresponding to a current image block of an image to be coded in a video image.
The candidate block includes a predetermined image associated with the image to be encoded, an image block having the same size and the same position as the current image block, and an image block having the same size and a predetermined interval from the current image block.
The video image may be a video to be transmitted during a video conference, the image to be encoded may be any frame image in the video image, and the current image block may be any image block in the image to be encoded. Taking the ETMVP technique as an example, the candidate block may include a co-located block having the same size and the same position as the current image block, and if the preset interval is 1, the candidate block also includes top, bottom, left, and right 4 image blocks adjacent to the co-located block.
It should be noted that, after obtaining the plurality of candidate blocks, a candidate block list may be created based on the plurality of candidate blocks. Illustratively, continuing with the above-described ETMVP technique as an example, the candidate block list may be created in a preset list order, which may be a co-located block, a candidate block located above the co-located block, a candidate block located below the co-located block, a candidate block located to the left of the co-located block, and a candidate block located to the right of the co-located block. The list order may be other preset orders, and the disclosure is not limited thereto.
S202, any candidate block except the preset candidate block in the multiple candidate blocks is used as a target candidate block.
The preset candidate block may be a candidate block having the same position as the current image block in an image closest to the current image block. For example, the preset candidate block may be the first candidate block in the candidate block list.
It should be noted that, in consideration of the fact that the encoded image closest to the image to be encoded has stronger correlation with the image to be encoded, the candidate block with the same position as the current image block in the image closest to the current image block may be used as the preset candidate block, and the present disclosure may also use other candidate blocks in the plurality of candidate blocks as the preset candidate block, which is not limited by the present disclosure.
S203, using a feature difference between the image feature of the current image block and the image feature of the preset candidate block as the feature difference threshold.
Wherein the image features may include one or more of gradient magnitude, texture direction, and texture complexity.
In this step, after the preset candidate block is determined, a feature difference between the image feature of the current image block and the image feature of the preset candidate block may be obtained by a method in the prior art, which is not described herein again, and the feature difference is used as the feature difference threshold.
It should be noted that, in the case where the image feature includes a plurality of image features, a feature difference threshold value corresponding to each image feature needs to be determined. For example, in the case that the image feature includes a texture direction and a texture complexity, a direction difference threshold corresponding to the texture direction and a complexity difference threshold corresponding to the texture complexity need to be determined.
S204, obtaining the reference compensation cost of the motion compensation of the preset candidate block and the current image block.
And S205, taking the product of the reference compensation cost and a preset cost coefficient as the compensation cost threshold.
The preset cost coefficient may be preset according to experience, for example, the preset cost coefficient may be determined according to a requirement for an accuracy rate of an encoder, and for an encoder with a lower accuracy rate requirement, a larger preset cost coefficient may be set, for example, the preset cost coefficient may be 0.6, and for an encoder with a higher accuracy rate requirement, a smaller preset cost coefficient may be set, for example, the preset cost coefficient may be 0.5, which is not limited by the present disclosure.
S206, acquiring a feature difference between the image features of the target candidate block and the current image block, and a compensation cost for motion compensation of the current image block and the target candidate block.
S207, determining whether the feature difference value and the compensation cost meet a preset vector acquisition condition, executing the step S208-the step S209 under the condition that the feature difference value and the compensation cost meet the preset vector acquisition condition, and executing the step S210 under the condition that the feature difference value and the compensation cost do not meet the preset vector acquisition condition.
The preset vector obtaining condition includes that the feature difference is smaller than or equal to a feature difference threshold, and the compensation cost is smaller than or equal to a compensation cost threshold.
S208, determining a motion vector corresponding to the current image block according to the target candidate block and the current image block.
And S209, coding the image to be coded according to the motion vector.
In this step, after determining the motion vector corresponding to the current image block, the image to be encoded may be encoded according to the motion vector by a method in the prior art, which is not described herein again.
S210, continuously determining a new target candidate block from the remaining candidate blocks, and obtaining a feature difference between image features of the new target candidate block and image features of the current image block, and a compensation cost for motion compensation of the current image block and the target candidate block, until the feature difference and the compensation cost meet the preset vector obtaining condition, determining a motion vector corresponding to the current image block according to the new target candidate block and the current image block, and encoding the image to be encoded according to the motion vector.
The remaining candidate block is a candidate block of the candidate blocks, which is not determined as the target candidate block, except for the predetermined candidate block, and may be, for example, a candidate block of the candidate blocks, which is not performed in step S206 except for the predetermined candidate block.
In this step, when the feature difference and the compensation cost do not satisfy the preset vector obtaining condition, it indicates that the target candidate block cannot be used as a best matching block for the current image block, a new target candidate block may be determined from the remaining candidate blocks, a feature difference between image features of the new target candidate block and image features of the current image block and a compensation cost for performing motion compensation on the current image block and the new target candidate block may be obtained, and when the feature difference and the compensation cost of the new target candidate block satisfy the preset vector obtaining condition, a motion vector corresponding to the current image block may be determined according to the new target candidate block and the current image block, and the image to be encoded may be encoded according to the motion vector. In the case that the feature difference and the compensation cost of the new target candidate block do not satisfy the preset vector acquisition condition, the method may be referred to, and a new target candidate block may be determined from the remaining candidate blocks, and the above operation may be performed until the number of candidate blocks in the remaining candidate blocks is 0.
It should be noted that, when there is no target candidate block that satisfies the vector acquisition condition in the candidate blocks, a motion vector corresponding to the current image block may be determined according to the preset candidate block and the current image block, and the image to be encoded is encoded according to the motion vector.
By adopting the method, the compensation cost of motion compensation of each candidate block and the current image block is not required to be obtained, and the target candidate block can be directly used as the best matching block of the current image block under the conditions that the characteristic difference value between the image characteristics of the target candidate block and the image characteristics of the current image block and the compensation cost of motion compensation of the current image block and the target candidate block meet the preset vector obtaining condition, so that the calculation complexity of an encoder can be reduced, the video encoding efficiency is improved, and the quality of a video conference is improved. Furthermore, the feature difference threshold and the compensation cost threshold are determined according to a preset candidate block and the current image block, and the preset candidate block and the current image block have a stronger association, so that a target candidate block which meets the preset vector acquisition condition and is determined according to the feature difference threshold and the compensation cost threshold has a higher matching degree with the current image block, thereby further improving the accuracy of video coding and improving the quality of a video conference.
Fig. 3 is a schematic structural diagram of an image encoding apparatus according to an exemplary embodiment of the present disclosure, and as shown in fig. 3, the apparatus may include:
a candidate block determining module 301, configured to determine a plurality of candidate blocks corresponding to a current image block of an image to be encoded in a video image, where the candidate blocks include a preset image associated with the image to be encoded, an image block having a same size and a same position as the current image block, and an image block having a same size and a preset interval from the current image block;
a target candidate block determination module 302 for determining a target candidate block from a plurality of the candidate blocks;
a feature obtaining module 303, configured to obtain a feature difference between an image feature of the target candidate block and an image feature of the current image block, and a compensation cost for performing motion compensation on the current image block and the target candidate block;
a motion vector obtaining module 304, configured to determine a motion vector corresponding to the current image block according to the target candidate block and the current image block when the feature difference and the compensation cost meet a preset vector obtaining condition, where the preset vector obtaining condition includes that the feature difference is less than or equal to a feature difference threshold, and the compensation cost is less than or equal to a compensation cost threshold;
a first encoding module 305, configured to encode the image to be encoded according to the motion vector.
Optionally, the target candidate block determining module 302 is specifically configured to:
any candidate block of the candidate blocks except a preset candidate block is taken as the target candidate block, wherein the preset candidate block is a candidate block with the same position as the current image block in an image closest to the current image block.
Optionally, fig. 4 is a schematic structural diagram of another image encoding apparatus according to an exemplary embodiment of the disclosure, and as shown in fig. 4, the apparatus further includes:
a second encoding module 306, configured to, when the feature difference and the compensation cost do not satisfy the preset vector acquisition condition, continue to determine a new target candidate block from the remaining candidate blocks, and obtain a feature difference between image features of the new target candidate block and image features of the current image block, and a compensation cost for performing motion compensation on the current image block and the target candidate block, until, when the feature difference and the compensation cost satisfy the preset vector acquisition condition, a motion vector corresponding to the current image block is determined according to the new target candidate block and the current image block, and the image to be encoded is encoded according to the motion vector;
the remaining candidate blocks are candidate blocks of the plurality of candidate blocks, except the predetermined candidate block, for which no motion vector is determined as the target candidate block.
Optionally, the motion vector obtaining module 304 is further configured to:
and taking the feature difference between the image features of the current image block and the image features of the preset candidate block as the feature difference threshold.
Optionally, the motion vector obtaining module 304 is further configured to:
obtaining a reference compensation cost for motion compensation of the preset candidate block and the current image block;
and taking the product of the reference compensation cost and a preset cost coefficient as the compensation cost threshold.
Optionally, the image features include one or more of gradient magnitude, texture direction, and texture complexity.
By the device, the compensation cost of motion compensation of each candidate block and the current image block is not required to be obtained, and the target candidate block can be directly used as the best matching block of the current image block under the condition that the feature difference between the image features of the target candidate block and the image features of the current image block is less than or equal to the feature difference threshold and the compensation cost of motion compensation of the current image block and the target candidate block is less than or equal to the compensation cost threshold, so that the calculation complexity of an encoder can be reduced, the efficiency of video encoding is improved, and the quality of a video conference is improved.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a block diagram illustrating an electronic device 500 in accordance with an example embodiment. As shown in fig. 5, the electronic device 500 may include: a processor 501 and a memory 502. The electronic device 500 may also include one or more of a multimedia component 503, an input/output (I/O) interface 504, and a communication component 505.
The processor 501 is configured to control the overall operation of the electronic device 500, so as to complete all or part of the steps in the image encoding method. The memory 502 is used to store various types of data to support operation at the electronic device 500, such as instructions for any application or method operating on the electronic device 500 and application-related data, such as contact data, messaging, pictures, audio, video, and so forth. The Memory 502 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia component 503 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 502 or transmitted through the communication component 505. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 504 provides an interface between the processor 501 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 505 is used for wired or wireless communication between the electronic device 500 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 505 may thus comprise: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the image encoding method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the image encoding method described above when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure. It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (11)

1. An image encoding method, characterized in that the method comprises:
determining a plurality of candidate blocks corresponding to a current image block of an image to be coded in a video image, wherein the candidate blocks comprise an image block which is in the same size as the current image block and is in the same position as the current image block in a preset image associated with the image to be coded, and an image block which is in the same size as the current image block and is away from the current image block at a preset interval;
determining a target candidate block from the plurality of candidate blocks;
acquiring a characteristic difference between the image characteristics of the target candidate block and the image characteristics of the current image block, and the compensation cost of motion compensation of the current image block and the target candidate block;
determining a motion vector corresponding to the current image block according to the target candidate block and the current image block under the condition that the feature difference and the compensation cost meet a preset vector acquisition condition, wherein the preset vector acquisition condition comprises that the feature difference is smaller than or equal to a feature difference threshold, and the compensation cost is smaller than or equal to a compensation cost threshold;
and coding the image to be coded according to the motion vector.
2. The method of claim 1, wherein determining a target candidate block from the plurality of candidate blocks comprises:
and taking any candidate block of the candidate blocks except a preset candidate block as the target candidate block, wherein the preset candidate block is a candidate block with the same position as the current image block in an image closest to the current image block.
3. The method of claim 2, further comprising:
under the condition that the feature difference and the compensation cost do not meet the preset vector acquisition condition, continuously determining a new target candidate block from the residual candidate blocks, acquiring a feature difference between the image feature of the new target candidate block and the image feature of the current image block, and the compensation cost for motion compensation of the current image block and the target candidate block, until under the condition that the feature difference and the compensation cost meet the preset vector acquisition condition, determining a motion vector corresponding to the current image block according to the new target candidate block and the current image block, and encoding the image to be encoded according to the motion vector;
wherein the remaining candidate blocks are candidate blocks of the plurality of candidate blocks other than the preset candidate block and not used as the target candidate block for determining the motion vector.
4. The method of claim 2, wherein the feature difference threshold is determined by:
and taking a feature difference value between the image features of the current image block and the image features of the preset candidate blocks as the feature difference value threshold.
5. The method of claim 2, wherein the penalty cost threshold is determined by:
acquiring a reference compensation cost for motion compensation of the preset candidate block and the current image block;
and taking the product of the reference compensation cost and a preset cost coefficient as the compensation cost threshold.
6. The method of any of claims 1-5, wherein the image features include one or more of gradient magnitude, texture direction, and texture complexity.
7. An image encoding apparatus, characterized in that the apparatus comprises:
the candidate block determining module is used for determining a plurality of candidate blocks corresponding to a current image block of an image to be coded in a video image, wherein the candidate blocks comprise an image block which is in the same size as the current image block and is in the same position as the current image block in a preset image associated with the image to be coded and an image block which is in the same size as the current image block and is away from the current image block by a preset interval;
a target candidate block determination module for determining a target candidate block from a plurality of the candidate blocks;
the characteristic obtaining module is used for obtaining a characteristic difference value between the image characteristics of the target candidate block and the image characteristics of the current image block and the compensation cost of motion compensation of the current image block and the target candidate block;
a motion vector obtaining module, configured to determine a motion vector corresponding to the current image block according to the target candidate block and the current image block when the feature difference and the compensation cost meet a preset vector obtaining condition, where the preset vector obtaining condition includes that the feature difference is less than or equal to a feature difference threshold, and the compensation cost is less than or equal to a compensation cost threshold;
and the first coding module is used for coding the image to be coded according to the motion vector.
8. The apparatus of claim 7, wherein the target candidate block determination module is specifically configured to:
and taking any candidate block of the candidate blocks except a preset candidate block as the target candidate block, wherein the preset candidate block is a candidate block with the same position as the current image block in an image closest to the current image block.
9. The apparatus of claim 8, further comprising:
a second encoding module, configured to, when the feature difference and the compensation cost do not satisfy the preset vector acquisition condition, continue to determine a new target candidate block from remaining candidate blocks, and obtain a feature difference between an image feature of the new target candidate block and an image feature of the current image block, and a compensation cost for performing motion compensation on the current image block and the target candidate block, until when the feature difference and the compensation cost satisfy the preset vector acquisition condition, determine, according to the new target candidate block and the current image block, a motion vector corresponding to the current image block, and encode the image to be encoded according to the motion vector;
wherein the remaining candidate blocks are candidate blocks of the plurality of candidate blocks other than the preset candidate block and not used as the target candidate block for determining the motion vector.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
11. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 6.
CN202110364582.1A 2021-04-06 2021-04-06 Image encoding method, image encoding device, storage medium, and electronic apparatus Active CN112738524B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110364582.1A CN112738524B (en) 2021-04-06 2021-04-06 Image encoding method, image encoding device, storage medium, and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110364582.1A CN112738524B (en) 2021-04-06 2021-04-06 Image encoding method, image encoding device, storage medium, and electronic apparatus

Publications (2)

Publication Number Publication Date
CN112738524A CN112738524A (en) 2021-04-30
CN112738524B true CN112738524B (en) 2021-06-08

Family

ID=75596407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110364582.1A Active CN112738524B (en) 2021-04-06 2021-04-06 Image encoding method, image encoding device, storage medium, and electronic apparatus

Country Status (1)

Country Link
CN (1) CN112738524B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107113442A (en) * 2014-10-31 2017-08-29 三星电子株式会社 Method and apparatus for being encoded/decoded to motion vector
CN108305272A (en) * 2018-02-27 2018-07-20 郑州轻工业学院 A kind of mutation movement method for tracking target based on ALO search
CN111480340A (en) * 2017-10-05 2020-07-31 交互数字Vc控股公司 Improved predictor candidates for motion compensation
CN112153389A (en) * 2019-05-17 2020-12-29 华为技术有限公司 Method and device for inter-frame prediction

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102070719B1 (en) * 2013-01-23 2020-01-30 한국전자통신연구원 Method for inter prediction and apparatus thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107113442A (en) * 2014-10-31 2017-08-29 三星电子株式会社 Method and apparatus for being encoded/decoded to motion vector
CN111480340A (en) * 2017-10-05 2020-07-31 交互数字Vc控股公司 Improved predictor candidates for motion compensation
CN108305272A (en) * 2018-02-27 2018-07-20 郑州轻工业学院 A kind of mutation movement method for tracking target based on ALO search
CN112153389A (en) * 2019-05-17 2020-12-29 华为技术有限公司 Method and device for inter-frame prediction

Also Published As

Publication number Publication date
CN112738524A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
TWI759389B (en) Low-complexity sign prediction for video coding
CN110809887B (en) Method and apparatus for motion vector modification for multi-reference prediction
CN110740329B (en) Video encoding and decoding method and device, computer equipment and storage medium
AU2015213340B2 (en) Video decoder, video encoder, video decoding method, and video encoding method
CN112291571B (en) Video decoding method and device, computer equipment and storage medium
RU2577207C2 (en) Video encoding method and device
US10148947B2 (en) Method and device for determining parameters for encoding or decoding of an image of a video sequence
CN114827597B (en) Video decoding method, device, computer equipment and storage medium
KR102653856B1 (en) Apparatus and method for conditional decoder-side motion vector refinement in video coding
CN110944185B (en) Video decoding method and device, computer equipment and storage medium
CN110730351B (en) Method and device for decoding video and storage medium
CN113545079B (en) Video encoding and decoding method and device
CN116156197A (en) Video decoding method, video encoding method, video decoding device, video encoding method, video encoding device, computer equipment and storage medium
KR102494087B1 (en) Method and apparatus for sub-block motion vector prediction
CN112399183A (en) Method and apparatus for video encoding and decoding
CN113728645A (en) Method and apparatus for motion vector rounding, clipping, and storage for inter prediction based on mantissa-exponent representation
CN110798685B (en) Video decoding method, device, computer equipment and storage medium
WO2019154424A1 (en) Video decoding method, video decoder, and electronic device
KR102609215B1 (en) Video encoders, video decoders, and corresponding methods
CN116156164B (en) Method, apparatus and readable storage medium for decoding video
JP2024014927A (en) Inter prediction method and device
CN113382249A (en) Image/video encoding method, apparatus, system, and computer-readable storage medium
CN112839224B (en) Prediction mode selection method and device, video coding equipment and storage medium
CN112738524B (en) Image encoding method, image encoding device, storage medium, and electronic apparatus
CN113365077B (en) Inter-frame prediction method, encoder, decoder, computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant