CN110572680B - Video decoding and encoding method and device, storage medium, decoder and encoder - Google Patents

Video decoding and encoding method and device, storage medium, decoder and encoder Download PDF

Info

Publication number
CN110572680B
CN110572680B CN201910927988.9A CN201910927988A CN110572680B CN 110572680 B CN110572680 B CN 110572680B CN 201910927988 A CN201910927988 A CN 201910927988A CN 110572680 B CN110572680 B CN 110572680B
Authority
CN
China
Prior art keywords
resolution
prediction mode
block
difference value
predetermined threshold
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
CN201910927988.9A
Other languages
Chinese (zh)
Other versions
CN110572680A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910927988.9A priority Critical patent/CN110572680B/en
Publication of CN110572680A publication Critical patent/CN110572680A/en
Application granted granted Critical
Publication of CN110572680B publication Critical patent/CN110572680B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • 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/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • 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/59Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial sub-sampling or interpolation, e.g. alteration of picture size or resolution
    • 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/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

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

Abstract

The invention discloses a video decoding and encoding method and device, a storage medium, a decoder and an encoder. Wherein the method comprises the following steps: acquiring directional prediction modes of at least two reference blocks in a decoded block, wherein the reference blocks are reference blocks of a block to be decoded; determining a direction prediction mode difference value of the reference block according to the directional prediction modes of at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value; and decoding the block to be decoded by adopting the target resolution. The invention solves the technical problem of poor flexibility in encoding and decoding video frames in the related art.

Description

Video decoding and encoding method and device, storage medium, decoder and encoder
Technical Field
The invention relates to the field of computers, in particular to a video decoding and encoding method and device, a storage medium, a decoder and an encoder.
Background
In the existing video encoding process, the same resolution is generally used for encoding and decoding a frame in video. As shown in fig. 1, if both high resolution encoding and decoding are used for one frame in video, in the case where the bandwidth bits of transmission is relatively small (e.g., smaller than the bandwidth threshold intersection point D shown in fig. 1), the peak signal-to-noise ratio PSNR corresponding to encoding and decoding with high resolution for one frame in video is lower than the peak signal-to-noise ratio PSNR corresponding to encoding and decoding with low resolution for one frame in video, that is, the peak signal-to-noise ratio PSNR corresponding to encoding and decoding with high resolution for one frame in video is relatively small and the distortion is relatively large.
If the low resolution is used for encoding and decoding a frame in the video, in the case where the bandwidth bits of transmission is relatively large (e.g., greater than the bandwidth threshold intersection point D shown in fig. 1), the peak signal-to-noise ratio PSNR corresponding to encoding and decoding a frame in the video with the low resolution is lower than the peak signal-to-noise ratio PSNR corresponding to encoding and decoding a frame in the video with the high resolution, that is, the peak signal-to-noise ratio PSNR corresponding to encoding and decoding with the low resolution is relatively small when the transmission bandwidth is large, and the distortion is relatively large.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a video decoding and encoding method and device, a storage medium, a decoder and an encoder, which at least solve the technical problem of poor flexibility in encoding and decoding video frames in the related technology.
According to an aspect of an embodiment of the present invention, there is provided a video decoding method including: acquiring directional prediction modes of at least two reference blocks in a decoded block, wherein the reference blocks are reference blocks of a block to be decoded; determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value; and decoding the block to be decoded by adopting the target resolution.
According to an aspect of the embodiment of the present invention, there is also provided a video encoding method, including: acquiring directional prediction modes of at least two reference blocks in a coded block, wherein the reference blocks are reference blocks of a block to be coded; determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded according to the direction prediction mode difference value; and adopting the target resolution to code the block to be coded.
According to an aspect of an embodiment of the present invention, there is also provided a video decoding apparatus including: a first obtaining unit, configured to obtain directional prediction modes of at least two reference blocks in a decoded block, where the reference blocks are reference blocks of a block to be decoded; a determining unit, configured to determine a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determine a target resolution for decoding the block to be decoded according to the direction prediction mode difference value; and the decoding unit is used for decoding the block to be decoded by adopting the target resolution.
According to an aspect of an embodiment of the present invention, there is also provided a video encoding apparatus including: an obtaining unit, configured to obtain directional prediction modes of at least two reference blocks in an encoded block, where the reference blocks are reference blocks of a block to be encoded; a determining unit, configured to determine a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determine a target resolution for encoding the block to be encoded according to the direction prediction mode difference value; and the encoding unit is used for encoding the block to be encoded by adopting the target resolution.
According to an aspect of an embodiment of the present invention, there is also provided a computer-readable storage medium having stored therein a computer program, wherein the computer program is configured to perform the above-described video decoding method when run.
According to an aspect of the embodiment of the present invention, there is also provided a decoder including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the video decoding method described above through the computer program.
According to an aspect of the embodiment of the present invention, there is also provided an encoder including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the video encoding method described above through the computer program.
In the embodiment of the application, a directional prediction mode for acquiring at least two reference blocks in a decoded block is adopted, wherein the reference blocks are the reference blocks of a block to be decoded; determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value; and decoding the block to be decoded by adopting the target resolution. In the method, during decoding, the decoded reference block can be used for determining the target resolution used during decoding of the block to be referred, so that the target resolutions of different blocks to be decoded during decoding can be different, the effect of encoding and decoding different blocks in a video frame by adopting different target resolutions is realized, the flexibility of encoding and decoding the video frame is improved, and the technical problem of poor encoding and decoding flexibility of the video frame in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a schematic illustration of the prior art in connection with the present solution;
FIG. 2 is a schematic diagram of an application environment of an alternative video decoding method according to an embodiment of the present invention;
FIG. 3 is a flow chart of an alternative video decoding method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative video decoding method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another alternative video decoding method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of yet another alternative video decoding method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of yet another alternative video decoding method according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of yet another alternative video decoding method according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of yet another alternative video decoding method according to an embodiment of the present invention;
FIG. 10 is a flow chart of an alternative video encoding method according to an embodiment of the invention;
fig. 11 is a schematic structural view of an alternative video decoding apparatus according to an embodiment of the present invention;
fig. 12 is a schematic diagram of an alternative video encoding apparatus according to an embodiment of the present invention;
FIG. 13 is a schematic diagram of an alternative decoder according to an embodiment of the present invention;
FIG. 14 is a schematic diagram of an alternative decoder according to an embodiment of the present invention
FIG. 15 is a schematic diagram of an alternative encoder according to an embodiment of the present invention;
FIG. 16 is a schematic diagram of an alternative encoder according to an embodiment of the present invention;
FIG. 17 is a schematic diagram of an alternative encoder and decoder application environment in accordance with an embodiment of the present invention;
fig. 18 is a schematic diagram of an alternative encoder and decoder application environment in accordance with an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiment of the present invention, there is provided a video decoding method, optionally, as an alternative implementation, the video decoding method may be applied, but not limited to, in the environment shown in fig. 2.
The user equipment 202 in fig. 2 includes a memory 204 for storing data and a processor 206 for processing the data. User device 202 and user device 216 may interact with data between server 210 via network 208. The server 210 includes a database 212 for storing data and a forwarding module 214 for forwarding data. The user device 216 includes a memory 218 for storing data and a processor 220 for processing the data. In this scenario, the user device 216 may be the side that decodes the video frame. After receiving the video frame to be decoded, the user equipment 216 may determine, for a block to be decoded in the video frame to be decoded, a target resolution of decoding the block to be decoded by using a directional prediction mode of a reference block in the decoded block, and since the reference blocks of different blocks to be decoded are the same or different, the target resolution of decoding the block to be decoded may be different, thereby improving decoding flexibility of decoding the video frame.
It should be noted that, in this embodiment, the encoding side and the decoding side may also directly communicate through a network, and this embodiment is not limited specifically.
Alternatively, the user devices 202 and 216 may be, but are not limited to, mobile phones, tablet computers, notebook computers, PCs, etc., and the network 208 may include, but is not limited to, a wireless network or a wired network. Wherein the wireless network comprises: WIFI and other networks that enable wireless communications. The wired network may include, but is not limited to: wide area network, metropolitan area network, local area network. The server 210 may include, but is not limited to, any hardware device that may perform calculations.
Optionally, as an optional embodiment, as shown in fig. 3, the video decoding method includes:
s302, obtaining directional prediction modes of at least two reference blocks in a decoded block, wherein the reference blocks are reference blocks of a block to be decoded;
s304, determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value;
and S306, decoding the block to be decoded by adopting the target resolution.
Alternatively, the video decoding method described above may be applied, but not limited to, in the process of encoding and decoding video frames.
For example, in encoding and decoding a video frame, at the time of encoding, for an encoded block and a block to be encoded in one video frame, one or more blocks of the encoded blocks are used as reference blocks of the block to be encoded, a target resolution at which the block to be encoded is determined using a directional prediction mode of the reference blocks, and the block to be encoded is encoded using the target resolution. When decoding, the same method is used for determining a reference block of a block to be decoded in one video frame, a directional prediction mode of the reference block is used for determining a target resolution for decoding the block to be decoded, and the target resolution is used for decoding the block to be decoded, so that different blocks in one video frame can be encoded or decoded by using different target resolutions in the encoding or decoding process, and the effect of improving the flexibility of encoding or decoding the video frame is achieved.
Alternatively, the target resolution in the present solution may be a resolution commonly referred to as a contract. For example, the target resolution may be 1920×1080 resolution, etc. available. Or, for a resolution agreed upon by the relevant standard.
Optionally, in this solution, after a video is acquired, each frame in the video may be taken as a video frame to be encoded. For any video frame to be encoded, the video frame may include a plurality of encoded blocks and blocks to be encoded. In determining the target resolution to be used for encoding each block to be encoded, a reference block may be determined from the encoded blocks, and then the target resolution to be encoded for the block to be encoded may be determined using the directional prediction mode of the reference block. Then, the block to be encoded is encoded using the target resolution.
Alternatively, in determining the reference block of the block to be encoded, a reference block or a plurality of reference blocks may be determined. For example, as shown in fig. 4, the hatched blocks in fig. 4 are coded blocks, and the white blocks in fig. 4 are blocks to be coded. In determining a reference block for the block to be encoded 402, one or more consecutive or non-consecutive ones of the encoded blocks may be determined as the reference block. For example, the encoded block 404 in fig. 4 is determined as a reference block to the block to be encoded 402.
After determining a reference block of a block to be encoded, a directional prediction mode of the reference block needs to be acquired. Alternatively, the directional prediction Mode in this scheme may be a Direction Mode (DM) or an intra-frame prediction Mode. The directional prediction mode is a series of numbers in the video coding standard. Each direction mode corresponds to a numerical value one by one. For a reference block, one or more pixels may be included. And acquiring a directional prediction mode of each pixel point. For example, if the directional prediction mode of one pixel is 1 and one reference block includes one pixel, the directional prediction mode of the pixel is determined as the directional prediction mode of the reference block. In the case where the reference block has a plurality of pixels, the variance of the directional prediction mode of the plurality of pixels is calculated. For example, in a reference block including four pixels, the directional prediction modes of the four pixels are 1, 3, 4, and 8, respectively, variances of 1, 3, 4, and 8 are calculated, and the calculated variances are used as the directional prediction modes of the reference block. And after the directional prediction mode of one reference block is obtained, a target resolution for encoding the block to be encoded may be determined according to the directional prediction mode of the reference block.
Alternatively, the directional prediction mode of the reference block in the present scheme may represent texture complexity of the block to be encoded, and the greater the texture complexity, the lower the target resolution used. Optionally, in a case where the directional prediction mode indicates that the intra texture complexity of the block to be encoded is greater than or equal to a first predetermined threshold, determining the target resolution as the first resolution; determining the target resolution as a second resolution in the case that the directional prediction mode indicates that the intra-texture complexity of the block to be encoded is less than a first predetermined threshold and the directional prediction mode is greater than or equal to a second predetermined threshold, wherein the first resolution is less than the second resolution; in a case where the directional prediction mode indicates that the intra texture complexity of the block to be encoded is less than a second predetermined threshold and the directional prediction mode is greater than or equal to a third predetermined threshold, determining the target resolution as a third resolution, wherein the second resolution is less than the third resolution. The first to third resolutions may be any one of the resolutions currently used or any one of the resolutions commonly known according to the standard convention. For resolutions that cannot be achieved, this embodiment does not use.
Or after the directional prediction mode of one reference block is acquired, directly judging the relation between the directional prediction mode and the threshold value. Determining the target resolution as a first resolution in the case that the directional prediction mode is greater than or equal to a fourth predetermined threshold; determining the target resolution as a second resolution in a case where the directional prediction mode is less than the fourth predetermined threshold and the directional prediction mode is greater than or equal to a fifth predetermined threshold, wherein the first resolution is less than the second resolution; and determining the target resolution as a third resolution in the case that the directional prediction mode is smaller than the fifth predetermined threshold and the directional prediction mode is greater than or equal to a sixth predetermined threshold, wherein the second resolution is smaller than the third resolution. The fourth predetermined threshold may be the same as or different from the first predetermined threshold. The fifth predetermined threshold may be the same as or different from the second predetermined threshold, and the sixth predetermined threshold may be the same as or different from the third predetermined threshold. After determining the target resolution, encoding the block to be encoded by using the target resolution. As shown in fig. 5, the resolution determined by the block to be coded 502 in fig. 5 is 1920×1080, and the resolution of the code determined by the block to be coded 504 is 1280×1024. Different fill shapes may represent different resolutions, but are not limiting on the present solution.
Alternatively, the reference block of each block to be encoded may be plural. In the case where there are a plurality of reference blocks of one block to be encoded, the directional prediction mode of each reference block may be acquired by the above-described method. After the directional prediction mode of each reference block is acquired, a weighted sum operation is performed on the directional prediction mode of each reference block, and the weight may be preset or determined according to the distance from the block to be encoded, the weight of the reference block closer to the block to be encoded is greater, and so on. And taking the result obtained by the weighted summation calculation as a direction prediction mode difference value of a group of reference blocks, or taking the difference value of the maximum directional prediction mode and the minimum directional prediction mode as a direction prediction mode difference value of a group of reference blocks, and determining the target resolution for encoding the block to be encoded according to the direction prediction mode difference value.
Optionally, after determining the direction prediction mode difference value, determining the target resolution as the first resolution in a case where the direction prediction mode difference value is greater than or equal to a seventh predetermined threshold; determining the target resolution as a second resolution in a case where the directional prediction mode difference value is less than the seventh predetermined threshold and the directional prediction mode is greater than or equal to an eighth predetermined threshold, wherein the first resolution is less than the second resolution; and determining the target resolution as a third resolution in the case that the directional prediction mode difference value is smaller than the eighth predetermined threshold and the directional prediction mode is greater than or equal to a ninth predetermined threshold, wherein the second resolution is smaller than the third resolution. The block to be encoded is encoded using the determined resolution.
Optionally, in this solution, after all the blocks to be encoded in the video frame are encoded, an encoded video frame is obtained, and the resolutions of the blocks of the video frame may be the same or different. And sending the encoded video frames or videos formed by all the encoded video frames to a decoding side, and decoding by the decoding side.
Alternatively, in the decoding process of the decoding side in this scheme, when determining the reference block of the block to be decoded, one reference block or multiple reference blocks may be determined. For example, as shown in fig. 6, the hatched blocks in fig. 6 are decoded blocks, and the white blocks in fig. 6 are blocks to be decoded. In determining a reference block for the block 602 to be decoded, one or more consecutive or non-consecutive ones of the decoded blocks may be determined as the reference block. For example, the decoded block 604 in fig. 6 is determined as a reference block to the block 602 to be decoded.
After determining a reference block of a block to be decoded, a directional prediction mode of the reference block needs to be acquired. Alternatively, the directional prediction Mode in the present scheme may be a Direction Mode (DM) directional prediction Mode, which is a series of numbers in the video decoding standard. Each direction mode corresponds to a numerical value one by one. For a reference block, one or more pixels may be included. And acquiring a directional prediction mode of each pixel point. For example, if the directional prediction mode of one pixel is 1 and one reference block includes one pixel, the directional prediction mode of the pixel is determined as the directional prediction mode of the reference block. In the case where the reference block has a plurality of pixels, the variance of the directional prediction mode of the plurality of pixels is calculated. For example, in a reference block including four pixels, the directional prediction modes of the four pixels are 1, 3, 4, and 8, respectively, variances of 1, 3, 4, and 8 are calculated, and the calculated variances are used as the directional prediction modes of the reference block. And after the directional prediction mode of one reference block is obtained, a target resolution for decoding the block to be decoded may be determined according to the directional prediction mode of the reference block.
Alternatively, the directional prediction mode of the reference block in the present scheme may represent texture complexity of the block to be decoded, and the greater the texture complexity, the lower the target resolution used. Optionally, in a case where the directional prediction mode indicates that the intra texture complexity of the block to be decoded is greater than or equal to a first predetermined threshold, determining the target resolution as the first resolution; determining the target resolution as a second resolution in the case that the directional prediction mode indicates that the intra-texture complexity of the block to be decoded is less than a first predetermined threshold and the directional prediction mode is greater than or equal to a second predetermined threshold, wherein the first resolution is less than the second resolution; in a case where the directional prediction mode indicates that the intra texture complexity of the block to be decoded is less than a second predetermined threshold and the directional prediction mode is greater than or equal to a third predetermined threshold, determining the target resolution as a third resolution, wherein the second resolution is less than the third resolution. The first to third resolutions may be any one of the resolutions currently used or any one of the resolutions commonly known according to the standard convention. For resolutions that cannot be achieved, this embodiment does not use.
Or after the directional prediction mode of one reference block is acquired, directly judging the relation between the directional prediction mode and the threshold value. Determining the target resolution as a first resolution in the case that the directional prediction mode is greater than or equal to a fourth predetermined threshold; determining the target resolution as a second resolution in a case where the directional prediction mode is less than the fourth predetermined threshold and the directional prediction mode is greater than or equal to a fifth predetermined threshold, wherein the first resolution is less than the second resolution; and determining the target resolution as a third resolution in the case that the directional prediction mode is smaller than the fifth predetermined threshold and the directional prediction mode is greater than or equal to a sixth predetermined threshold, wherein the second resolution is smaller than the third resolution. The fourth predetermined threshold may be the same as or different from the first predetermined threshold. The fifth predetermined threshold may be the same as or different from the second predetermined threshold, and the sixth predetermined threshold may be the same as or different from the third predetermined threshold. After determining the target resolution, decoding the block to be decoded by using the target resolution.
Alternatively, the reference block of each block to be decoded may be plural. In the case where there are a plurality of reference blocks of one block to be decoded, the directional prediction mode of each reference block may be acquired by the above-described method. After the directional prediction mode of each reference block is acquired, a weighted sum operation is performed on the directional prediction mode of each reference block, and the weight may be preset or determined according to the distance from the block to be decoded, the weight of the reference block closer to the block to be decoded is greater, and so on. And taking the result obtained by the weighted summation calculation as a direction prediction mode difference value of a group of reference blocks, or determining the difference value between the maximum directional prediction mode and the minimum directional prediction mode in the reference blocks as a direction prediction mode difference value of the group of reference blocks, and determining the target resolution for decoding the block to be decoded according to the direction prediction mode difference value.
Optionally, after determining the direction prediction mode difference value, determining the target resolution as the first resolution in a case where the direction prediction mode difference value is greater than or equal to a seventh predetermined threshold; determining the target resolution as a second resolution in a case where the directional prediction mode difference value is less than the seventh predetermined threshold and the directional prediction mode is greater than or equal to an eighth predetermined threshold, wherein the first resolution is less than the second resolution; and determining the target resolution as a third resolution in the case that the directional prediction mode difference value is smaller than the eighth predetermined threshold and the directional prediction mode is greater than or equal to a ninth predetermined threshold, wherein the second resolution is smaller than the third resolution. And decoding the block to be decoded using the determined resolution.
Alternatively, in the present scheme, during the process of encoding and decoding the video frame, the video frame may be split into the same or different target blocks. For example, as shown in fig. 7, in fig. 7 is a case where a video frame to be encoded 702 and a video frame to be decoded 704 are split into the same target blocks. The video frame to be encoded 702 includes 4 target blocks, including a block to be encoded and an encoded block. After the video frame 702 to be encoded is encoded by adopting the method, the encoded video frame is sent to the decoding side, and the decoding side can obtain the video frame 704 to be decoded and split the video frame 704 to be decoded into 4 blocks according to the splitting method of the video frame 702 to be encoded.
Alternatively, the encoding side and the decoding side may agree in advance on a splitting method of the video frame. Such as splitting into 4 blocks on average, etc. For the first block to be encoded/decoded, since there is no reference block, the encoding/decoding strategy may be agreed in advance to ensure that the video frame decoded by the decoding side is the same as the video frame before encoding by the encoding side.
Optionally, in this scheme, different splitting methods may be set for the video frame to be encoded and the video frame to be decoded, and split into different target blocks. Alternatively, in the case where the splitting method is the same, different reference blocks may be used for the blocks to be encoded/decoded at the same position in the video frame to be encoded and the video frame to be decoded. Alternatively, different reference blocks are used for different blocks to be encoded/decoded. In this case, at the time of encoding, it is necessary to transmit the positional relationship of the block to be encoded and the reference block to the decoding side so that the decoding side decodes according to the positional relationship. For example, when encoding, a flag bit is carried in the encoded data, the flag bit indicates the positional relationship between the block to be encoded and the reference block, and when decoding, decoding can be performed according to the positional relationship carried in the flag bit.
Optionally, in the present scheme, during the process of decoding the current video frame, multiple blocks to be decoded in the current video frame may have different decoding resolutions. The current video frame may be one or more frames of video frames that need to be decoded after the decoded video frame. In this process, the edge filtering process may also be performed on pixels in adjacent two blocks to be decoded of different resolutions. For example, at least one to-be-decoded block is determined among a plurality of to-be-decoded blocks, and each to-be-decoded block at least comprises two to-be-decoded blocks with different resolutions. The two blocks to be decoded of different resolutions are adjacent. At this time, it is necessary to perform edge filtering processing on two blocks to be decoded. Before processing, the resolution of the two blocks to be decoded needs to be adjusted to the same resolution. Such as adjusting the resolution of the first block to be decoded to the resolution of the second block to be decoded (in the case where a group of blocks to be decoded includes two blocks to be decoded), or adjusting the resolution of the second block to be decoded to the resolution of the first block to be decoded, or adjusting the resolution of two blocks to be decoded to another resolution different from the resolution of both blocks to be decoded. After the adjustment, an edge filtering operation may be performed. When the edge filtering operation is executed, a first edge pixel point set is determined from a first block to be decoded, a second edge pixel point set is determined from a second block to be decoded, and the positions of the first edge pixel point set and the second edge pixel point set are adjacent, namely, the pixels in the first edge pixel point set and the second edge pixel point set are two adjacent pixels of the block to be decoded. When the filtering processing is executed, filtering processing is carried out on the first edge pixel point set to obtain a filtered first edge pixel point set, filtering processing is carried out on the second edge pixel point set to obtain a filtered second edge pixel point set, wherein a first difference value between a pixel value of an ith pixel point in the filtered first edge pixel point set and a pixel value of a jth pixel point corresponding to the ith pixel point in the filtered second edge pixel point set is smaller than a second difference value between the pixel value of the ith pixel point in the first edge pixel point set and the pixel value of the jth pixel point in the second edge pixel point set before filtering, i is a positive integer and is smaller than or equal to the total number of the pixel points in the first edge pixel point set, j is a positive integer and is smaller than or equal to the total number of the pixel points in the second edge pixel point set. The filtering processing aims to avoid obvious joints in the video in the reconstruction process, thereby ensuring that the content in the video is accurately restored, and further solving the technical problem of video distortion caused by inconsistent resolution.
Alternatively, a specific example is described. For example, for a video frame, a plurality of encoded blocks and a plurality of blocks to be encoded are included. As shown in fig. 8, when the block 802 to be encoded is encoded in fig. 8, the encoded block 804 may be determined as a reference block, and a directional prediction mode of the reference block may be determined. When determining the directional prediction mode of the reference block, the directional prediction mode of each pixel point in one reference block is obtained, the variance of the directional prediction mode of each pixel point is calculated, the variance is determined as the directional prediction mode of the reference block, and the directional prediction modes of the four reference blocks are weighted and summed to obtain the directional prediction mode of the block 802 to be coded. E.g. 8, and the first and second and third predetermined thresholds, e.g. 12, 7, 1, the directional prediction mode of the block to be encoded is between the first and second predetermined thresholds. The block 802 to be encoded is encoded using the second resolution. After the coding resolutions of all the blocks to be coded in the video frame to be coded are determined, each block to be coded is coded by using the corresponding resolution. And transmits the encoded video frames to the decoding side. After receiving the video frame to be decoded, the decoding side may split the video frame to be decoded according to a manner agreed with the encoding side and decode the block to be decoded using a decoding manner agreed with the encoding side, as shown in fig. 9, the decoding side may determine a target resolution of the block 902 to be decoded using the decoded block 904 according to the same manner as the encoding side and decode the block to be decoded using the target resolution, to obtain a decoding result.
According to the method, as the resolutions used when at least two blocks are encoded in the video frame to be decoded are different, and the target resolutions used when the reference blocks are decoded can be determined by using the decoded reference blocks when the video frame to be decoded is decoded, the target resolutions of different blocks to be decoded can be different when the video frame to be decoded is decoded, the effect of encoding and decoding different blocks in the video frame by adopting different target resolutions is achieved, and the flexibility of encoding and decoding the video frame is improved.
As an alternative embodiment, the determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value, includes:
s1, determining the target resolution as a first resolution under the condition that the direction prediction mode difference value indicates that the intra-frame texture complexity of the block to be decoded is greater than or equal to a first preset threshold value;
s2, determining the target resolution as a second resolution when the direction prediction mode difference value indicates that the intra-frame texture complexity of the block to be decoded is smaller than the first preset threshold value and the direction prediction mode difference value is larger than or equal to a second preset threshold value, wherein the first resolution is smaller than the second resolution;
And S3, determining the target resolution as a third resolution when the direction prediction mode difference value indicates that the intra-frame texture complexity of the block to be decoded is smaller than the second preset threshold value and the direction prediction mode difference value is larger than or equal to a third preset threshold value, wherein the second resolution is smaller than the third resolution.
According to the method, the target resolution for decoding the block to be decoded is determined, so that the purpose of determining the target resolution according to the intra texture complexity of the block to be decoded is achieved. The decoding flexibility of decoding the video frames is further improved.
As an alternative embodiment, the determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value, includes:
s1, determining the target resolution as a first resolution when the direction prediction mode difference value is greater than or equal to a fourth preset threshold value;
s2, determining the target resolution as a second resolution when the direction prediction mode difference value is smaller than the fourth preset threshold value and the direction prediction mode difference value is larger than or equal to a fifth preset threshold value, wherein the first resolution is smaller than the second resolution;
And S3, determining the target resolution as a third resolution when the direction prediction mode difference value is smaller than the fifth preset threshold value and the direction prediction mode difference value is larger than or equal to a sixth preset threshold value, wherein the second resolution is smaller than the third resolution.
According to the method, the target resolution for decoding the block to be decoded is determined through the method, so that the purpose of determining the target resolution according to the directional prediction mode of the block to be decoded is achieved. The decoding flexibility of decoding the video frames is further improved.
As an alternative implementation, the reference block is a set of reference blocks, wherein the determining the target resolution for decoding the block to be decoded according to the directional prediction mode of the reference block includes:
s1, acquiring a directional prediction mode of each reference block in the group of reference blocks;
s2, carrying out weighted summation on the directional prediction modes of each reference block to obtain directional prediction mode difference values of the group of reference blocks; or determining the difference value between the largest directional prediction mode and the smallest directional prediction mode in the directional prediction modes of each reference block as the directional prediction mode difference value of the group of reference blocks;
S3, determining the target resolution as the first resolution when the direction prediction mode difference value is greater than or equal to a seventh preset threshold value;
s4, determining the target resolution as a second resolution when the direction prediction mode difference value is smaller than the seventh preset threshold value and the direction prediction mode difference value is larger than or equal to an eighth preset threshold value, wherein the first resolution is smaller than the second resolution;
and S5, determining the target resolution as a third resolution in the case that the direction prediction mode difference value is smaller than the eighth preset threshold value and the direction prediction mode difference value is larger than or equal to a ninth preset threshold value, wherein the second resolution is smaller than the third resolution.
According to the method, the target resolution of decoding the block to be decoded is determined under the condition that a group of reference blocks exist by the method, so that the purpose of determining the target resolution according to the intra texture complexity of the block to be decoded is achieved. The decoding flexibility of decoding the video frames is further improved.
As an alternative embodiment, the obtaining the directional prediction mode of each reference block in the set of reference blocks includes:
S1, acquiring a directional prediction mode of each pixel in a current reference block in the group of reference blocks;
s2, calculating the variance of the directional prediction mode of each pixel;
s3, taking the variance as a directional prediction mode of the current reference block;
s4, taking each reference block in the group of reference blocks as the current reference block, and acquiring a directional prediction mode of each reference block in the group of reference blocks.
By the embodiment, the directional prediction mode of each reference block is determined by the method, so that the effect of accurately determining the directional prediction mode of the reference block is realized.
As an alternative embodiment, the positional relationship between the block to be decoded and the reference block is the same or different for different blocks to be decoded, wherein in the case that the positional relationship between the block to be decoded and the reference block is different for different blocks to be decoded, in the process of decoding the block to be decoded with the target resolution, the method further includes:
s1, acquiring a flag bit carried in the block to be decoded, wherein the flag bit is used for indicating the position relation.
According to the embodiment, the marker bit carries the position relation, so that the marker bit can still be used for correct decoding under the condition that the reference blocks determined by the encoding side and the decoding side are different, and the decoding accuracy is improved.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
According to an aspect of the embodiment of the present invention, there is also provided a video encoding method. As shown in fig. 10, the method includes:
s1002, obtaining directional prediction modes of at least two reference blocks in a coded block, wherein the reference blocks are reference blocks of a block to be coded;
s1004, determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded according to the direction prediction mode difference value;
S1006, coding the block to be coded by adopting the target resolution.
Alternatively, the video encoding method can be applied to, but not limited to, a process of encoding and decoding video frames.
For example, in encoding and decoding a video frame, at the time of encoding, for an encoded block and a block to be encoded in one video frame, one or more blocks of the encoded blocks are used as reference blocks of the block to be encoded, a target resolution at which the block to be encoded is determined using a directional prediction mode of the reference blocks, and the block to be encoded is encoded using the target resolution. When decoding, the same method is used for determining a reference block of a block to be decoded in one video frame, a directional prediction mode of the reference block is used for determining a target resolution for decoding the block to be decoded, and the target resolution is used for decoding the block to be decoded, so that different blocks in one video frame can be encoded or decoded by using different target resolutions in the encoding or decoding process, and the effect of improving the flexibility of encoding or decoding the video frame is achieved.
Optionally, for a specific encoding example in this embodiment, please refer to various cases in the foregoing embodiments, and this embodiment is not described herein.
As an alternative embodiment, the determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded according to the direction prediction mode difference value, includes:
s1, determining the target resolution as a first resolution under the condition that the direction prediction mode difference value indicates that the intra-frame texture complexity of the block to be encoded is greater than or equal to a first preset threshold value;
s2, determining the target resolution as a second resolution when the direction prediction mode difference value indicates that the intra-frame texture complexity of the block to be encoded is smaller than the first preset threshold value and the direction prediction mode difference value is larger than or equal to a second preset threshold value, wherein the first resolution is smaller than the second resolution;
and S3, determining the target resolution as a third resolution when the direction prediction mode difference value indicates that the intra-frame texture complexity of the block to be encoded is smaller than the second preset threshold value and the direction prediction mode difference value is larger than or equal to a third preset threshold value, wherein the second resolution is smaller than the third resolution.
According to the method, the target resolution for encoding the block to be encoded is determined, so that the purpose of determining the target resolution according to the intra-town texture complexity of the block to be encoded is achieved. The decoding flexibility of encoding video frames is further improved.
As an alternative embodiment, the determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded according to the direction prediction mode difference value, includes:
s1, determining the target resolution as a first resolution when the direction prediction mode difference value is greater than or equal to a fourth preset threshold value;
s2, determining the target resolution as a second resolution when the direction prediction mode difference value is smaller than the fourth preset threshold value and the direction prediction mode difference value is larger than or equal to a fifth preset threshold value, wherein the first resolution is smaller than the second resolution;
and S3, determining the target resolution as a third resolution when the direction prediction mode difference value is smaller than the fifth preset threshold value and the direction prediction mode difference value is larger than or equal to a sixth preset threshold value, wherein the second resolution is smaller than the third resolution.
According to the method, the target resolution for encoding the block to be encoded is determined through the method, so that the purpose of determining the target resolution according to the directional prediction mode of the block to be encoded is achieved. The coding flexibility of coding the video frames is further improved.
As an alternative embodiment, the reference block is a set of reference blocks, wherein the determining the target resolution for encoding the block to be encoded according to the direction prediction mode difference value of the reference block includes:
s1, acquiring a directional prediction mode of each reference block in the group of reference blocks;
s2, carrying out weighted summation on the directional prediction modes of each reference block to obtain directional prediction mode difference values of the group of reference blocks; or determining the difference value between the largest directional prediction mode and the smallest directional prediction mode in the directional prediction modes of each reference block as the directional prediction mode difference value of the group of reference blocks;
s3, determining the target resolution as the first resolution when the direction prediction mode difference value is greater than or equal to a seventh preset threshold value;
s4, determining the target resolution as a second resolution when the direction prediction mode difference value is smaller than the seventh preset threshold value and the direction prediction mode difference value is larger than or equal to an eighth preset threshold value, wherein the first resolution is smaller than the second resolution;
And S5, determining the target resolution as a third resolution in the case that the direction prediction mode difference value is smaller than the eighth preset threshold value and the direction prediction mode difference value is larger than or equal to a ninth preset threshold value, wherein the second resolution is smaller than the third resolution.
According to the method, the target resolution of encoding the block to be encoded is determined under the condition that a group of reference blocks exist by the method, so that the purpose of determining the target resolution according to the intra-frame texture complexity of the block to be encoded is achieved. The coding flexibility of coding the video frames is further improved.
As an alternative embodiment, the obtaining the directional prediction mode of each reference block in the set of reference blocks includes:
s1, acquiring a directional prediction mode of each pixel in a current reference block in the group of reference blocks;
s2, calculating the variance of the directional prediction mode of each pixel;
s3, taking the variance as a directional prediction mode of the current reference block;
s4, taking each reference block in the group of reference blocks as the current reference block, and acquiring a directional prediction mode of each reference block in the group of reference blocks.
By the embodiment, the directional prediction mode of each reference block is determined by the method, so that the effect of accurately determining the directional prediction mode of the reference block is realized.
As an alternative embodiment, the positional relationship between the block to be encoded and the reference block is the same or different for different blocks to be encoded, wherein in the case that the positional relationship between the block to be encoded and the reference block is different for different blocks to be encoded, in the process of encoding the block to be encoded with the target resolution, the method further includes:
s1, setting a zone bit in encoded data obtained by encoding the block to be encoded, wherein the zone bit is used for indicating the position relationship.
According to the embodiment, the marker bit carries the position relation, so that the marker bit can still be used for correct decoding under the condition that the reference blocks determined by the encoding side and the decoding side are different, and the decoding accuracy is improved.
According to an aspect of the embodiments of the present invention, there is also provided a video decoding apparatus for implementing the video decoding method described above. As shown in fig. 11, the apparatus includes:
(1) A first obtaining unit 1102, configured to obtain directional prediction modes of at least two reference blocks in a decoded block, where the reference blocks are reference blocks of a block to be decoded;
(2) A determining unit 1104, configured to determine a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determine a target resolution for decoding the block to be decoded according to the direction prediction mode difference value;
(31) A decoding unit 1106, configured to decode the block to be decoded using the target resolution.
Alternatively, the video decoding device can be applied to the process of encoding and decoding video frames, but is not limited to the process.
For example, in encoding and decoding a video frame, at the time of encoding, for an encoded block and a block to be encoded in one video frame, one or more blocks of the encoded blocks are used as reference blocks of the block to be encoded, a target resolution at which the block to be encoded is determined using a directional prediction mode of the reference blocks, and the block to be encoded is encoded using the target resolution. When decoding, the same method is used for determining a reference block of a block to be decoded in one video frame, a directional prediction mode of the reference block is used for determining a target resolution for decoding the block to be decoded, and the target resolution is used for decoding the block to be decoded, so that different blocks in one video frame can be encoded or decoded by using different target resolutions in the encoding or decoding process, and the effect of improving the flexibility of encoding or decoding the video frame is achieved.
Reference is made to the foregoing embodiments for other implementation manners of this embodiment, and details are not described herein.
As an alternative embodiment, the determining unit includes:
(1) A first determining module, configured to determine, when the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is greater than or equal to a first predetermined threshold, that the target resolution is a first resolution;
(2) A second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is less than the first predetermined threshold and greater than or equal to a second predetermined threshold, where the first resolution is less than the second resolution;
(3) And a third determining module, configured to determine the target resolution as a third resolution if the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is less than the second predetermined threshold and greater than or equal to a third predetermined threshold, where the second resolution is less than the third resolution.
According to the method, the target resolution for decoding the block to be decoded is determined, so that the purpose of determining the target resolution according to the intra texture complexity of the block to be decoded is achieved. The decoding flexibility of decoding the video frames is further improved.
As an alternative embodiment, the determining unit includes:
(1) A first determining module, configured to determine, when the direction prediction mode difference value is greater than or equal to a fourth predetermined threshold, that the target resolution is a first resolution;
(2) A second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value is less than the fourth predetermined threshold and the direction prediction mode difference value is greater than or equal to a fifth predetermined threshold, where the first resolution is less than the second resolution;
(3) And a third determining module, configured to determine that the target resolution is a third resolution if the direction prediction mode difference value is less than the fifth predetermined threshold and the direction prediction mode difference value is greater than or equal to a sixth predetermined threshold, where the second resolution is less than the third resolution.
According to the method, the target resolution for decoding the block to be decoded is determined through the method, so that the purpose of determining the target resolution according to the directional prediction mode of the block to be decoded is achieved. The decoding flexibility of decoding the video frames is further improved.
As an alternative embodiment, the above reference block is a set of reference blocks, wherein the determining unit includes:
(1) An acquisition module for acquiring a directional prediction mode of each reference block in the set of reference blocks;
(2) The calculation module is used for carrying out weighted summation on the directional prediction modes of each reference block to obtain a directional prediction mode difference value of the group of reference blocks; or determining the difference value between the largest directional prediction mode and the smallest directional prediction mode in the directional prediction modes of each reference block as the directional prediction mode difference value of the group of reference blocks;
(3) A first determining module, configured to determine, when the direction prediction mode difference value is greater than or equal to a seventh predetermined threshold, that the target resolution is a first resolution;
(4) A second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value is less than the seventh predetermined threshold and the direction prediction mode difference value is greater than or equal to an eighth predetermined threshold, where the first resolution is less than the second resolution;
(5) And a third determining module, configured to determine that the target resolution is a third resolution if the direction prediction mode difference value is less than the eighth predetermined threshold and the direction prediction mode difference value is greater than or equal to a ninth predetermined threshold, where the second resolution is less than the third resolution.
According to the method, the target resolution of decoding the block to be decoded is determined under the condition that a group of reference blocks exist by the method, so that the purpose of determining the target resolution according to the intra texture complexity of the block to be decoded is achieved. The decoding flexibility of decoding the video frames is further improved.
As an alternative embodiment, the acquiring module includes:
(1) A first acquisition sub-module for acquiring a directional prediction mode of each pixel in a current reference block of the set of reference blocks;
(2) A calculation sub-module for calculating a variance of the directional prediction mode of each pixel;
(3) A determining sub-module for taking the variance as a directional prediction mode of the current reference block;
(4) And the second acquisition sub-module is used for taking each reference block in the group of reference blocks as the current reference block and acquiring a directional prediction mode of each reference block in the group of reference blocks.
By the embodiment, the directional prediction mode of each reference block is determined by the method, so that the effect of accurately determining the directional prediction mode of the reference block is realized.
As an alternative implementation, the positional relationship between the block to be decoded and the reference block is the same or different for different blocks to be decoded, and the apparatus further includes:
(1) And the second obtaining unit is used for obtaining a flag bit carried in the block to be decoded in the process of decoding the block to be decoded by adopting the target resolution under the condition that the position relationship between the block to be decoded and the reference block is different for different blocks to be decoded, wherein the flag bit is used for indicating the position relationship.
According to the embodiment, the marker bit carries the position relation, so that the marker bit can still be used for correct decoding under the condition that the reference blocks determined by the encoding side and the decoding side are different, and the decoding accuracy is improved.
According to an aspect of the embodiment of the present invention, there is also provided a video encoding apparatus for implementing the video encoding method described above. As shown in fig. 12, the apparatus includes:
(1) An obtaining unit 1202, configured to obtain directional prediction modes of at least two reference blocks in an encoded block, where the reference blocks are reference blocks of a block to be encoded;
(2) A determining unit 1204, configured to determine a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determine a target resolution for encoding the block to be encoded according to the direction prediction mode difference value;
(3) An encoding unit 1206, configured to encode the block to be encoded using the target resolution.
Alternatively, the video encoding device may be applied, but not limited to, in the process of encoding and decoding video frames.
For example, in encoding and decoding a video frame, at the time of encoding, for an encoded block and a block to be encoded in one video frame, one or more blocks of the encoded blocks are used as reference blocks of the block to be encoded, a target resolution at which the block to be encoded is determined using a directional prediction mode of the reference blocks, and the block to be encoded is encoded using the target resolution. When decoding, the same method is used for determining a reference block of a block to be decoded in one video frame, a directional prediction mode of the reference block is used for determining a target resolution for decoding the block to be decoded, and the target resolution is used for decoding the block to be decoded, so that different blocks in one video frame can be encoded or decoded by using different target resolutions in the encoding or decoding process, and the effect of improving the flexibility of encoding or decoding the video frame is achieved.
Optionally, for a specific encoding example in this embodiment, please refer to various cases in the foregoing embodiments, and this embodiment is not described herein.
As an alternative embodiment, the determining unit comprises:
(1) A first determining module, configured to determine, when the direction prediction mode difference value indicates that the intra texture complexity of the block to be encoded is greater than or equal to a first predetermined threshold, that the target resolution is a first resolution;
(2) A second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value indicates that the intra texture complexity of the block to be encoded is less than the first predetermined threshold and greater than or equal to a second predetermined threshold, where the first resolution is less than the second resolution;
(3) And a third determining module, configured to determine the target resolution as a third resolution if the direction prediction mode difference value indicates that the intra-texture complexity of the block to be encoded is less than the second predetermined threshold and greater than or equal to a third predetermined threshold, where the second resolution is less than the third resolution.
According to the method, the target resolution for encoding the block to be encoded is determined, so that the purpose of determining the target resolution according to the intra-town texture complexity of the block to be encoded is achieved. The decoding flexibility of encoding video frames is further improved.
As an alternative embodiment, the determining unit comprises:
(1) A first determining module, configured to determine, when the direction prediction mode difference value is greater than or equal to a fourth predetermined threshold, that the target resolution is a first resolution;
(2) A second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value is less than the fourth predetermined threshold and the direction prediction mode difference value is greater than or equal to a fifth predetermined threshold, where the first resolution is less than the second resolution;
(3) And a third determining module, configured to determine that the target resolution is a third resolution if the direction prediction mode difference value is less than the fifth predetermined threshold and the direction prediction mode difference value is greater than or equal to a sixth predetermined threshold, where the second resolution is less than the third resolution.
According to the method, the target resolution for encoding the block to be encoded is determined through the method, so that the purpose of determining the target resolution according to the directional prediction mode of the block to be encoded is achieved. The coding flexibility of coding the video frames is further improved.
As an alternative embodiment, the reference block is a set of reference blocks, wherein the determining unit comprises:
(1) An acquisition module for acquiring a directional prediction mode of each reference block in the set of reference blocks;
(2) The calculation module is used for carrying out weighted summation on the directional prediction modes of each reference block to obtain a directional prediction mode difference value of the group of reference blocks; or determining the difference value between the largest directional prediction mode and the smallest directional prediction mode in the directional prediction modes of each reference block as the directional prediction mode difference value of the group of reference blocks;
(3) A first determining module, configured to determine, when the direction prediction mode difference value is greater than or equal to a seventh predetermined threshold, that the target resolution is a first resolution;
(4) A second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value is less than the seventh predetermined threshold and the direction prediction mode difference value is greater than or equal to an eighth predetermined threshold, where the first resolution is less than the second resolution;
(5) And a third determining module, configured to determine that the target resolution is a third resolution if the direction prediction mode difference value is less than the eighth predetermined threshold and the direction prediction mode difference value is greater than or equal to a ninth predetermined threshold, where the second resolution is less than the third resolution.
According to the method, the target resolution of encoding the block to be encoded is determined under the condition that a group of reference blocks exist by the method, so that the purpose of determining the target resolution according to the intra-frame texture complexity of the block to be encoded is achieved. The coding flexibility of coding the video frames is further improved.
As an alternative embodiment, the acquisition module includes:
(1) A first acquisition sub-module for acquiring a directional prediction mode of each pixel in a current reference block of the set of reference blocks;
(2) A calculation sub-module for calculating a variance of the directional prediction mode of each pixel;
(3) A determining sub-module for taking the variance as a directional prediction mode of the current reference block;
(4) And the second acquisition sub-module is used for taking each reference block in the group of reference blocks as the current reference block and acquiring a directional prediction mode of each reference block in the group of reference blocks.
By the embodiment, the directional prediction mode of each reference block is determined by the method, so that the effect of accurately determining the directional prediction mode of the reference block is realized.
As an alternative embodiment, the positional relationship between the block to be encoded and the reference block is the same or different for different blocks to be encoded, and the apparatus further comprises:
(1) The setting unit is configured to set a flag bit in encoded data obtained by encoding the block to be encoded in the process of encoding the block to be encoded with the target resolution, where the positional relationship between the block to be encoded and the reference block is different for different blocks to be encoded, and the flag bit is used to indicate the positional relationship.
According to the embodiment, the marker bit carries the position relation, so that the marker bit can still be used for correct decoding under the condition that the reference blocks determined by the encoding side and the decoding side are different, and the decoding accuracy is improved.
According to a further aspect of embodiments of the present invention there is also provided a decoder for implementing the above video decoding method, optionally the decoder in this aspect may comprise a memory and a processor, the memory may have stored therein a computer program, the processor being arranged to perform the steps of any of the decoding method embodiments described above by means of the computer program.
Alternatively, in this embodiment, the decoder may be located in at least one network device among a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring directional prediction modes of at least two reference blocks in a decoded block, wherein the reference blocks are reference blocks of a block to be decoded;
s2, determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value;
and S3, decoding the block to be decoded by adopting the target resolution.
Alternatively, as an alternative embodiment, as shown in fig. 13, the decoder in the present embodiment may be provided in the electronic device (1330). The electronic device 1330 may include a receiver (1331) (e.g., a receive circuit). A receiver (1331) may receive one or more encoded video sequences to be decoded by a video decoder (1310); in the same or another embodiment, one encoded video sequence is received at a time, wherein the decoding of each encoded video sequence is independent of the other encoded video sequences. The encoded video sequence may be received from a channel (1301), which may be a hardware/software link to a storage device storing encoded video data. The receiver (1331) may receive encoded video data as well as other data, e.g., encoded audio data and/or auxiliary data streams, which may be forwarded to their respective use entities (not shown). The receiver (1331) may separate the encoded video sequence from other data. To prevent network jitter, a buffer memory (1315) may be coupled between the receiver (1331) and the entropy decoder/parser (1320) (hereinafter "parser (1320)"). In some applications, the buffer memory (1315) is part of the video decoder (1310). In other cases, the buffer memory (1315) may be disposed external (not labeled) to the video decoder (1310). In other cases, a buffer memory (not shown) is provided external to the video decoder (1310), for example, to prevent network jitter, and another buffer memory (1315) may be configured internal to the video decoder (1310), for example, to handle playout timing. The buffer memory (1315) may not be required to be configured or may be made smaller when the receiver (1331) receives data from a store/forward device with sufficient bandwidth and controllability or from an isochronous network. Of course, for use over a traffic packet network such as the internet, a buffer memory (1315) may also be required, which may be relatively large and may be of adaptive size, and may be implemented at least in part in an operating system or similar element (not labeled) external to the video decoder (1310).
The video decoder (1310) may include a parser (1320) to reconstruct the symbols (1321) from the encoded video sequence. The categories of these symbols include information for managing the operation of the video decoder (1310), as well as potential information to control a display device (1312) (e.g., a display screen) that is not an integral part of the electronic device (1330), but that may be coupled to the electronic device (1330), as shown in fig. 13. The control information for the display device may be auxiliary enhancement information (Supplemental Enhancement Information, SEI message) or a parameter set fragment (not labeled) of video availability information (Video Usability Information, VUI). A parser (1320) may parse/entropy decode the received encoded video sequence. The encoding of the encoded video sequence may be in accordance with video encoding techniques or standards, and may follow various principles, including variable length encoding, huffman coding (Huffman coding), arithmetic coding with or without context sensitivity, and so forth. The parser (1320) may extract a sub-group parameter set for at least one of the sub-groups of pixels in the video decoder from the encoded video sequence based on the at least one parameter corresponding to the group. A subgroup may include a group of pictures (Group of Pictures, GOP), pictures, tiles, slices, macroblocks, coding Units (CUs), blocks, transform Units (TUs), prediction Units (PUs), and so forth. The parser (1320) may also extract information, such as transform coefficients, quantizer parameter values, motion vectors, etc., from the encoded video sequence.
The parser (1320) may perform entropy decoding/parsing operations on the video sequence received from the buffer memory (1315), thereby creating symbols (1321).
Depending on the type of encoded video picture or a portion of encoded video picture (e.g., inter and intra pictures, inter and intra blocks), and other factors, the reconstruction of the symbol (1321) may involve a number of different units. Which units are involved and how are controlled by subgroup control information that a parser (1320) parses from the encoded video sequence. For brevity, such sub-group control information flow between the parser (1320) and the units below is not described.
In addition to the functional blocks already mentioned, the video decoder (1310) may be conceptually subdivided into several functional units as described below. In practical embodiments operating under commercial constraints, many of these units interact tightly with each other and may be integrated with each other. However, for the purpose of describing the disclosed subject matter, it is conceptually subdivided into the following functional units.
The first unit is a scaler/inverse transform unit (1351). The sealer/inverse transform unit (1351) receives the quantized transform coefficients as symbols (1321) from the parser (1320) along with control information including which transform mode, block size, quantization factor, quantization scaling matrix, etc. is used. The sealer/inverse transform unit (1351) may output a block comprising sample values, which may be input into the aggregator (1355).
In some cases, the output samples of the sealer/inverse transform unit (1351) may belong to an intra-coded block; namely: the predictive information from the previously reconstructed picture is not used, but a block of predictive information from the previously reconstructed portion of the current picture may be used. Such predictive information may be provided by the intra picture prediction unit (1352). In some cases, the intra picture prediction unit (1352) uses the reconstructed information extracted from the current picture buffer (1358) to generate surrounding blocks of the same size and shape as the block being reconstructed. For example, the current picture buffer (1358) buffers partially reconstructed current pictures and/or fully reconstructed current pictures. In some cases, the aggregator (1355) adds, on a per sample basis, prediction information generated by the intra-prediction unit (1352) to the output sample information provided by the sealer/inverse transform unit (1351).
In other cases, the output samples of the scaler/inverse transform unit (1351) may belong to inter-coding and potential motion compensation blocks. In this case, the motion compensated prediction unit (1353) may access the reference picture memory (1357) to extract samples for prediction. After motion compensation of the extracted samples according to the symbol (1321), these samples may be added by an aggregator (1355) to the output of the sealer/inverse transform unit (1351), in this case referred to as residual samples or residual signals, to generate output sample information. The retrieval of the prediction samples by the motion compensated prediction unit (1353) from an address within the reference picture memory (1357) may be controlled by a motion vector, and the motion vector is used by the motion compensated prediction unit (1353) in the form of the symbol (1321), e.g., comprising X, Y and reference picture components. The motion compensation may also include interpolation of sample values extracted from the reference picture store (1357), motion vector prediction mechanisms, and so forth when sub-sample accurate motion vectors are used.
The output samples of the aggregator (1355) may be employed by various loop filtering techniques in a loop filter unit (1356). Video compression techniques may include in-loop filter techniques that are controlled by parameters included in an encoded video sequence (also referred to as an encoded video stream), and that are available to a loop filter unit (1356) as symbols (1321) from a parser (1320). However, in other embodiments, the video compression techniques may also be responsive to meta information obtained during decoding of a previous (in decoding order) portion of an encoded picture or encoded video sequence, as well as to previously reconstructed and loop filtered sample values.
The output of the loop filter unit (1356) may be a stream of samples, which may be output to the display device (1312) and stored in the reference picture memory (1357) for use in subsequent inter picture prediction.
Once fully reconstructed, some encoded pictures may be used as reference pictures for future prediction. For example, once an encoded picture corresponding to a current picture is fully reconstructed and the encoded picture is identified (by, for example, a parser (1320)) as a reference picture, the current picture buffer (1358) may become part of the reference picture memory (1357) and a new current picture buffer may be reallocated before starting to reconstruct a subsequent encoded picture.
The video decoder (1310) may perform decoding operations according to a predetermined video compression technique, for example, in the ITU-T h.265 standard. The coded video sequence may conform to the syntax specified by the video compression technique or standard used in the sense that the coded video sequence follows the syntax of the video compression technique or standard and the configuration files recorded in the video compression technique or standard. In particular, a profile may select some tools from all tools available in a video compression technology or standard as the only tools available under the profile. For compliance, the complexity of the encoded video sequence is also required to be within the limits defined by the hierarchy of video compression techniques or standards. In some cases, the hierarchy limits a maximum picture size, a maximum frame rate, a maximum reconstructed sample rate (measured in units of, for example, mega samples per second), a maximum reference picture size, and so on. In some cases, the limits set by the hierarchy may be further defined by hypothetical reference decoder (Hypothetical Reference Decoder, HRD) specifications and metadata managed by an HRD buffer signaled in the encoded video sequence.
In an embodiment, the receiver (1331) may receive additional (redundant) data along with the encoded video. The additional data may be part of the encoded video sequence. The additional data may be used by the video decoder (1310) to properly decode the data and/or more accurately reconstruct the original video data. The additional data may be in the form of, for example, a temporal, spatial, or signal-to-noise ratio (signal noise ratio, SNR) enhancement layer, redundant slices, redundant pictures, forward error correction codes, and the like.
Or, as another alternative embodiment, a video decoder is configured to receive encoded pictures that are part of an encoded video sequence and decode the encoded pictures to generate reconstructed pictures. As shown in fig. 14, the video decoder (1410) includes an entropy decoder (1471), an inter-frame decoder (1480), a residual decoder (1473), a reconstruction module (1474), and an intra-frame decoder (1472) coupled together as shown in fig. 14.
An entropy decoder (1471) may be used to reconstruct certain symbols from encoded pictures, the symbols representing syntax elements that make up the encoded pictures. Such symbols may include, for example, a mode used to encode the block (e.g., an intra mode, an inter mode, a bi-predictive mode, a merge sub-mode of the latter two, or another sub-mode), prediction information (e.g., intra prediction information or inter prediction information) that may identify certain samples or metadata used by an intra decoder (1472) or an inter decoder (1480), respectively, to predict, residual information in the form of, for example, quantized transform coefficients, and so forth. In an embodiment, when the prediction mode is an inter or bi-directional prediction mode, providing inter prediction information to an inter decoder (1480); and providing the intra prediction information to an intra decoder (1472) when the prediction type is an intra prediction type. The residual information may be quantized via inverse quantization and provided to a residual decoder (1473).
An inter decoder (1480) is used to receive inter prediction information and generate inter prediction results based on the inter prediction information.
An intra decoder (1472) is configured to receive intra-prediction information and generate a prediction result based on the intra-prediction information.
A residual decoder (1473) is used to perform inverse quantization to extract dequantized transform coefficients, and process the dequantized transform coefficients to transform a residual from the frequency domain to the spatial domain. The residual decoder (1473) may also need some control information (to obtain the quantizer parameter QP), and that information may be provided by the entropy decoder (1471) (data path not labeled, since this is only a low amount of control information).
A reconstruction module (1474) is used to combine the residual output by the residual decoder (1473) with the prediction result (which may be output by the inter prediction module or the intra prediction module) in the spatial domain to form a reconstructed block, which may be part of a reconstructed picture, which in turn may be part of a reconstructed video. It should be noted that other suitable operations, such as deblocking operations, may be performed to improve visual quality.
According to still another aspect of the embodiments of the present invention, there is also provided an encoder for implementing the video encoding method described above. Optionally, the encoder may comprise a memory in which a computer program is stored and a processor arranged to perform the steps of any of the above described encoding method embodiments by means of the computer program.
Alternatively, in this embodiment, the encoder may be located in at least one network device among a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, obtaining directional prediction modes of at least two reference blocks in a coded block, wherein the reference blocks are reference blocks of a block to be coded;
s2, determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded according to the direction prediction mode difference value;
and S3, adopting the target resolution to code the block to be coded.
Optionally, as an optional example, a video encoder (1503) is provided in the electronic device (1520). The electronic device (1520) includes a transmitter (1540) (e.g., a transmission circuit).
The video encoder (1503) may receive video samples from a video source (1501) (not part of the electronic device (1520) in the fig. 15 embodiment) that may acquire video images to be encoded by the video encoder (1503). In another embodiment, the video source (1501) is part of an electronic device (1520).
The video source (1501) may provide a source video sequence in the form of a stream of digital video samples to be encoded by the video encoder (1503), which may have any suitable bit depth (e.g., 8 bits, 10 bits, 12 bits … …), any color space (e.g., bt.601Y CrCB, RGB … …), and any suitable sampling structure (e.g., Y CrCB 4:2:0, Y CrCB 4: 4). In a media service system, the video source (1501) may be a storage device storing video that has been previously prepared. In a video conferencing system, the video source (1501) may be a camera that collects local image information as a video sequence. Video data may be provided as a plurality of individual pictures that are given motion when viewed in sequence. The picture itself may be implemented as a spatial pixel array, where each pixel may include one or more samples, depending on the sampling structure, color space, etc. used. The relationship between pixels and samples can be readily understood by those skilled in the art. The following focuses on describing the sample.
According to an embodiment, the video encoder (1503) may encode and compress pictures of the source video sequence into an encoded video sequence (1543) in real-time or under any other temporal constraint required by the application. Performing the proper encoding speed is a function of the controller (1550). In some embodiments, a controller (1550) controls and is functionally coupled to other functional units as described below. For simplicity, coupling is not shown. The parameters set by the controller (1550) may include rate control related parameters (picture skip, quantizer, lambda value for rate distortion optimization techniques, etc.), picture size, picture group (group of pictures, GOP) layout, maximum motion vector search range, etc. The controller (1550) may be used to have other suitable functions related to the video encoder (1503) optimized for a certain system design.
In some embodiments, the video encoder (1503) operates in a coding loop. As a simple description, in an embodiment, the encoding loop may include a source encoder (1530) (e.g., responsible for creating symbols, such as a symbol stream, based on the input picture and reference picture to be encoded) and a (local) decoder (1533) embedded in the video encoder (1503). The decoder (1533) reconstructs the symbols to create sample data in a manner similar to the way the (remote) decoder creates sample data (since any compression between the symbols and the encoded video stream is lossless in the video compression technique contemplated by the present application). The reconstructed sample stream (sample data) is input to a reference picture memory (1534). Since decoding of the symbol stream produces a bit-accurate result independent of the decoder location (local or remote), the content in the reference picture memory (1534) also corresponds bit-accurately between the local encoder and the remote encoder. In other words, the reference picture samples "seen" by the prediction portion of the encoder are exactly the same as the sample values "seen" when the decoder would use prediction during decoding. This reference picture synchronicity rationale (and drift that occurs in the event that synchronicity cannot be maintained due to channel errors, for example) is also used in some related art.
The operation of the "local" decoder (1533) may be the same as the "remote" decoder, e.g., the video decoder that has been described in detail above in connection with fig. 13 and 14.
During operation, in some embodiments, the source encoder (1530) may perform motion compensated predictive encoding. The motion compensated predictive coding predictively codes an input picture with reference to one or more previously coded pictures from a video sequence designated as "reference pictures". In this way, an encoding engine (1532) encodes differences between pixel blocks of an input picture and pixel blocks of a reference picture, which may be selected as a prediction reference for the input picture.
The local video decoder (1533) may decode encoded video data of a picture that may be designated as a reference picture based on the symbol created by the source encoder (1530). The operation of the encoding engine (1532) may be a lossy process. When encoded video data may be decoded at a video decoder (not shown in fig. 15), the reconstructed video sequence may typically be a copy of the source video sequence with some errors. The local video decoder (1533) replicates the decoding process that may be performed on the reference picture by the video decoder and may cause the reconstructed reference picture to be stored in the reference picture cache (1534). In this way, the video encoder (1503) may locally store a copy of the reconstructed reference picture that has common content (no transmission errors) with the reconstructed reference picture to be obtained by the far-end video decoder.
The predictor (1535) may perform a prediction search for the encoding engine (1532). That is, for a new picture to be encoded, the predictor (1535) may search the reference picture memory (1534) for sample data (as candidate reference pixel blocks) or some metadata, such as reference picture motion vectors, block shapes, etc., that may be suitable prediction references for the new picture. The predictor (1535) may operate pixel-by-pixel block based on the block of samples to find a suitable prediction reference. In some cases, from search results obtained by the predictor (1535), it may be determined that the input picture may have prediction references taken from a plurality of reference pictures stored in the reference picture memory (1534).
The controller (1550) may manage the encoding operations of the source encoder (1530) including, for example, setting parameters and subgroup parameters for encoding the video data.
The outputs of all of the above functional units may be entropy encoded in an entropy encoder (1545). The entropy encoder (1545) losslessly compresses symbols generated by various functional units according to techniques such as huffman coding, variable length coding, arithmetic coding, etc., thereby converting the symbols into an encoded video sequence.
The transmitter (1540) may buffer the encoded video sequence created by the entropy encoder (1545) in preparation for transmission over a communication channel (1560), which may be a hardware/software link to a storage device that is to store encoded video data. The transmitter (1540) may combine the encoded video data from the video encoder (1503) with other data to be transmitted, such as encoded audio data and/or an auxiliary data stream (source not shown).
The controller (1550) may manage the operation of the video encoder (1503). During encoding, the controller (1550) may assign each encoded picture a certain encoded picture type, but this may affect the encoding techniques applicable to the respective picture. For example, a picture may generally be assigned to any one of the following picture types:
an intra picture (I picture), which may be a picture that can be encoded and decoded without using any other picture in the sequence as a prediction source. Some video codecs allow for different types of intra pictures, including, for example, independent decoder refresh (Independent Decoder Refresh, "IDR") pictures. Variations of the I picture and its corresponding applications and features are known to those skilled in the art.
A predictive picture (P-picture), which may be a picture that may be encoded and decoded using intra-or inter-prediction that predicts sample values for each block using at most one motion vector and a reference index.
Bi-predictive pictures (B-pictures), which may be pictures that can be encoded and decoded using intra-or inter-prediction that predicts sample values for each block using at most two motion vectors and a reference index. Similarly, multiple predictive pictures may use more than two reference pictures and associated metadata for reconstructing a single block.
A source picture may typically be spatially subdivided into blocks of samples (e.g., blocks of 4 x 4, 8 x 8, 4 x 8, or 16 x 16 samples), and encoded block by block. These blocks may be predictive coded with reference to other (coded) blocks, which are determined from the coding allocation applied to the respective pictures of the blocks. For example, a block of an I picture may be non-predictive encoded, or the block may be predictive encoded (spatial prediction or intra prediction) with reference to an already encoded block of the same picture. The pixel blocks of the P picture may be prediction encoded by spatial prediction or by temporal prediction with reference to a previously encoded reference picture. A block of B pictures may be prediction encoded by spatial prediction or by temporal prediction with reference to one or two previously encoded reference pictures.
Video encoder (1503) may perform encoding operations according to predetermined video encoding techniques or standards, such as ITU-T h.265 recommendation. In operation, the video encoder (1503) may perform various compression operations, including predictive coding operations that exploit temporal and spatial redundancies in the input video sequence. Thus, the encoded video data may conform to the syntax specified by the video encoding technique or standard used.
In an embodiment, the transmitter (1540) may transmit the additional data when transmitting the encoded video. The source encoder 1530 may take such data as part of an encoded video sequence. The additional data may include temporal/spatial/SNR enhancement layers, redundant pictures and slices, other forms of redundant data, SEI messages, VUI parameter set slices, and the like.
The acquired video may be used as a plurality of source pictures (video pictures) in a time series. Intra picture prediction (often abbreviated as intra prediction) exploits spatial correlation in a given picture, while inter picture prediction exploits (temporal or other) correlation between pictures. In an embodiment, a specific picture being encoded/decoded is divided into blocks, and the specific picture being encoded/decoded is referred to as a current picture. When a block in the current picture is similar to a reference block in a reference picture that has been previously encoded and still buffered in video, the block in the current picture may be encoded by a vector called a motion vector. The motion vector points to a reference block in a reference picture, and in the case of using multiple reference pictures, the motion vector may have a third dimension that identifies the reference picture.
In some embodiments, bi-prediction techniques may be used in inter-picture prediction. According to bi-prediction techniques, two reference pictures are used, e.g., a first reference picture and a second reference picture, both preceding a current picture in video in decoding order (but possibly in display order in the past and future, respectively). The block in the current picture may be encoded by a first motion vector pointing to a first reference block in a first reference picture and a second motion vector pointing to a second reference block in a second reference picture. In particular, the block may be predicted by a combination of the first reference block and the second reference block.
Furthermore, merge mode techniques may be used in inter picture prediction to improve coding efficiency.
According to some embodiments of the present disclosure, prediction such as inter-picture prediction and intra-picture prediction is performed in units of blocks. For example, according to the HEVC standard, pictures in a sequence of video pictures are partitioned into Coding Tree Units (CTUs) for compression, with CTUs in the pictures having the same size, such as 64 x 64 pixels, 32 x 32 pixels, or 16 x 16 pixels. In general, a CTU includes three coding tree blocks (coding tree block, CTB), which are one luma CTB and two chroma CTBs. Still further, each CTU may be split into one or more Coding Units (CUs) in a quadtree. For example, a 64×64 pixel CTU may be split into one 64×64 pixel CU, or 4 32×32 pixel CUs, or 16 16×16 pixel CUs. In an embodiment, each CU is analyzed to determine a prediction type for the CU, such as an inter prediction type or an intra prediction type. Furthermore, depending on temporal and/or spatial predictability, a CU is split into one or more Prediction Units (PUs). In general, each PU includes a luminance Prediction Block (PB) and two chrominance PB. In an embodiment, a prediction operation in encoding (encoding/decoding) is performed in units of prediction blocks. Taking a luminance prediction block as an example of a prediction block, the prediction block includes a matrix of pixel values (e.g., luminance values), such as 8×8 pixels, 16×16 pixels, 8×16 pixels, 16×8 pixels, and so on.
Or, as an alternative implementation, a video encoder is used to receive a processing block (e.g., a prediction block) of sample values within a current video picture in a sequence of video pictures and encode the processing block into an encoded picture that is part of the encoded video sequence. For example, as shown in fig. 16, in an HEVC embodiment, a video encoder (1603) receives a matrix of sample values for processing blocks, such as prediction blocks of 8 x 8 samples, etc. A video encoder (1603) uses, for example, rate-distortion (RD) optimization to determine whether to encode the processing block using intra-mode, inter-mode, or bi-predictive mode. When encoding a processing block in intra mode, a video encoder (1603) may use intra prediction techniques to encode the processing block into an encoded picture; and when encoding the processing block in inter mode or bi-predictive mode, the video encoder (1603) may encode the processing block into the encoded picture using inter prediction or bi-predictive techniques, respectively. In some video coding techniques, the merge mode may be an inter picture predictor mode in which motion vectors are derived from one or more motion vector predictors without resorting to coded motion vector components outside of the predictors. In some other video coding techniques, there may be motion vector components that are applicable to the subject block. In an embodiment, the video encoder (1603) includes other components, such as a mode decision module (not shown) for determining a processing block mode.
In the embodiment of fig. 16, the video encoder (1603) includes an inter encoder (1630), an intra encoder (1622), a residual calculator (1623), a switch (16216), a residual encoder (1624), a general controller (1621), and an entropy encoder (1625) coupled together as shown in fig. 16.
The inter-encoder (1630) is configured to receive samples of a current block (e.g., a processed block), compare the block to one or more of the reference blocks (e.g., blocks in a previous picture and a subsequent picture), generate inter-prediction information (e.g., redundancy information description, motion vectors, merge mode information according to inter-coding techniques), and calculate inter-prediction results (e.g., predicted blocks) based on the inter-prediction information using any suitable technique. In some embodiments, the reference picture is a decoded reference picture that is decoded based on the encoded video information.
An intra encoder (1622) is used to receive samples of a current block (e.g., a processing block), in some cases compare the block to blocks encoded in the same picture, generate quantization coefficients after transformation, and in some cases also generate intra prediction information (e.g., according to intra prediction direction information of one or more intra coding techniques). In an embodiment, the intra-encoder (1622) also calculates an intra-prediction result (e.g., a predicted block) based on the intra-prediction information and a reference block in the same picture.
The universal controller (1621) is to determine universal control data and control other components of the video encoder (1603) based on the universal control data. In an embodiment, the universal controller (1621) determines a mode of the block and provides a control signal to the switch (16216) based on the mode. For example, when the mode is an intra mode, the universal controller (1621) controls the switch (16216) to select an intra mode result for use by the residual calculator (1623) and controls the entropy encoder (1625) to select intra prediction information and add the intra prediction information in the bitstream; and when the mode is an inter mode, the universal controller (1621) controls the switch (16216) to select an inter prediction result for use by the residual calculator (1623) and controls the entropy encoder (1625) to select inter prediction information and add the inter prediction information in the bitstream.
The residual calculator (1623) is for calculating a difference (residual data) between the received block and a prediction result selected from the intra encoder (1622) or the inter encoder (1630). A residual encoder (1624) is operable based on the residual data to encode the residual data to generate transform coefficients. In an embodiment, a residual encoder (1624) is used to convert residual data from the time domain to the frequency domain and generate transform coefficients. The transform coefficients are then processed through quantization to obtain quantized transform coefficients. In various embodiments, the video encoder (1603) further comprises a residual decoder (1628). A residual decoder (1628) is used to perform the inverse transform and generate decoded residual data. The decoded residual data may be suitably used by an intra-frame encoder (1622) and an inter-frame encoder (1630). For example, the inter-encoder (1630) may generate a decoded block based on the decoded residual data and the inter-prediction information, and the intra-encoder (1622) may generate a decoded block based on the decoded residual data and the intra-prediction information. The decoded blocks are processed appropriately to generate decoded pictures, and in some embodiments, the decoded pictures may be buffered in a memory circuit (not shown) and used as reference pictures.
An entropy encoder (1625) is used to format the code stream to produce encoded blocks. The entropy encoder (1625) generates various information according to suitable standards, such as the HEVC standard. In an embodiment, an entropy encoder (1625) is used to obtain general control data, selected prediction information (e.g., intra prediction information or inter prediction information), residual information, and other suitable information in the bitstream. It should be noted that, according to the disclosed subject matter, when a block is encoded in an inter mode or a merge sub-mode of a bi-prediction mode, there is no residual information.
Alternatively, the encoder and decoder described above may be applied, but are not limited to, in the scenario shown in fig. 17.
Fig. 17 is a simplified block diagram of a communication system (1700) according to the disclosed embodiments. The communication system (1700) includes a plurality of terminal devices that can communicate with each other through, for example, a network (1750). For example, the communication system (1700) includes a first terminal device (1710) and a second terminal device (1720) interconnected by a network (1750). In the embodiment of fig. 17, the first terminal device (1710) and the second terminal device (1720) perform unidirectional data transmission. For example, the first end device (1710) may encode video data, such as a video picture stream acquired by the end device (1710), for transmission to the second end device (1720) over the network (1750). The encoded video data is transmitted in one or more encoded video code streams. The second terminal device (1720) may receive the encoded video data from the network (1750), decode the encoded video data to recover the video data, and display the video picture according to the recovered video data. Unidirectional data transmission is common in applications such as media services. Alternatively, the first terminal device may be the above encoder in the present scheme, and the second terminal device may be the above decoder in the present scheme.
In another embodiment, the communication system (1700) includes a third terminal device (1730) and a fourth terminal device (1740) that perform bi-directional transmission of encoded video data, which may occur, for example, during a video conference. For bi-directional data transmission, each of the third terminal device (1730) and the fourth terminal device (1740) may encode video data (e.g., a video picture stream collected by the terminal device) for transmission over the network (1750) to the other of the third terminal device (1730) and the fourth terminal device (1740). Each of the third terminal device (1730) and the fourth terminal device (1740) may also receive encoded video data transmitted by the other of the third terminal device (1730) and the fourth terminal device (1740), and may decode the encoded video data to recover the video data, and may display a video picture on an accessible display device according to the recovered video data.
Alternatively, both the first terminal device and the second terminal device may include the encoder and decoder described above in this scheme.
In the embodiment of fig. 17, the first terminal device (1710), the second terminal device (1720), the third terminal device (1730), and the fourth terminal device (1740) may be servers, personal computers, and smart phones, but the principles of the present disclosure may not be limited thereto. The disclosed embodiments are applicable to laptop computers, tablet computers, media players, and/or dedicated video conferencing devices. The network (1750) represents any number of networks that transfer encoded video data between the first terminal device (1710), the second terminal device (1720), the third terminal device (1730), and the fourth terminal device (1740), including, for example, wired (e.g., wired) and/or wireless communication networks. The communication network (1750) may exchange data in circuit-switched and/or packet-switched channels. The network may include a telecommunications network, a local area network, a wide area network, and/or the internet. For the purposes of the present application, the architecture and topology of the network (1750) may be irrelevant for the operation of the present disclosure, unless explained below.
As an example, fig. 18 shows the placement of video encoders and video decoders in a streaming environment. The presently disclosed subject matter is equally applicable to other video-enabled applications including, for example, video conferencing, digital TV, storing compressed video on digital media including CDs, DVDs, memory sticks, etc.
The streaming system may include an acquisition subsystem (1813) that may include a video source (1801), such as a digital camera, that creates an uncompressed video clip stream (1802). In an embodiment, a video picture stream (1802) includes samples taken by a digital camera. The video picture stream (1802) is depicted as a bold line compared to the encoded video data (1804) (or encoded video code stream) to emphasize a high data amount video picture stream, the video picture stream (1802) may be processed by an electronic device (1820) that includes a video encoder (18018) coupled to a video source (1801). The video encoder (18018) may include hardware, software, or a combination of hardware and software to implement or implement aspects of the disclosed subject matter as described in more detail below. Compared to the video picture stream (1802), the encoded video data (1804) (or encoded video code stream (1804)) is depicted as thin lines to emphasize lower data amounts of the encoded video data (1804) (or encoded video code stream (1804)), which may be stored on a streaming server (1805) for future use. One or more streaming client sub-systems, such as client sub-system (1806) and client sub-system (1808) in fig. 18, may access streaming server (1805) to retrieve a copy (1807) and copy (1809) of encoded video data (1804). The client subsystem (1806) may include, for example, a video decoder (1810) in an electronic device (1830). The video decoder (1810) decodes an incoming copy (1807) of the encoded video data and generates an output video picture stream (1811) that can be presented on a display (1812) (e.g., a display screen) or another presentation device (not depicted). In some streaming systems, the encoded video data (1804), video data (1807), and video data (1809) (e.g., a video bitstream) may be encoded according to some video encoding/compression standard. Examples of such standards include ITU-T H.265. In an embodiment, the video coding standard being developed is informally referred to as next generation video coding (Versatile Video Coding, VVC), and the present application may be used in the context of the VVC standard.
It should be noted that electronic device (1820) and electronic device (1830) may include other components (not shown). For example, electronic device (1820) may include a video decoder (not shown), and electronic device (1830) may also include a video encoder (not shown).
According to a further aspect of embodiments of the present invention, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, acquiring directional prediction modes of at least two reference blocks in a decoded block, wherein the reference blocks are reference blocks of a block to be decoded;
s2, determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value;
and S3, decoding the block to be decoded by adopting the target resolution.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
S1, obtaining directional prediction modes of at least two reference blocks in a coded block, wherein the reference blocks are reference blocks of a block to be coded;
s2, determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded according to the direction prediction mode difference value;
and S3, adopting the target resolution to code the block to be coded.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided by the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (27)

1. A video decoding method, comprising:
acquiring directional prediction modes of at least two reference blocks in a decoded block, wherein the reference blocks are reference blocks of a block to be decoded;
determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value;
and decoding the block to be decoded by adopting the target resolution.
2. The method according to claim 1, wherein determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value, comprises:
determining the target resolution as a first resolution in the case that the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is greater than or equal to a first predetermined threshold;
determining the target resolution as a second resolution in the case that the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is less than the first predetermined threshold and greater than or equal to a second predetermined threshold, wherein the first resolution is less than the second resolution;
and determining the target resolution as a third resolution in the case that the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is less than the second predetermined threshold and greater than or equal to a third predetermined threshold, wherein the second resolution is less than the third resolution.
3. The method according to claim 1, wherein determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for decoding the block to be decoded according to the direction prediction mode difference value, comprises:
Determining the target resolution as a first resolution in the case that the direction prediction mode difference value is greater than or equal to a fourth predetermined threshold;
determining the target resolution as a second resolution in the case that the direction prediction mode difference value is less than the fourth predetermined threshold and the direction prediction mode difference value is greater than or equal to a fifth predetermined threshold, wherein the first resolution is less than the second resolution;
and determining the target resolution as a third resolution in the case that the direction prediction mode difference value is smaller than the fifth predetermined threshold and the direction prediction mode difference value is greater than or equal to a sixth predetermined threshold, wherein the second resolution is smaller than the third resolution.
4. The method of claim 1, wherein the reference block is a set of reference blocks, wherein the determining a target resolution for decoding the block to be decoded based on the direction prediction mode difference value of the reference block comprises:
acquiring a directional prediction mode of each reference block in the set of reference blocks;
carrying out weighted summation on the directional prediction modes of each reference block to obtain a directional prediction mode difference value of the group of reference blocks; or determining the difference value between the largest directional prediction mode and the smallest directional prediction mode in the directional prediction modes of each reference block as the directional prediction mode difference value of the group of reference blocks;
Determining the target resolution as a first resolution in the case that the direction prediction mode difference value is greater than or equal to a seventh predetermined threshold;
determining the target resolution as a second resolution in the case that the direction prediction mode difference value is less than the seventh predetermined threshold and the direction prediction mode difference value is greater than or equal to an eighth predetermined threshold, wherein the first resolution is less than the second resolution;
and determining the target resolution as a third resolution in the case that the direction prediction mode difference value is smaller than the eighth predetermined threshold value and the direction prediction mode difference value is greater than or equal to a ninth predetermined threshold value, wherein the second resolution is smaller than the third resolution.
5. The method of claim 4, wherein the obtaining a directional prediction mode for each reference block in the set of reference blocks comprises:
acquiring a directional prediction mode of each pixel in a current reference block in the set of reference blocks;
calculating the variance of the directional prediction mode of each pixel;
taking the variance as a directional prediction mode of the current reference block;
and taking each reference block in the group of reference blocks as the current reference block, and acquiring a directional prediction mode of each reference block in the group of reference blocks.
6. The method according to any one of claims 1 to 4, wherein a positional relationship between the block to be decoded and the reference block is the same or different for different blocks to be decoded, wherein in the case where the positional relationship between the block to be decoded and the reference block is different for different blocks to be decoded, in the process of decoding the block to be decoded with the target resolution, the method further comprises:
and acquiring a flag bit carried in the block to be decoded, wherein the flag bit is used for indicating the position relation.
7. A video encoding method, comprising:
acquiring directional prediction modes of at least two reference blocks in a coded block, wherein the reference blocks are reference blocks of a block to be coded;
determining a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded according to the direction prediction mode difference value;
and adopting the target resolution to code the block to be coded.
8. The method of claim 7, wherein determining a direction prediction mode difference value for the reference block based on the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded based on the direction prediction mode difference value, comprises:
Determining the target resolution as a first resolution in the case that the direction prediction mode difference value indicates that the intra texture complexity of the block to be encoded is greater than or equal to a first predetermined threshold;
determining the target resolution as a second resolution in the case that the direction prediction mode difference value indicates that the intra texture complexity of the block to be encoded is less than the first predetermined threshold and greater than or equal to a second predetermined threshold, wherein the first resolution is less than the second resolution;
and determining the target resolution as a third resolution in the case that the direction prediction mode difference value indicates that the intra texture complexity of the block to be encoded is smaller than the second predetermined threshold and greater than or equal to a third predetermined threshold, wherein the second resolution is smaller than the third resolution.
9. The method of claim 7, wherein determining a direction prediction mode difference value for the reference block based on the directional prediction modes of the at least two reference blocks, and determining a target resolution for encoding the block to be encoded based on the direction prediction mode difference value, comprises:
determining the target resolution as a first resolution in the case that the direction prediction mode difference value is greater than or equal to a fourth predetermined threshold;
Determining the target resolution as a second resolution in the case that the direction prediction mode difference value is less than the fourth predetermined threshold and the direction prediction mode difference value is greater than or equal to a fifth predetermined threshold, wherein the first resolution is less than the second resolution;
and determining the target resolution as a third resolution in the case that the direction prediction mode difference value is smaller than the fifth predetermined threshold and the direction prediction mode difference value is greater than or equal to a sixth predetermined threshold, wherein the second resolution is smaller than the third resolution.
10. The method of claim 7, wherein the reference block is a set of reference blocks, wherein the determining a target resolution for encoding the block to be encoded based on the direction prediction mode difference value of the reference block comprises:
acquiring a directional prediction mode of each reference block in the set of reference blocks;
carrying out weighted summation on the directional prediction modes of each reference block to obtain a directional prediction mode difference value of the group of reference blocks; or determining the difference value between the largest directional prediction mode and the smallest directional prediction mode in the directional prediction modes of each reference block as the directional prediction mode difference value of the group of reference blocks;
Determining the target resolution as a first resolution in the case that the direction prediction mode difference value is greater than or equal to a seventh predetermined threshold;
determining the target resolution as a second resolution in the case that the direction prediction mode difference value is less than the seventh predetermined threshold and the direction prediction mode difference value is greater than or equal to an eighth predetermined threshold, wherein the first resolution is less than the second resolution;
and determining the target resolution as a third resolution in the case that the direction prediction mode difference value is smaller than the eighth predetermined threshold value and the direction prediction mode difference value is greater than or equal to a ninth predetermined threshold value, wherein the second resolution is smaller than the third resolution.
11. The method of claim 10, wherein the obtaining the directional prediction mode for each reference block in the set of reference blocks comprises:
acquiring a directional prediction mode of each pixel in a current reference block in the set of reference blocks;
calculating the variance of the directional prediction mode of each pixel;
taking the variance as a directional prediction mode of the current reference block;
And taking each reference block in the group of reference blocks as the current reference block, and acquiring a directional prediction mode of each reference block in the group of reference blocks.
12. The method according to any one of claims 7 to 11, wherein a positional relationship between the block to be encoded and the reference block is the same or different for different blocks to be encoded, wherein in the case where the positional relationship between the block to be encoded and the reference block is different for different blocks to be encoded, in the process of encoding the block to be encoded with the target resolution, the method further comprises:
setting a flag bit in encoded data obtained by encoding the block to be encoded, wherein the flag bit is used for indicating the position relationship.
13. A video decoding apparatus, comprising:
a first obtaining unit, configured to obtain directional prediction modes of at least two reference blocks in a decoded block, where the reference blocks are reference blocks of a block to be decoded;
a determining unit, configured to determine a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determine a target resolution for decoding the block to be decoded according to the direction prediction mode difference value;
And the decoding unit is used for decoding the block to be decoded by adopting the target resolution.
14. The apparatus according to claim 13, wherein the determining unit comprises:
a first determining module, configured to determine, when the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is greater than or equal to a first predetermined threshold, that the target resolution is a first resolution;
a second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is less than the first predetermined threshold and greater than or equal to a second predetermined threshold, where the first resolution is less than the second resolution;
and a third determining module, configured to determine the target resolution as a third resolution if the direction prediction mode difference value indicates that the intra texture complexity of the block to be decoded is less than the second predetermined threshold and greater than or equal to a third predetermined threshold, where the second resolution is less than the third resolution.
15. The apparatus according to claim 13, wherein the determining unit comprises:
A first determining module, configured to determine, when the direction prediction mode difference value is greater than or equal to a fourth predetermined threshold, that the target resolution is a first resolution;
a second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value is less than the fourth predetermined threshold and the direction prediction mode difference value is greater than or equal to a fifth predetermined threshold, where the first resolution is less than the second resolution;
and a third determining module, configured to determine that the target resolution is a third resolution if the direction prediction mode difference value is less than the fifth predetermined threshold and the direction prediction mode difference value is greater than or equal to a sixth predetermined threshold, where the second resolution is less than the third resolution.
16. The apparatus of claim 13, wherein the reference block is a set of reference blocks, and wherein the determining unit comprises:
an acquisition module for acquiring a directional prediction mode of each reference block in the set of reference blocks;
the calculation module is used for carrying out weighted summation on the directional prediction modes of each reference block to obtain a directional prediction mode difference value of the group of reference blocks; or determining the difference value between the largest directional prediction mode and the smallest directional prediction mode in the directional prediction modes of each reference block as the directional prediction mode difference value of the group of reference blocks;
A first determining module, configured to determine, when the direction prediction mode difference value is greater than or equal to a seventh predetermined threshold, that the target resolution is a first resolution;
a second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value is less than the seventh predetermined threshold and the direction prediction mode difference value is greater than or equal to an eighth predetermined threshold, where the first resolution is less than the second resolution;
and a third determining module, configured to determine that the target resolution is a third resolution if the direction prediction mode difference value is less than the eighth predetermined threshold and the direction prediction mode difference value is greater than or equal to a ninth predetermined threshold, where the second resolution is less than the third resolution.
17. The apparatus of claim 16, wherein the acquisition module comprises:
a first acquisition sub-module for acquiring a directional prediction mode of each pixel in a current reference block of the set of reference blocks;
a calculation sub-module for calculating a variance of the directional prediction mode of each pixel;
A determining sub-module for taking the variance as a directional prediction mode of the current reference block;
and the second acquisition sub-module is used for taking each reference block in the group of reference blocks as the current reference block and acquiring a directional prediction mode of each reference block in the group of reference blocks.
18. The apparatus according to any one of claims 13 to 17, wherein a positional relationship between the block to be decoded and the reference block is the same or different for different blocks to be decoded, the apparatus further comprising:
and the second obtaining unit is used for obtaining a flag bit carried in the block to be decoded in the process of decoding the block to be decoded by adopting the target resolution under the condition that the position relationship between the block to be decoded and the reference block is different for different blocks to be decoded, wherein the flag bit is used for indicating the position relationship.
19. A video encoding apparatus, comprising:
an obtaining unit, configured to obtain directional prediction modes of at least two reference blocks in an encoded block, where the reference blocks are reference blocks of a block to be encoded;
A determining unit, configured to determine a direction prediction mode difference value of the reference block according to the directional prediction modes of the at least two reference blocks, and determine a target resolution for encoding the block to be encoded according to the direction prediction mode difference value;
and the encoding unit is used for encoding the block to be encoded by adopting the target resolution.
20. The apparatus according to claim 19, wherein the determining unit comprises:
a first determining module, configured to determine, when the direction prediction mode difference value indicates that the intra texture complexity of the block to be encoded is greater than or equal to a first predetermined threshold, that the target resolution is a first resolution;
a second determining module, configured to determine the target resolution as a second resolution if the direction prediction mode difference value indicates that the intra texture complexity of the block to be encoded is less than the first predetermined threshold and the direction prediction mode difference value is greater than or equal to a second predetermined threshold, where the first resolution is less than the second resolution;
a third determining module, configured to determine the target resolution as a third resolution if the direction prediction mode difference value indicates that the intra-texture complexity of the block to be encoded is less than the second predetermined threshold and the direction prediction mode difference value is greater than or equal to a third predetermined threshold, where the second resolution is less than the third resolution.
21. The apparatus according to claim 19, wherein the determining unit comprises:
a first determining module, configured to determine, when the direction prediction mode difference value is greater than or equal to a fourth predetermined threshold, that the target resolution is a first resolution;
a second determining module configured to determine the target resolution as a second resolution in a case where the direction prediction mode difference value is smaller than the fourth predetermined threshold and the direction prediction mode difference value is greater than or equal to a fifth predetermined threshold, where the first resolution is smaller than the second resolution
A second resolution;
a third determining module configured to determine the target resolution as a third resolution in a case where the direction prediction mode difference value is smaller than the fifth predetermined threshold and the direction prediction mode difference value is greater than or equal to a sixth predetermined threshold, where the second resolution is smaller than the fifth predetermined threshold
And a third resolution.
22. The apparatus of claim 19, wherein the reference block is a set of reference blocks, and wherein the determining unit comprises:
an acquisition module for acquiring a directional prediction mode of each reference block in the set of reference blocks;
The calculation module is used for carrying out weighted summation on the directional prediction modes of each reference block to obtain a directional prediction mode difference value of the group of reference blocks; or determining the difference value between the largest directional prediction mode and the smallest directional prediction mode in the directional prediction modes of each reference block as the directional prediction mode difference value of the group of reference blocks;
a first determining module, configured to determine, when the direction prediction mode difference value is greater than or equal to a seventh predetermined threshold, that the target resolution is a first resolution;
a second determining module configured to determine the target resolution as a second resolution in a case where the direction prediction mode difference value is smaller than the seventh predetermined threshold and the direction prediction mode difference value is greater than or equal to an eighth predetermined threshold, where the first resolution is smaller than the second resolution
A second resolution;
a third determining module configured to determine the target resolution as a third resolution in a case where the direction prediction mode difference value is smaller than the eighth predetermined threshold and the direction prediction mode difference value is greater than or equal to a ninth predetermined threshold, where the second resolution is smaller than the eighth predetermined threshold
And a third resolution.
23. The apparatus of claim 22, wherein the means for obtaining comprises:
a first acquisition sub-module for acquiring a directional prediction mode of each pixel in a current reference block of the set of reference blocks;
a calculation sub-module for calculating a variance of the directional prediction mode of each pixel;
a determining sub-module for taking the variance as a directional prediction mode of the current reference block;
and the second acquisition sub-module is used for taking each reference block in the group of reference blocks as the current reference block and acquiring a directional prediction mode of each reference block in the group of reference blocks.
24. The apparatus according to any one of claims 19 to 23, wherein the positional relationship between the block to be encoded and the reference block is the same or different for different blocks to be encoded, the apparatus further comprising:
the setting unit is configured to set a flag bit in encoded data obtained by encoding the block to be encoded in the process of encoding the block to be encoded with the target resolution, where the positional relationship between the block to be encoded and the reference block is different for different blocks to be encoded, and the flag bit is used to indicate the positional relationship.
25. A computer readable storage medium, characterized in that the storage medium has stored therein a computer program, wherein the computer program is arranged to perform the method of any of the claims 1 to 6 or 7 to 12 when run.
26. A decoder comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 6 by means of the computer program.
27. An encoder comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to perform the method of any of claims 7 to 12 by means of the computer program.
CN201910927988.9A 2019-09-27 2019-09-27 Video decoding and encoding method and device, storage medium, decoder and encoder Active CN110572680B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910927988.9A CN110572680B (en) 2019-09-27 2019-09-27 Video decoding and encoding method and device, storage medium, decoder and encoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910927988.9A CN110572680B (en) 2019-09-27 2019-09-27 Video decoding and encoding method and device, storage medium, decoder and encoder

Publications (2)

Publication Number Publication Date
CN110572680A CN110572680A (en) 2019-12-13
CN110572680B true CN110572680B (en) 2023-10-24

Family

ID=68783137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910927988.9A Active CN110572680B (en) 2019-09-27 2019-09-27 Video decoding and encoding method and device, storage medium, decoder and encoder

Country Status (1)

Country Link
CN (1) CN110572680B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1939066A (en) * 2004-04-02 2007-03-28 汤姆森许可贸易公司 Method and apparatus for complexity scalable video decoder
CN108848380A (en) * 2018-06-20 2018-11-20 腾讯科技(深圳)有限公司 Video coding and decoding method, apparatus, computer equipment and storage medium
EP3410708A1 (en) * 2017-05-31 2018-12-05 Thomson Licensing Method and apparatus for intra prediction with interpolation

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130329806A1 (en) * 2012-06-08 2013-12-12 Qualcomm Incorporated Bi-layer texture prediction for video coding
GB2509703B (en) * 2013-01-04 2016-09-14 Canon Kk Method and apparatus for encoding an image into a video bitstream and decoding corresponding video bitstream using enhanced inter layer residual prediction
US10638137B2 (en) * 2018-03-07 2020-04-28 Tencent America LLC Method and apparatus for video coding

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1939066A (en) * 2004-04-02 2007-03-28 汤姆森许可贸易公司 Method and apparatus for complexity scalable video decoder
EP3410708A1 (en) * 2017-05-31 2018-12-05 Thomson Licensing Method and apparatus for intra prediction with interpolation
CN108848380A (en) * 2018-06-20 2018-11-20 腾讯科技(深圳)有限公司 Video coding and decoding method, apparatus, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110572680A (en) 2019-12-13

Similar Documents

Publication Publication Date Title
CN113614736B (en) Video encoding and decoding method and device
CN111869212B (en) Video decoding method, device and readable medium
CN111903131B (en) Method, apparatus and computer readable medium for video decoding in a decoder
CN111492659B (en) Video decoding method and device and storage medium
CN114666581B (en) Video encoding and decoding method, device and storage medium
CN113875234B (en) Video decoding method, device and medium
CN112655205B (en) Video encoding and decoding method and device
CN110944185B (en) Video decoding method and device, computer equipment and storage medium
CN113557527B (en) Video decoding method, video decoder and medium
CN111989918A (en) Method and apparatus for multi-line intra prediction in video compression
CN111937326B (en) Video decoding method, device and readable storage medium
CN113196745B (en) Video encoding and decoding method and device
CN113785564B (en) Video encoding and decoding method and device
CN113661702B (en) Video encoding and decoding method, device and storage medium
CN111901609B (en) Video decoding method and device, computer equipment and storage medium
CN110784711A (en) Method and device for generating merging candidate list for encoding or decoding video sequence
CN112514385B (en) Video decoding method and device, computer equipment and computer readable medium
CN113348668B (en) Video decoding method, device and storage medium
CN110636302B (en) Video decoding and encoding methods and devices, storage medium, decoder and encoder
CN113228649B (en) Video decoding method, device and storage medium
CN113497940B (en) Video decoding method, device, computer equipment and storage medium
CN111726622B (en) Video encoding and decoding method, device and medium
CN113228631B (en) Video encoding and decoding method and device
CN111726627B (en) Video decoding method, device, computer equipment and storage medium
CN110636288B (en) Video decoding and encoding method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40019352

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant