CN111669585B - Intra-frame prediction method, video coding method, and related equipment and device - Google Patents

Intra-frame prediction method, video coding method, and related equipment and device Download PDF

Info

Publication number
CN111669585B
CN111669585B CN202010537899.6A CN202010537899A CN111669585B CN 111669585 B CN111669585 B CN 111669585B CN 202010537899 A CN202010537899 A CN 202010537899A CN 111669585 B CN111669585 B CN 111669585B
Authority
CN
China
Prior art keywords
block
coded
prediction
deviation
parameter
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
CN202010537899.6A
Other languages
Chinese (zh)
Other versions
CN111669585A (en
Inventor
方瑞东
林聚财
江东
陈瑶
殷俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202010537899.6A priority Critical patent/CN111669585B/en
Publication of CN111669585A publication Critical patent/CN111669585A/en
Application granted granted Critical
Publication of CN111669585B publication Critical patent/CN111669585B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • 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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • 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/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/186Methods 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 a colour or a chrominance component

Landscapes

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

Abstract

The application discloses an intra-frame prediction method, a video coding method, related equipment and devices, wherein the intra-frame prediction method comprises the following steps: acquiring brightness prediction parameters of subblocks included in a block to be coded; selecting at least one target coded block corresponding to the sub-block from the plurality of coded blocks by using the brightness prediction parameters of the sub-block; the plurality of coded blocks are positioned in a preset range of the blocks to be coded; and processing the pixel information of at least one target coded block by using a preset prediction mode to obtain a component conversion parameter between a brightness prediction parameter and a chroma prediction parameter of the subblock. According to the scheme, the accuracy of intra-frame prediction can be improved.

Description

Intra-frame prediction method, video coding method, and related equipment and device
Technical Field
The present application relates to the field of video coding technologies, and in particular, to an intra prediction method, a video coding method, and related devices and apparatuses.
Background
The video coding technology aims to solve the video compression problem so as to improve the video transmission and storage efficiency. Currently, video coding techniques include: H.264/AVC (Advanced Video Coding), H.265/HEVC (High Efficiency Video Coding), H.266/VVC (Versatile Video Coding), and the like. Among these techniques, intra-prediction is one of the very critical functional modules, the accuracy of which has a significant impact on video coding performance. Therefore, how to improve the accuracy of intra prediction becomes a challenge.
Disclosure of Invention
The technical problem mainly solved by the application is to provide an intra-frame prediction method, a video coding method, related equipment and devices, which can improve the accuracy of intra-frame prediction.
In order to solve the above problem, a first aspect of the present application provides an intra prediction method, including: acquiring brightness prediction parameters of subblocks included in a block to be coded; selecting at least one target coded block corresponding to the sub-block from the plurality of coded blocks by using the brightness prediction parameter of the sub-block; the method comprises the steps that a plurality of coded blocks are located in a preset range of blocks to be coded; and processing the pixel information of at least one target coded block by using a preset prediction mode to obtain a component conversion parameter between a brightness prediction parameter and a chroma prediction parameter of the subblock.
In order to solve the above problem, a second aspect of the present application provides a video encoding method, including: acquiring a brightness prediction parameter of a sub-block contained in a block to be coded, and acquiring a component conversion parameter between the brightness prediction parameter and a chroma prediction parameter of the sub-block; coding the subblocks included by the block to be coded based on the brightness prediction parameter and the component conversion parameter of the subblocks included by the block to be coded; wherein the component transformation parameters of the sub-blocks are obtained by using the intra prediction method in the first aspect.
In order to solve the above problem, a third aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, the memory storing program instructions, and the processor being configured to execute the program instructions to implement the intra prediction method in the first aspect or implement the video coding method in the second aspect.
In order to solve the above problem, a fourth aspect of the present application provides a storage device storing program instructions executable by a processor for implementing the intra prediction method in the first aspect described above or for implementing the video encoding method in the second aspect described above.
According to the scheme, the luminance prediction parameters of the sub-blocks contained in the blocks to be coded are obtained, the at least one target coded block corresponding to the sub-blocks is selected from the plurality of coded blocks, the plurality of coded blocks are located in the preset range of the blocks to be coded, the pixel information of the at least one target coded block is processed in a preset prediction mode, the component conversion parameters between the luminance prediction parameters and the chrominance prediction parameters of the sub-blocks are obtained, the luminance prediction parameters can be used for guiding the prediction of the chrominance prediction parameters, the accuracy of chrominance prediction is improved, and the accuracy of intra-frame prediction can be improved. In addition, the luminance prediction parameter is used for guiding the prediction of the chrominance prediction parameter, and the component conversion parameter is used for converting the luminance prediction parameter into the chrominance prediction parameter, so that the linear redundancy between the luminance component and the chrominance component can be reduced, and the performance of video coding is improved; the brightness prediction parameters and the corresponding component conversion parameters of the sub-blocks contained in the block to be coded are obtained, and the whole prediction task of the block to be coded can be decomposed into the prediction tasks of the sub-blocks, so that the block to be coded can be coded by using the component conversion parameters, the situation of low coding quality possibly caused by coding by using a single component conversion parameter can be favorably reduced, and the video coding performance can be improved.
Drawings
FIG. 1 is a flowchart illustrating an embodiment of an intra prediction method according to the present application;
FIG. 2 is a diagram of an embodiment of partitioning blocks to be encoded;
FIG. 3 is a schematic flowchart illustrating an embodiment of step S12 in FIG. 1;
FIG. 4 is a schematic diagram of one embodiment of a prediction direction;
FIG. 5 is a schematic diagram of another embodiment of prediction directions;
FIG. 6 is a schematic diagram of yet another embodiment of prediction directions;
FIG. 7 is a flowchart illustrating an embodiment of a video encoding method of the present application;
FIG. 8 is a block diagram of an embodiment of an intra prediction apparatus according to the present application;
FIG. 9 is a block diagram of an embodiment of a video encoding apparatus of the present application;
FIG. 10 is a block diagram of an embodiment of an electronic device of the present application;
FIG. 11 is a block diagram of an embodiment of a memory device according to the present application.
Detailed Description
The following describes in detail the embodiments of the present application with reference to the drawings attached hereto.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present application.
The terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship. Further, "plurality" herein means two or more than two.
Referring to fig. 1, fig. 1 is a flowchart illustrating an embodiment of an intra prediction method according to the present application. Specifically, the method may include the steps of:
step S11: and acquiring the brightness prediction parameters of the sub-blocks contained in the block to be coded.
The block to be encoded may include a plurality of sub-blocks, and specifically, the plurality of sub-blocks may be arranged in rows and columns, for example, 4 rows and 4 columns, 8 rows and 8 columns, and the like, and may be specifically set according to the actual application requirement, which is not limited herein. In a specific implementation scenario, the block to be encoded may be equally divided into a plurality of sub-blocks arranged in rows and columns, that is, the size of each sub-block is the same, please refer to fig. 2, fig. 2 is a schematic diagram of an embodiment of dividing the block to be encoded, as shown in the left side of fig. 2, a rectangle indicated by oblique line shading is the block to be encoded, as shown in the right side of fig. 2, the block to be encoded is equally divided into 16 sub-blocks arranged in 4 rows and 4 columns. The dividing manner shown in fig. 2 is only one manner that may be adopted in practical application, and is not limited to the dividing manner adopted in practical application, and specifically, the block to be coded may be divided into a plurality of sub-blocks according to the requirement of practical application, which is not limited herein. In addition, a plurality of sub-blocks contained in the block to be coded can be set to be different sizes according to application requirements. By dividing the block to be coded into a plurality of sub-blocks, the method is beneficial to performing parallel calculation on the prediction of each sub-block subsequently, and is beneficial to fully utilizing the calculation resources and improving the prediction efficiency.
In one implementation scenario, the luminance prediction parameters of the sub-blocks may include an optimal luminance prediction direction of the sub-blocks. In a specific implementation scenario, an angle with the lowest cost (e.g., complexity cost, rate distortion cost, etc.) may be selected from a plurality of preset prediction angles as the best luminance prediction direction. For example, in HEVC intra prediction, 33 angular prediction modes are included, and in VCC intra prediction, 65 angular prediction modes are included, which is not described herein again. In another implementation scenario, the luminance prediction parameter of the sub-block may further include a luminance prediction value of the sub-block, and the luminance prediction value of the sub-block may be obtained by using the optimal luminance prediction direction and the encoded block, which may specifically refer to partial contents related to intra prediction in video coding standards such as h.264/AVC, h.265/HEVC, and h.266/VVC, and thus details are not repeated here.
Step S12: and selecting at least one target coded block corresponding to the sub-block from the plurality of coded blocks by using the brightness prediction parameter of the sub-block.
In the embodiment of the present disclosure, the plurality of encoded blocks are located within a preset range of the block to be encoded, and specifically, the preset range may be a preset number of image blocks which are separated from the block to be encoded, for example, no more than 1 image block, no more than 2 image blocks, and the like.
In a specific implementation scenario, the preset range may specifically be an image block without correlation, that is, the coded block to be selected for use is adjacent to the block to be coded, as shown in fig. 2, the coded block is an unfilled rectangular block, and the coded block may be adjacent to the block to be coded.
In another specific implementation scenario, please refer to fig. 2 in combination, if there are coded blocks in a preset range of the to-be-coded blocks, the left coded block adjacent to each row of sub-blocks may be used as a plurality of coded blocks to be selected for use, the upper coded block adjacent to each column of sub-blocks may be used as a plurality of coded blocks to be selected for use, and the left coded block adjacent to each row of sub-blocks and the upper coded block adjacent to each column of sub-blocks may be used as a plurality of coded blocks to be selected for use.
In another specific implementation scenario, taking the width and height of each block to be encoded as width and height, and the size of each sub-block is 4*4 as an example, when there are coded blocks that can be selectively used above the block to be encoded, one of the coded blocks in the horizontal direction model _ hor = width/4 may be selected as a target coded block, and pixel information of at least one target coded block is processed by using a preset prediction manner, so as to obtain a component transform parameter between a luma prediction parameter and a chroma prediction parameter of the sub-block, that is, when there are coded blocks that can be selectively used above the block to be encoded, the block to be encoded may correspond to model _ updum = model _ hor available component transform parameters; when there are coded blocks that can be used selectively on the left side of the block to be coded, one of the coded blocks model _ vor = height/4 in the vertical direction can be selected as a target coded block, and pixel information of at least one target coded block is processed by using a preset prediction mode to obtain a component conversion parameter between a luminance prediction parameter and a chrominance prediction parameter of a subblock, that is, when there are coded blocks that can be used selectively on the left side of the block to be coded, the block to be coded can correspond to model _ leftnum = model _ vor available component conversion parameters; when there are available selectable used coded blocks on both the left side and the top of the block to be coded, the block to be coded may correspond to model _ total = model _ upper _ model _ left available component transform parameters.
In another specific implementation scenario, the coded block to be selectively used may specifically be an image block coded by using an intra prediction method.
In an implementation scenario, a target coded block may be selected by using an optimal brightness prediction direction in the brightness prediction parameters, for example, when a coded block to be selected for use exists in a horizontal direction, an included angle between the optimal brightness prediction direction and a vertical direction may be obtained, and a coded block passed by a ray passing along the vertical direction with a sub-block as a starting point is used as a reference block, the larger the obtained included angle is, the farther the finally selected target coded block is from the reference block is, otherwise, the smaller the obtained included angle is, the closer the finally selected target coded block is to the reference block; or when a coded block to be selected for use exists in the vertical direction, an included angle between the optimal brightness prediction direction and the horizontal direction can be acquired, and the coded block through which a ray passing along the horizontal direction with the sub-block as a starting point passes is taken as a reference block, the larger the acquired included angle is, the farther the finally selected target coded block is from the reference block is, otherwise, the smaller the acquired included angle is, the closer the finally selected target coded block is to the reference block is; or, when the coded block to be selectively used exists in both the vertical direction and the horizontal direction, an angle between the optimal brightness prediction direction and the vertical direction and an angle between the optimal brightness prediction direction and the horizontal direction may be obtained, and the target coded block in the horizontal direction and the target coded block in the vertical direction may be obtained in the above manner, which may be specifically set according to an actual application situation, and details are not described here.
Step S13: and processing the pixel information of at least one target coded block by using a preset prediction mode to obtain a component conversion parameter between a brightness prediction parameter and a chroma prediction parameter of the subblock.
In one implementation scenario, the pixel information of the target encoded block includes luminance values and chrominance values of pixels in the target encoded block. The component conversion parameters include a slope parameter and an intercept parameter which form a linear function, that is, the luminance prediction parameter and the chrominance prediction parameter can be converted by using the linear function, that is, the component conversion parameter can convert the luminance prediction value in the luminance prediction parameter into the chrominance prediction value in the chrominance prediction parameter, for convenience of description, the slope parameter of the linear function is represented as a, the intercept parameter is represented as b, the luminance prediction value is represented as X, and the chrominance prediction value is represented as Y, and then the chrominance prediction value Y can be converted from the luminance prediction value X by using the following formula:
Y=aX+b……(1)
in a specific implementation scenario, the preset prediction mode may beIncluding but not limited to: the cross-component prediction technology of the least square method and the maximum and minimum simplified version cross-component prediction technology. Taking a simplified cross-component prediction technique with a preset prediction mode as the maximum or minimum as an example, the maximum value of luminance in the target coded block may be obtained, and for convenience of description, it may be marked as X max And obtaining the minimum value of luminance in the target coded block, which can be denoted as X for convenience of description min And acquiring a chroma value corresponding to the maximum brightness value, which can be recorded as Y for convenience of description max And acquiring a chroma value corresponding to the minimum brightness value, which may be denoted as Y for convenience of description min Then, the component transformation parameters obtained by the maximum and minimum simplified version cross-component prediction technique can be expressed as:
Figure BDA0002537697420000061
b=Y min -a*X min ……(3)
in particular, when the brightness minimum value X min And a corresponding colorimetric value Y min When they are equal, the slope parameter a and the intercept parameter b may be set to 0 and Y, respectively, among the component transformation parameters min . When there is more than one target coded block, as described above, when there is a coded block to be selected for use in both the vertical direction and the horizontal direction, the target coded block in the horizontal direction and the target coded block in the vertical direction may be acquired, and the maximum value X of luminance among the target coded blocks may be selected max And a minimum value X of luminance min And respectively obtaining the maximum value X of the brightness max And a minimum value X of luminance min Corresponding colorimetric value Y max 、Y min Thereby obtaining component conversion parameters using the above equations (2) and (3). In addition, the cross-component prediction technique of the least square method can specifically refer to relevant contents in the h.266/VVC video coding technique, and is not described herein again. In practical application, a preset prediction mode can be selected according to practical situations, for example, a maximum and minimum simplified version cross-component prediction technology can be selected for reducing the calculation amount; or, for example, may be for increased precisionIn consideration of the above, a cross-component prediction technique of the least square method may be selected, which is not limited herein.
In another specific implementation scenario, in an actual application, there may be a case that no coded block exists within a preset range of the block to be coded, that is, at this time, model _ uptnum =0 available component transform parameters are corresponding to the top of the block to be coded, and model _ leftnum =0 available component transform parameters are corresponding to the left side of the block to be coded, at this time, the component transform parameter between the luma prediction parameter and the chroma prediction parameter of the subblock may be directly set to a preset value. Specifically, the slope parameter a may be set to a preset value (e.g., 0), and the intercept parameter b may be set to a power of another preset value of 2, where the preset value is determined by the number of coded bits of the block to be coded. For example, when the number of coded bits of the block to be coded is 8 bits, the preset value is set to 8-1=7, and the intercept parameter b is the 7 th power of 2 at this time, that is, the intercept parameter b may be set to 128; or, for example, when the number of coding bits of the block to be coded is 10, the preset value is set to 10-1=9, and then the intercept parameter b is 9 powers of 2 at this time, that is, the intercept parameter b may be set to 512, and so on in other cases, which is not illustrated here.
According to the scheme, the luminance prediction parameters of the sub-blocks contained in the blocks to be coded are obtained, the at least one target coded block corresponding to the sub-blocks is selected from the plurality of coded blocks, the plurality of coded blocks are located in the preset range of the blocks to be coded, the pixel information of the at least one target coded block is processed in a preset prediction mode, the component conversion parameters between the luminance prediction parameters and the chrominance prediction parameters of the sub-blocks are obtained, the luminance prediction parameters can be used for guiding the prediction of the chrominance prediction parameters, the accuracy of chrominance prediction is improved, and the accuracy of intra-frame prediction can be improved. In addition, the luminance prediction parameter is used for guiding the prediction of the chrominance prediction parameter, and the component conversion parameter is used for converting the luminance prediction parameter into the chrominance prediction parameter, so that the linear redundancy between the luminance component and the chrominance component can be reduced, and the performance of video coding is improved; the brightness prediction parameters and the corresponding component conversion parameters of the sub-blocks contained in the block to be coded are obtained, and the whole prediction task of the block to be coded can be decomposed into the prediction tasks of the sub-blocks, so that the block to be coded can be coded by using the component conversion parameters, the situation of low coding quality possibly caused by coding by using a single component conversion parameter can be favorably reduced, and the video coding performance can be improved.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating an embodiment of step S12 in fig. 1. Specifically, fig. 3 is a flowchart illustrating a process of selecting a target coded block from a plurality of coded blocks by using an optimal luma prediction mode when a luma prediction parameter includes an optimal luma prediction direction of a sub-block. The method specifically comprises the following steps:
step S121: a first deviation parameter of the optimal brightness prediction direction relative to a preset reference direction is obtained.
In an implementation scenario, the preset reference direction may be determined according to a distribution of the coded blocks that can be selectively used within a preset range of the to-be-coded blocks. In a specific implementation scenario, if a coded block exists on the left side adjacent to a block to be coded, determining that a preset reference direction includes a horizontal direction; in another specific implementation scenario, if a coded block exists above a block to be coded, determining that a preset reference direction includes a vertical direction; in another specific implementation scenario, if there is an encoded block on the left side adjacent to the block to be encoded and an encoded block on the top side adjacent to the block to be encoded, it is determined that the preset reference direction includes a horizontal direction and a vertical direction. Referring to fig. 2, as shown in fig. 2, if there are coded blocks on both the left side and the upper side of the block to be coded, the predetermined reference direction may be determined to include the horizontal direction and the vertical direction, and the other cases may be determined by referring to the above determination method, which is not illustrated here.
In one implementation scenario, the first deviation parameter may include a deviation angle and a first deviation direction, specifically, the deviation angle represents a degree of deviation of the optimal luminance prediction direction from the preset reference direction, and the first deviation direction may include: the optimal brightness prediction direction is deviated counterclockwise or clockwise with respect to a preset reference direction. Taking AVS3 (Standard for digital Audio and Video coding) as an example, the intra-frame prediction luminance component includes 66 prediction directions, please refer to fig. 4, fig. 5 and fig. 6 in combination, fig. 4 is a schematic diagram of one embodiment of the prediction directions, fig. 5 is a schematic diagram of another embodiment of the prediction directions, and fig. 6 is a schematic diagram of another embodiment of the prediction directions. Specifically, fig. 4 shows the available luminance component prediction directions, i.e., the prediction directions included in the broken-line sector region in fig. 4, when there are coded blocks on both the adjacent left side and the adjacent upper side of the block to be coded in the AVS3 standard, fig. 5 shows the available luminance component prediction directions, i.e., the prediction directions included in the broken-line sector region in fig. 5, when there are coded blocks only on the adjacent left side of the block to be coded in the AVS3 standard, and fig. 6 shows the available luminance component prediction directions, i.e., the prediction directions included in the broken-line sector region in fig. 6, when there are coded blocks only on the adjacent upper side of the block to be coded in the AVS3 standard. As shown in any one of fig. 4 to 6, for convenience of description, the prediction directions are denoted by reference numerals, for example, the prediction direction in the horizontal direction is denoted by reference numeral 24, the prediction direction in the vertical direction is denoted by reference numeral 12, and other prediction directions may refer to any one of fig. 4 to 6, which is not illustrated herein.
With reference to fig. 4 to 5, taking the predetermined reference direction as the horizontal direction, i.e. the prediction direction indicated by numeral 24 in fig. 4 or fig. 5 as an example, when the optimal brightness prediction direction is in the first frame of the two-dimensional coordinate system, i.e. the optimal brightness prediction direction is the prediction directions indicated by numerals 25 to 32 and 58 to 65 in fig. 4 or fig. 5, the optimal brightness prediction direction deviates from the predetermined reference direction counterclockwise, and when the optimal brightness prediction direction is in the third or fourth frame of the two-dimensional coordinate system, i.e. the optimal brightness prediction direction is the prediction directions indicated by numerals 3 to 23 and 34 to 57 in fig. 4 or fig. 5, the optimal brightness prediction direction deviates from the predetermined reference direction clockwise.
With reference to fig. 4 or fig. 6, taking the predetermined reference direction as the vertical direction as an example, that is, the prediction direction with reference numeral 12 in any one of fig. 4 or fig. 6, when the optimal luminance prediction direction is in the third frame of the two-dimensional coordinate system, that is, the optimal luminance prediction direction is the prediction directions with reference numerals 3 to 11 and 34 to 43 in any one of fig. 4 or fig. 6, the optimal luminance prediction direction deviates clockwise from the predetermined reference direction, and when the optimal luminance prediction direction is in the first or fourth frame of the two-dimensional coordinate system, that is, the optimal luminance prediction direction is the prediction directions with reference numerals 13 to 32 and 44 to 65 in any one of fig. 4 or fig. 6, the optimal luminance prediction direction deviates counterclockwise from the predetermined reference direction.
Step S122: based on the first deviation parameter, a second deviation parameter for selecting the target encoded block is determined.
In an implementation scenario, the second deviation parameter may include a deviation number and a second deviation direction, where the deviation number indicates a number of image blocks of the target encoded block deviating from the preset reference block, and the preset reference block may be set according to the currently predicted subblock, for example, the encoded block passed by a ray along the preset reference direction with the subblock as a starting point may be used as the preset reference block. Referring to fig. 2, taking the sub-block where the black dot is located as the current sub-block to be predicted as an example, when there is a coded block on the left side adjacent to the block to be predicted, it may be determined that the predetermined reference direction includes the horizontal direction, and the coded block through which the ray passing along the horizontal direction with the sub-block as the starting point (i.e., the coded block pointed by the dashed-line straight arrow with the black dot as the starting point in fig. 2) is taken as the predetermined reference block. With reference to fig. 2, still taking the sub-block where the black dot is located as the current sub-block to be predicted as an example, when there is a coded block above the block to be predicted, it may be determined that the preset reference direction includes the vertical direction, and the coded block through which the ray passing along the vertical direction with the sub-block as the starting point (i.e., the coded block pointed by the solid line straight arrow with the black dot as the starting point in fig. 2) is taken as the preset reference block, and the rest may be analogized, which is not illustrated herein.
In a specific implementation scenario, the number of deviations may be determined based on the deviation angle, specifically, the number of deviations and the deviation angle are in positive correlation, that is, the larger the deviation angle is, the more the number of deviations is, and conversely, the smaller the deviation angle is, the less the number of deviations is. Specifically, the number of deviations may be within a preset value range, and the preset value range may be set according to the actual application requirement, for example, may be set to-9 to 9, -8 to 8, -7 to 7, and the like, and is not limited herein. Referring to fig. 4 or 5 in combination, when the preset reference direction is the horizontal direction, the optimal brightness prediction direction is the prediction direction with the number of 24, the corresponding deviation number may be set to 0, or, when the optimal brightness prediction direction is the prediction direction with the number of 23, 56, or 57, the corresponding deviation number may be set to 1, or, when the optimal brightness prediction direction is the prediction direction with the number of 58, 59, or 25, the corresponding deviation number may be set to 1, or, when the optimal brightness prediction direction is the prediction direction with the number of 32, the corresponding deviation number may be set to 6, or, when the optimal brightness prediction direction is the prediction direction with the number of 16 or 49, the corresponding deviation number may be set to 6, and so on, which is not exemplified herein. With continuing reference to fig. 4 or fig. 6, when the predetermined reference direction is the vertical direction, and the optimal brightness prediction direction is the prediction direction with the number 12, the corresponding deviation number may be set to 0, or, when the optimal brightness prediction direction is the prediction direction with the number 11, 42, or 43, the corresponding deviation number may be set to 1, or, when the optimal brightness prediction direction is the prediction direction with the number 44, 45, or 13, the corresponding deviation number may be set to 1, or, when the optimal brightness prediction direction is the prediction direction with the number 3, the corresponding deviation number may be set to 7, or, when the optimal brightness prediction direction is the prediction direction with the number 21 or 54, the corresponding deviation number may be set to 7, and so on, which are not illustrated herein. In addition, when the deviation angle is greater than or equal to the first preset value, the corresponding deviation number may be set to a second preset value, the second preset value may be set to 0, or may also be set to another value according to an actual application requirement, which is not limited herein, and the first preset value may be set to 90 degrees, or may also be set to another value according to an actual application requirement, which is not limited herein. Referring to fig. 4 or 5, when the predetermined reference direction is the horizontal direction, the deviation number corresponding to the optimal brightness prediction direction in the third quadrant may be set to 0; alternatively, referring to fig. 4 or fig. 6, when the predetermined reference direction is the vertical direction, the number of deviations corresponding to the optimal luminance predicting direction in the first quadrant may be set to 0.
In another specific implementation scenario, the second deviation direction may specifically include: if the reference block is preset to be vertically upward or vertically downward or horizontally leftward or horizontally rightward, the second deviation direction may be determined based on the first deviation direction. Specifically, when the preset reference direction includes a horizontal direction and the optimal luminance predicting direction is deviated counterclockwise from the horizontal direction, the second deviation direction is vertically downward. With continuing reference to fig. 2, and fig. 4 or fig. 5, when the optimal luma prediction direction is within a first threshold of the two-dimensional coordinate system, i.e. when the optimal luma prediction direction is any one of the numbers 25-32 and 58-65, the target coding block is vertically deviated downwards from the predetermined reference block indicated by the dashed-line straight-line arrow in fig. 2; alternatively, when the preset reference direction includes a horizontal direction and the optimal brightness prediction direction is deviated clockwise from the horizontal direction, the second deviation direction is vertically upward. With continuing reference to fig. 2, and fig. 4 or fig. 5, when the optimal luma prediction direction is in the third quadrant or the fourth quadrant of the two-dimensional coordinate system, i.e., when the optimal luma prediction direction is any one of the numbers 3-23 and 34-57, the target coded block is vertically deviated upward from the predetermined reference block indicated by the dashed-line straight-line arrow in fig. 2; alternatively, when the preset reference direction includes a vertical direction and the optimal luminance predicting direction is deviated counterclockwise from the vertical direction, the second deviation direction is horizontally leftward. With continuing reference to fig. 2, and fig. 4 or fig. 6, when the optimal luma prediction direction is in the first or fourth boundaries of the two-dimensional coordinate system, i.e. when the optimal luma prediction direction is any one of the numbers 13-32 and 44-65, the target coded block is horizontally deviated to the left from the predetermined reference block indicated by the solid line arrow in fig. 2; alternatively, when the preset reference direction is a vertical direction and is deviated clockwise from the vertical direction, the second deviation direction is horizontally rightward. With continuing reference to fig. 2, and fig. 4 or fig. 6, when the optimal luma prediction direction is within the third field of the two-dimensional coordinate system, i.e., when the optimal luma prediction direction is any one of the numbers 3-11 and 34-43, the target coded block is horizontally shifted to the right with respect to the predetermined reference block indicated by the solid line arrow in fig. 2.
In an implementation scenario, for convenience of description, the optimal luma prediction direction ipm is denoted by a numeral symbol, and the second deviation parameter is denoted by a model _ leftdelta or a model _ updelta, specifically, when the preset reference direction includes a horizontal direction (i.e., there are selectable used coded blocks on the left side of an adjacent block to be coded), the second deviation parameter includes a model _ leftdelta, when the preset reference direction includes a vertical direction (i.e., there are selectable used coded blocks above and adjacent to the block to be coded), the second deviation parameter includes a model _ updelta, and an absolute value of the model _ leftdelta or the model _ updelta represents a deviation number, when the preset reference direction is a negative number, the model _ leftdelta represents a vertical upward deviation, when the preset reference direction is a positive number, the model _ updelta represents a vertical downward deviation, and when the model _ updelta is a negative number, the model _ left deviation represents a horizontal rightward deviation.
In a specific implementation scenario, still taking AVS3 as an example, please refer to fig. 4, when there are coded blocks on both the left side and the top side of the block to be coded, the predetermined reference direction includes the horizontal direction and the vertical direction, so the second deviation parameter includes model _ leftdelta and model _ uptdelta, and for model _ leftdelta, the following setting may be performed: if ipm =24, model _ leftdelta =0; if ipm =23 or 56 or 57, model _ leftdelta = -1; if ipm =58 or 59 or 25, model _ leftdelta =1; if ipm =54 or 22 or 55, model _ leftdelta = -2; if ipm =60 or 26 or 61, model _ leftdelta =2; if ipm =20 or 53 or 21, model _ leftdelta = -3; if ipm =27 or 62 or 28, model _ leftdelta =3; if ipm =51 or 19 or 52, then model _ leftdelta = -4; if ipm =63 or 29 or 64, model _ leftdelta =4; if ipm =17 or 50 or 18, model _ leftdelta = -5; if ipm =30 or 65 or 31, model _ leftdelta =5; if ipm =16 or 49, model _ leftdelta = -6; if ipm =32, then model _ leftdelta =6; if ipm =47 or 15 or 48, model _ leftdelta = -7; if ipm =13 or 46 or 14, model _ leftdelta = -8; if ipm =44 or 45, model _ leftdelta = -9; except for the above, model _ leftdelta =0. And for model _ uptdelta can be set as follows: if ipm =12, then model _ updelta =0; if ipm =11 or 42 or 43, then model _ updelta =1; if ipm =44 or 45 or 13, model _ updelta = -1; if ipm =40 or 10 or 41, model _ updelta =2; if ipm =46 or 14 or 47, model _ updelta = -2; if ipm =8 or 39 or 9, model _ updelta =3; if ipm =15 or 48 or 16, model _ updelta = -3; if ipm =37 or 7 or 38, model _ updelta =4; if ipm =49 or 17 or 50, model _ updelta = -4; if ipm =5 or 36 or 6, then model _ updelta =5; if ipm =18 or 51 or 19, model _ updelta = -5; if ipm =34 or 4 or 35, model _ updelta =6; if ipm =52 or 20 or 53, model _ updelta = -6; if ipm =3, model _ updelta =7; if ipm =21 or 54, model _ updelta = -7; if ipm =22 or 55 or 23, model _ updelta = -8; if ipm =56 or 57, then model _ updelta = -9; except for the above, model _ updelta =0;
in another specific implementation scenario, still taking AVS3 as an example, please refer to fig. 5 in combination, when there are coded blocks on the left side of the adjacent block to be coded, the preset reference direction includes a horizontal direction, so that the second deviation parameter includes model _ leftdelta, which can be set as follows: if ipm =24, model _ leftdelta =0; if ipm =23 or 56 or 57, model _ leftdelta = -1; if ipm =58 or 59 or 25, model _ leftdelta =1; if ipm =54 or 22 or 55, model _ leftdelta = -2; if ipm =60 or 26 or 61, model _ leftdelta =2; if ipm =20 or 53 or 21, then model _ leftdelta = -3; if ipm =27 or 62 or 28, model _ leftdelta =3; if ipm =51 or 19 or 52, model _ leftdelta = -4; if ipm =63 or 29 or 64, model _ leftdelta =4; if ipm =17 or 50 or 18, model _ leftdelta = -5; if ipm =30 or 65 or 31, model _ leftdelta =5; if ipm =16 or 49, model _ leftdelta = -6; if ipm =32, then model _ leftdelta =6; if ipm =47 or 15 or 48, model _ leftdelta = -7; if ipm =13 or 46 or 14, model _ leftdelta = -8; if ipm =44 or 45, model _ leftdelta = -9; except for the above, model _ leftdelta =0.
In another specific implementation scenario, still taking AVS3 as an example, please refer to fig. 6 in combination, when there are coded blocks above and adjacent to the block to be coded, the predetermined reference direction includes a vertical direction, so that the second deviation parameter includes model _ uptdelta, which can be set as follows: if ipm =12, model _ updelta =0; if ipm =11 or 42 or 43, then model _ updelta =1; if ipm =44 or 45 or 13, model _ updelta = -1; if ipm =40 or 10 or 41, model _ updelta =2; if ipm =46 or 14 or 47, model _ updelta = -2; if ipm =8 or 39 or 9, model _ updelta =3; if ipm =15 or 48 or 16, model _ updelta = -3; if ipm =37 or 7 or 38, model _ updelta =4; if ipm =49 or 17 or 50, model _ updelta = -4; if ipm =5 or 36 or 6, model _ updelta =5; if ipm =18 or 51 or 19, model _ updelta = -5; if ipm =34 or 4 or 35, then model _ updelta =6; if ipm =52 or 20 or 53, model _ updelta = -6; if ipm =3, model _ updelta =7; if ipm =21 or 54, model _ updelta = -7; if ipm =22 or 55 or 23, model _ updelta = -8; if ipm =56 or 57, then model _ updelta = -9; except for the above, model _ updelta =0.
Step S123: and performing offset processing according to a second deviation parameter by taking the preset reference block as a starting point, and selecting a target coded block from the plurality of coded blocks based on the offset.
Specifically, the encoded block that is offset from the preset reference block by the number of offsets in the second offset direction may be used as the target encoded block corresponding to the sub-block. Referring to fig. 2, when the current subblock to be predicted is a subblock where the black dot is located, and when there are coded blocks on both the left side and the upper side of the block to be coded, the preset reference direction includes the horizontal direction and the vertical direction, so the second deviation parameter includes model _ leftdelta and model _ uptdelta, and if model _ leftdelta =1 and model _ uptdelta = -1, the target coded block 01 and the target coded block 02 in fig. 2 may be selected as the target coded block corresponding to the subblock; or, when there is a coded block only on the left side adjacent to the block to be coded, the preset reference direction includes a horizontal direction, so that the second deviation parameter includes model _ leftdelta, and if model _ leftdelta =1, the target coded block 01 in fig. 2 may be selected as the target coded block corresponding to the sub-block; or, when there are coded blocks only above the adjacent to-be-coded blocks, the preset reference direction includes the vertical direction, so the second deviation parameter includes model _ uptdelta, if model _ uptdelta = -1, the target coded block 02 in fig. 2 may be selected as the target coded block corresponding to the sub-block, and so on in other cases, which is not illustrated one by one here.
In a specific implementation scenario, there may be a case where the image blocks deviating by the number of deviations from the preset reference block in the second deviation direction are not already encoded blocks, in which case, among the image blocks deviating by the number of deviations from the preset reference block in the second deviation direction, the encoded block farthest from the preset reference block may be selected as the target encoded block corresponding to the sub-block. For example, please refer to fig. 2 in combination, the current sub-block to be predicted is the sub-block where the black dot is located, when there are coded blocks on the left side of the adjacent block to be coded and the second deviation parameter model _ left delta = -4, the block deviated vertically upward by 4 blocks is not a selectable coded block, and then the coded block farthest from the preset reference block, i.e., the target coded block 03 shown in fig. 2, may be selected as the target coded block corresponding to the sub-block from among the blocks deviated vertically upward by 4 or less from the preset reference block; or when there are encoded blocks above the adjacent to the block to be encoded and the second deviation parameter model _ uptelta = -4, deviating 4 image blocks horizontally to the left is not a selectable encoded block, so that, among image blocks deviating within 4 from the preset reference block horizontally to the left, the encoded block farthest from the preset reference block, that is, the target encoded block 04 shown in fig. 2, may be selected as the target encoded block corresponding to the sub-block, and so on in other cases, which is not illustrated here.
Different from the foregoing embodiment, the luminance prediction parameter is set to include an optimal luminance prediction direction, a second deviation parameter for selecting a target coded block is determined based on the first deviation parameter by obtaining a first deviation parameter of the optimal luminance prediction direction relative to a preset reference direction, and the deviation processing is performed according to the second deviation parameter with the preset reference block as a starting point, so that the target coded block is selected from the plurality of coded blocks based on the deviation processing, which can be beneficial to determining a subsequent component transformation parameter by using the optimal luminance prediction direction, so that the component transformation parameters corresponding to each sub-block can be more accurate, which is beneficial to reducing linear redundancy between luminance and chrominance, and improving prediction accuracy.
Referring to fig. 7, fig. 7 is a flowchart illustrating a video encoding method according to an embodiment of the present application. The method specifically comprises the following steps:
step S71: the method comprises the steps of obtaining a brightness prediction parameter of a sub-block contained in a block to be coded, and obtaining a component conversion parameter between the brightness prediction parameter and a chroma prediction parameter of the sub-block.
In the embodiment of the present disclosure, the component conversion parameter between the luminance prediction parameter and the chrominance prediction parameter of the sub-block may be obtained by referring to the steps in any of the embodiments of the intra prediction method, and is not described herein again. In addition, the manner of obtaining the luminance prediction parameters of the sub-blocks may refer to the related description in the foregoing embodiments, and is not repeated herein.
Step S72: and coding the sub-blocks contained in the block to be coded based on the brightness prediction parameter and the component conversion parameter of the sub-blocks contained in the block to be coded.
The luminance prediction parameter may specifically include a luminance prediction value, the chrominance prediction parameter may specifically include a chrominance prediction value, and the component conversion parameter is used to convert the luminance prediction value into the chrominance prediction value, and specifically, the component conversion parameter includes a slope parameter and an intercept parameter which form a linear function.
In a specific implementation scenario, the luminance prediction value may be converted by using the component conversion parameter to obtain a chrominance prediction value, and the sub-block is encoded by using the luminance prediction value and the chrominance prediction value, so that the luminance prediction value and the chrominance prediction value of the sub-block may be obtained by decoding when decoding, and an image may be displayed by using the luminance prediction value and the chrominance prediction value.
In another specific implementation scenario, the sub-blocks may be further encoded by using a luminance predicted value and a component conversion parameter, so that during decoding, component conversion may be performed on the luminance predicted value and the component conversion parameter obtained by decoding to obtain a chrominance predicted value, and then an image may be displayed by using the luminance predicted value and the chrominance predicted value.
According to the scheme, the luminance prediction parameters of the sub-blocks contained in the block to be coded are obtained, the component conversion parameters between the luminance prediction parameters and the chrominance prediction parameters of the sub-blocks are obtained through the steps in any intra-frame prediction method embodiment, and therefore the sub-blocks contained in the block to be coded are coded based on the luminance prediction parameters and the component conversion parameters of the sub-blocks contained in the block to be coded, the accuracy of intra-frame prediction can be improved, linear redundancy between the luminance components and the chrominance components can be reduced, the performance of video coding is improved, the situation that the coding quality is low due to the fact that the coding is carried out through single component conversion parameters can be reduced, and the performance of video coding can be improved.
Referring to fig. 8, fig. 8 is a block diagram illustrating an embodiment of an intra prediction apparatus 80 according to the present application. The intra prediction apparatus 80 includes: the device comprises a brightness parameter obtaining module 81, a target selecting module 82 and a conversion parameter obtaining module 83, wherein the brightness parameter obtaining module 81 is used for obtaining brightness prediction parameters of sub-blocks contained in a block to be coded; the target selection module 82 is configured to select at least one target coded block corresponding to a sub-block from the plurality of coded blocks by using the luminance prediction parameter of the sub-block; the plurality of coded blocks are positioned in a preset range of the blocks to be coded; the conversion parameter obtaining module 83 is configured to process the pixel information of at least one target coded block in a preset prediction manner to obtain a component conversion parameter between a luminance prediction parameter and a chrominance prediction parameter of a sub-block.
According to the scheme, the luminance prediction parameters of the sub blocks contained in the blocks to be coded are obtained, the at least one target coded block corresponding to the sub blocks is selected from the plurality of coded blocks, the plurality of coded blocks are located in the preset range of the blocks to be coded, the pixel information of the at least one target coded block is processed in the preset prediction mode, the component conversion parameters between the luminance prediction parameters and the chrominance prediction parameters of the sub blocks are obtained, the luminance prediction parameters can be used for guiding the prediction of the chrominance prediction parameters, the accuracy of chrominance prediction is improved, and the accuracy of intra-frame prediction can be improved. In addition, the luminance prediction parameters are used for guiding the prediction of the chrominance prediction parameters, and the component conversion parameters are used for converting the luminance prediction parameters into the chrominance prediction parameters, so that the linear redundancy between the luminance components and the chrominance components can be reduced, and the performance of video coding is improved; the brightness prediction parameters and the corresponding component conversion parameters of the sub-blocks contained in the block to be coded are obtained, and the whole prediction task of the block to be coded can be decomposed into the prediction tasks of the sub-blocks, so that the block to be coded can be coded by using the component conversion parameters, the situation of low coding quality possibly caused by coding by using a single component conversion parameter can be favorably reduced, and the video coding performance can be improved.
In some embodiments, the luma prediction parameters include an optimal luma prediction direction of the sub-block, the target selection module 82 includes a first deviation parameter obtaining sub-module configured to obtain a first deviation parameter of the optimal luma prediction direction with respect to a preset reference direction, the target selection module 82 includes a second deviation parameter obtaining sub-module configured to determine a second deviation parameter for selecting a target coded block based on the first deviation parameter, and the target selection module 82 includes a deviation processing sub-module configured to perform a deviation process according to the second deviation parameter starting from the preset reference block, and select the target coded block from among a plurality of coded blocks based on the deviation, wherein the preset reference block is the coded block through which a ray along the preset reference direction starting from the sub-block passes.
Different from the foregoing embodiment, the luminance prediction parameter is set to include an optimal luminance prediction direction, a second deviation parameter for selecting a target coded block is determined based on the first deviation parameter by obtaining a first deviation parameter of the optimal luminance prediction direction relative to a preset reference direction, and the deviation processing is performed according to the second deviation parameter with the preset reference block as a starting point, so that the target coded block is selected from the plurality of coded blocks based on the deviation processing, which can be beneficial to determining a subsequent component transformation parameter by using the optimal luminance prediction direction, so that the component transformation parameters corresponding to each sub-block can be more accurate, which is beneficial to reducing linear redundancy between luminance and chrominance, and improving prediction accuracy.
In some embodiments, the first deviation parameter includes a deviation angle and a first deviation direction, the second deviation parameter includes a deviation number and a second deviation direction, the second deviation parameter obtaining sub-module is specifically configured to determine the deviation number based on the deviation angle and determine the second deviation direction based on the first deviation direction, and the deviation processing sub-module is specifically configured to take the encoded block deviating from the preset reference block by the deviation number along the second deviation direction as the target encoded block corresponding to the sub-block, where the deviation number indicates the number of image blocks of the target encoded block deviating from the preset reference block; the first deviation direction includes: the optimal brightness prediction direction deviates counterclockwise or clockwise from a preset reference direction; the second deviation direction includes: the preset reference block is vertically upward or vertically downward or horizontally leftward or horizontally rightward.
In distinction to the foregoing embodiment, the first deviation parameter is set to include a deviation angle and a first deviation direction, the second deviation parameter is set to include a deviation number and a second deviation direction, so that the deviation number is determined based on the deviation angle, and the second deviation direction is determined based on the first deviation direction, so that the encoded block that is deviated from the preset reference block by the deviation number in the second deviation direction is taken as the target encoded block corresponding to the sub-block, and the deviation number is set to indicate the number of image blocks of the target encoded block that are deviated from the preset reference block, the first deviation direction is set to include: the optimal brightness prediction direction is deviated counterclockwise or clockwise with respect to a preset reference direction, and the second deviation direction is set to include: the preset reference block is vertically upward or vertically downward or horizontally leftward or horizontally rightward, and the offset processing can be accurately performed based on the preset reference block, so that the accuracy of the target coded block can be improved, the accuracy of subsequent component transformation parameter determination can be improved, and the accuracy of intra-frame prediction can be improved.
In some embodiments, the deviation angle and the deviation number are in a positive correlation relationship, and if the deviation angle is greater than or equal to a first preset value, the corresponding deviation number is set to a second preset value.
Different from the foregoing embodiment, the deviation angle is set to be in positive correlation with the deviation number, and if the deviation angle is greater than or equal to the first preset value, the corresponding deviation number is set to be the second preset value, which can be beneficial to selecting the coded block with a proper deviation range as the target coded block, and further can be beneficial to improving the accuracy of prediction.
In some embodiments, when the preset reference direction includes a horizontal direction and the optimal brightness prediction direction is deviated counterclockwise from the horizontal direction, the second deviation direction is vertically downward; when the preset reference direction comprises a horizontal direction and the optimal brightness prediction direction deviates clockwise relative to the horizontal direction, the second deviation direction is vertically upward; when the preset reference direction comprises a vertical direction and the optimal brightness prediction direction deviates anticlockwise relative to the vertical direction, the second deviation direction is horizontal leftward; when the preset reference direction includes a vertical direction and the optimal brightness prediction direction is deviated clockwise with respect to the vertical direction, the second deviation direction is horizontally rightward.
Different from the foregoing embodiment, with the above arrangement, it is possible to facilitate selection of a coded block with a suitable deviation direction as a target coded block, and thus to facilitate improvement of accuracy of prediction.
In some embodiments, the deviation processing sub-module is further configured to select, when the image blocks deviating by the preset reference block from the second deviation direction are not already encoded blocks, an encoded block farthest from the preset reference block from among the image blocks deviating by the preset reference block from the second deviation direction by the number of deviations as the target encoded block corresponding to the sub-block.
Different from the foregoing embodiment, when the image blocks deviating from the preset reference block by the number in the second deviation direction are not encoded blocks, the encoded block farthest from the preset reference block is selected from the image blocks deviating from the preset reference block by the number in the second deviation direction as the target encoded block corresponding to the sub-block, so that improvement of prediction robustness can be facilitated.
In some embodiments, the target selection module 82 further includes a preset reference direction determination submodule, configured to determine that the preset reference direction includes a horizontal direction when a coded block exists on the left side adjacent to the block to be coded, and further configured to determine that the preset reference direction includes a vertical direction when a coded block exists on the top side adjacent to the block to be coded.
Different from the foregoing embodiment, before obtaining the first deviation parameter of the optimal luminance prediction direction relative to the preset reference direction, the preset reference direction is determined by determining whether a coded block exists on the left side adjacent to the block to be coded or above the block to be coded, which is beneficial to improving the accuracy of the preset reference direction and further beneficial to improving the accuracy of prediction.
In some embodiments, the intra prediction apparatus 80 further includes a sub-block dividing module for equally dividing the block to be coded into a plurality of sub-blocks arranged in rows and columns, and the intra prediction apparatus 80 further includes a coded block obtaining module for taking the left-side coded block adjacent to each row of sub-blocks and/or the upper-side coded block adjacent to each column of sub-blocks as the plurality of coded blocks.
Different from the foregoing embodiment, the to-be-coded blocks are equally divided into a plurality of sub-blocks arranged in rows and columns, and the left coded block adjacent to each row of sub-blocks and/or the upper coded block adjacent to each column of sub-blocks are used as the plurality of coded blocks, which can be beneficial to improving the prediction efficiency.
In some embodiments, the intra prediction apparatus 80 further includes a determining module configured to determine whether an encoded block exists within a preset range of the block to be encoded, the target selecting module 82, the conversion parameter obtaining module 83 and the related modules are further configured to, if the determination result of the determining module is yes, perform the step of selecting at least one target encoded block corresponding to the sub block from the plurality of encoded blocks by using the luma prediction parameter of the sub block and the subsequent steps, and the intra prediction apparatus 80 further includes a value setting module configured to, if the determination result of the determining module is no, set a component conversion parameter between the luma prediction parameter and the chroma prediction parameter of the sub block to a preset value.
Different from the foregoing embodiment, by determining whether an encoded block exists within a preset range of a block to be encoded, and if the determination result is yes, performing the step of selecting at least one target encoded block corresponding to the sub-block from the plurality of encoded blocks by using the luminance prediction parameter of the sub-block and the subsequent steps, and if the determination result is no, setting the component conversion parameter between the luminance prediction parameter and the chrominance prediction parameter of the sub-block to a preset value, it is possible to obtain the component conversion parameter both when an encoded block exists and when an encoded block does not exist within the preset range of the block to be encoded, thereby being beneficial to improving the robustness of prediction.
In some embodiments, the component conversion parameter includes a slope parameter and an intercept parameter that constitute a linear function, and the value setting module is specifically configured to set the slope parameter to a third preset value and the intercept parameter to a fourth preset value power of 2; the fourth preset value is determined by using the length of the coded bit of the block to be coded.
Different from the foregoing embodiment, when there is no coded block in the preset range of the block to be coded, the slope parameter is set to be a third preset value, the intercept parameter is set to be a power of a fourth preset value of 2, and the fourth preset value is determined by using the coded bit length of the block to be coded, so that the component conversion parameter of the subblock can be directly obtained through simple calculation, which is beneficial to improving the prediction efficiency.
In some embodiments, the coding block is coded in an intra-frame prediction mode; and/or the preset range is that the distance between the preset range and the block to be coded is not more than the preset number of image blocks; and/or the luminance prediction parameter comprises a luminance prediction value of the sub-block, the chrominance prediction parameter comprises a chrominance prediction value of the sub-block, and the component conversion parameter is used for converting the luminance prediction value into the chrominance prediction value.
Referring to fig. 9, fig. 9 is a block diagram of an embodiment of a video encoding apparatus 90 according to the present application. The video encoding device 90 includes: the parameter obtaining module 91 is configured to obtain a luminance prediction parameter of a sub-block included in a block to be encoded, and obtain a component transformation parameter between the luminance prediction parameter and a chrominance prediction parameter of the sub-block, where the component transformation parameter of the sub-block is obtained by using the intra prediction apparatus in any one of the embodiments of the intra prediction apparatus described above.
According to the scheme, the luminance prediction parameters of the sub-blocks contained in the to-be-coded blocks are obtained, the component conversion parameters between the luminance prediction parameters and the chrominance prediction parameters of the sub-blocks are obtained through the steps in any intra-frame prediction method embodiment, so that the sub-blocks contained in the to-be-coded blocks are coded based on the luminance prediction parameters and the component conversion parameters of the sub-blocks contained in the to-be-coded blocks, the accuracy of intra-frame prediction can be improved, the linear redundancy between the luminance components and the chrominance components can be reduced, the performance of video coding is improved, the condition of low coding quality possibly caused by coding by using a single component conversion parameter can be reduced, and the performance of video coding can be improved.
Referring to fig. 10, fig. 10 is a schematic block diagram of an embodiment of an electronic device 100 according to the present application. The electronic device 100 comprises a memory 101 and a processor 102 coupled to each other, the memory 101 stores program instructions, and the processor 102 is configured to execute the program instructions to implement the steps in any of the embodiments of the intra prediction method described above or to implement the steps in any of the embodiments of the video encoding method described above. Specifically, the electronic devices may include, but are not limited to: the electronic devices such as the server, the microcomputer, the tablet computer, and the mobile phone are not limited herein.
Specifically, the processor 102 is configured to control itself and the memory 101 to implement the steps in any of the above-described embodiments of the anomaly detection method. Processor 102 may also be referred to as a CPU (Central Processing Unit). The processor 102 may be an integrated circuit chip having signal processing capabilities. The Processor 102 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. Additionally, processor 102 may be commonly implemented by multiple integrated circuit chips.
By the scheme, the accuracy of intra-frame prediction and the performance of video coding are improved.
Referring to fig. 11, fig. 11 is a schematic diagram of a memory device 110 according to an embodiment of the present application. The storage means 110 stores program instructions 111 that can be executed by the processor, the program instructions 111 being adapted to implement the steps of any of the embodiments of the intra prediction method described above, or to implement the steps of any of the embodiments of the video encoding method described above.
By the scheme, the accuracy of intra-frame prediction and the performance of video coding are improved.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (13)

1. An intra prediction method, comprising:
acquiring brightness prediction parameters of subblocks included in a block to be coded;
acquiring a first deviation parameter of the optimal brightness prediction direction relative to a preset reference direction; wherein the luminance prediction parameter comprises an optimal luminance prediction direction of the sub-block;
determining a second deviation parameter for selecting a target encoded block based on the first deviation parameter;
taking a preset reference block as a starting point, carrying out offset processing according to the second deviation parameter, and selecting a target coded block from a plurality of coded blocks based on the offset processing; the preset reference block is the coded block which is passed by the ray with the sub-block as a starting point along the preset reference direction, and the coded blocks are positioned in a preset range of the to-be-coded block;
and processing the pixel information of at least one target coded block by using a preset prediction mode to obtain a component conversion parameter between a brightness predicted value and a chroma predicted value of the subblock.
2. The method of claim 1, wherein the first deviation parameter comprises a deviation angle and a first deviation direction, and the second deviation parameter comprises a deviation number and a second deviation direction; the determining a second deviation parameter for selecting a target encoded block based on the first deviation parameter comprises:
determining the number of deviations based on the deviation angle, and determining the second deviation direction based on the first deviation direction;
the performing offset processing according to the second deviation parameter with the preset reference block as a starting point, and selecting the target coded block from the plurality of coded blocks based on the offset processing includes:
taking the coded blocks deviating the preset reference block by the deviating number in the second deviation direction as target coded blocks corresponding to the sub-blocks;
the deviation number represents the number of image blocks of the target coded block deviating from the preset reference block; the first deviation direction includes: the optimal brightness prediction direction deviates counterclockwise or clockwise from the preset reference direction; the second deviation direction includes: the preset reference block is vertically upward or vertically downward or horizontally leftward or horizontally rightward.
3. The method according to claim 2, wherein the deviation angle and the deviation number are positively correlated, and if the deviation angle is greater than or equal to a first preset value, the corresponding deviation number is set to a second preset value.
4. The method according to claim 2, wherein when the preset reference direction comprises a horizontal direction and the optimal brightness prediction direction is deviated counterclockwise from the horizontal direction, the second deviation direction is vertically downward;
when the preset reference direction includes the horizontal direction and the optimal brightness prediction direction is deviated clockwise with respect to the horizontal direction, the second deviation direction is vertically upward;
when the preset reference direction comprises a vertical direction and the optimal brightness prediction direction deviates counterclockwise relative to the vertical direction, the second deviation direction is horizontal to the left;
when the preset reference direction includes the vertical direction and the optimal brightness prediction direction is deviated clockwise with respect to the vertical direction, the second deviation direction is horizontally rightward.
5. The method of claim 2, further comprising:
and if the image blocks deviating from the preset reference block in the second deviation direction by the deviating number are not the coded blocks, selecting the coded block farthest away from the preset reference block from the image blocks deviating from the preset reference block in the second deviation direction by the deviating number as a target coded block corresponding to the sub-block.
6. The method according to claim 1, wherein before obtaining the first deviation parameter of the optimal luminance prediction direction from the preset reference direction, the method further comprises:
if the coded block exists on the left side adjacent to the block to be coded, determining that the preset reference direction comprises a horizontal direction; and the number of the first and second groups,
and if the coded block exists above the position adjacent to the block to be coded, determining that the preset reference direction comprises a vertical direction.
7. The method of claim 1, wherein before obtaining luma prediction parameters of sub-blocks included in a block to be encoded, the method further comprises:
equally dividing the to-be-coded block into a plurality of subblocks arranged in rows and columns;
and taking the coded blocks on the left side adjacent to the sub-block of each row and/or the coded blocks on the upper side adjacent to the sub-block of each column as the coded blocks.
8. The method according to claim 1, wherein before obtaining the first deviation parameter of the optimal luminance prediction direction from the preset reference direction, the method comprises:
judging whether the coded block exists in the preset range of the block to be coded;
if so, executing the step of selecting at least one target coded block corresponding to the subblock from a plurality of coded blocks by using the brightness prediction parameter of the subblock and the subsequent steps;
and if not, setting the component conversion parameter between the brightness predicted value and the chroma predicted value of the sub-block as a preset value.
9. The method of claim 8, wherein the component conversion parameters include a slope parameter and an intercept parameter that make up a linear function; the setting of the component conversion parameter between the luminance predicted value and the chrominance predicted value of the sub-block to a preset value includes:
setting the slope parameter as a third preset value, and setting the intercept parameter as a fourth preset value power of 2; the fourth preset value is determined by using the length of the coded bit of the block to be coded.
10. The method of claim 1, wherein the encoded blocks are encoded using intra prediction;
and/or the preset range is that the distance between the preset range and the to-be-coded block is not more than a preset number of image blocks; the component conversion parameter is used for converting the brightness predicted value into the chroma predicted value.
11. A video encoding method, comprising:
acquiring a brightness prediction parameter of a sub-block contained in a block to be coded, and acquiring a component conversion parameter between a brightness prediction value and a chroma prediction value of the sub-block;
encoding the sub-blocks included in the block to be encoded based on the luma prediction parameter and the component transform parameter of the sub-blocks included in the block to be encoded;
wherein the component conversion parameters of the sub-blocks are obtained by using the intra prediction method of any one of claims 1 to 10.
12. An electronic device comprising a memory and a processor coupled to each other, the memory storing program instructions, the processor being configured to execute the program instructions to implement the intra prediction method of any one of claims 1 to 10 or to implement the video coding method of claim 11.
13. A storage device storing program instructions executable by a processor to implement the intra prediction method of any one of claims 1 to 10 or to implement the video encoding method of claim 11.
CN202010537899.6A 2020-06-12 2020-06-12 Intra-frame prediction method, video coding method, and related equipment and device Active CN111669585B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010537899.6A CN111669585B (en) 2020-06-12 2020-06-12 Intra-frame prediction method, video coding method, and related equipment and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010537899.6A CN111669585B (en) 2020-06-12 2020-06-12 Intra-frame prediction method, video coding method, and related equipment and device

Publications (2)

Publication Number Publication Date
CN111669585A CN111669585A (en) 2020-09-15
CN111669585B true CN111669585B (en) 2022-10-28

Family

ID=72387434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010537899.6A Active CN111669585B (en) 2020-06-12 2020-06-12 Intra-frame prediction method, video coding method, and related equipment and device

Country Status (1)

Country Link
CN (1) CN111669585B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110896479A (en) * 2018-09-12 2020-03-20 北京字节跳动网络技术有限公司 One-line cross component linear model prediction mode
WO2020073864A1 (en) * 2018-10-08 2020-04-16 Huawei Technologies Co., Ltd. Intra prediction method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2571311B (en) * 2018-02-23 2021-08-18 Canon Kk Methods and devices for improvement in obtaining linear component sample prediction parameters

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110896479A (en) * 2018-09-12 2020-03-20 北京字节跳动网络技术有限公司 One-line cross component linear model prediction mode
WO2020073864A1 (en) * 2018-10-08 2020-04-16 Huawei Technologies Co., Ltd. Intra prediction method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Enhanced Cross-Component Linear Model for Chroma Intra-Prediction in Video Coding;Kai Zhang等;《IEEE TRANSACTIONS ON IMAGE PROCESSING》;20180831;全文 *
Non-CE3: CCLM table reduction and bit range control;Yukinobu Yasugi;《JVET-M0064》;20190103;全文 *

Also Published As

Publication number Publication date
CN111669585A (en) 2020-09-15

Similar Documents

Publication Publication Date Title
US11245894B2 (en) Method for encoding/decoding video signal, and apparatus therefor
US11683511B2 (en) Method for encoding/decoding video signals and device therefor
CN104471940B (en) Chroma intra prediction method and device
US20220038684A1 (en) Multi-reference line intra prediction and most probable mode
EP1553783A2 (en) Prediction encoding apparatus, prediction encoding method, and computer readable recording medium thereof
US20240098258A1 (en) Method and apparatus for processing image signal
US20150010049A1 (en) Method of depth intra prediction using depth map modelling
US20230164359A1 (en) Encoding/decoding method for video signal and device therefor
US9503751B2 (en) Method and apparatus for simplified depth coding with extended prediction modes
US11985306B2 (en) Method and apparatus for video encoding and decoding with matrix based intra-prediction
US11653019B2 (en) Image coding and decoding methods, image processing device and computer storage medium
US11882310B2 (en) Method and apparatus for processing image signal
US20200374530A1 (en) Method and apparatus for video encoding and decoding based on block shape
KR102532391B1 (en) Video encoding method and apparatus and video decoding method and apparatus
CN105681812A (en) HEVC (high efficiency video coding) intra-frame coding processing method and device
CN111669585B (en) Intra-frame prediction method, video coding method, and related equipment and device
CN109479128B (en) Method and device for video coding and decoding
US10893274B2 (en) Method for processing video signal on basis of arbitrary partition transform
CN110769255B (en) Image coding method and device
US12022079B2 (en) Wide angle intra prediction and position dependent intra prediction combination
CN112347875A (en) Edge cooperative target detection method and device based on region division
US20210144368A1 (en) Device and Method of Selecting an Intra Mode of a Coding Unit
KR20210016355A (en) Method and apparatus for deriving limited linear model parameters in video coding
EP4346202A1 (en) Encoding/decoding video picture data
EP4254949A1 (en) Encoding/decoding video picture partitionned in ctu grids

Legal Events

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