WO2016148620A1 - Encoding and decoding an displacement vector - Google Patents

Encoding and decoding an displacement vector Download PDF

Info

Publication number
WO2016148620A1
WO2016148620A1 PCT/SE2015/050327 SE2015050327W WO2016148620A1 WO 2016148620 A1 WO2016148620 A1 WO 2016148620A1 SE 2015050327 W SE2015050327 W SE 2015050327W WO 2016148620 A1 WO2016148620 A1 WO 2016148620A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
samples
label value
evaluation
displacement vector
Prior art date
Application number
PCT/SE2015/050327
Other languages
French (fr)
Inventor
Kenneth Andersson
Thomas Rusert
Julien Michot
Per Hermansson
Original Assignee
Telefonaktiebolaget Lm Ericsson (Publ)
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 Telefonaktiebolaget Lm Ericsson (Publ) filed Critical Telefonaktiebolaget Lm Ericsson (Publ)
Priority to PCT/SE2015/050327 priority Critical patent/WO2016148620A1/en
Publication of WO2016148620A1 publication Critical patent/WO2016148620A1/en

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/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/463Embedding additional information in the video signal during the compression process by compressing encoding parameters before transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/533Motion estimation using multistep search, e.g. 2D-log search or one-at-a-time search [OTS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/557Motion estimation characterised by stopping computation or iteration based on certain criteria, e.g. error magnitude being too large or early exit
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/56Motion estimation with initialisation of the vector search, e.g. estimating a good candidate to initiate a search
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the invention relates to methods, encoders, decoders, computer programs and computer program products for encoding and decoding an input displacement vector forming part of an encoded video frame.
  • samples which resemble the samples which are to be encoded.
  • MPEG Motion Pictures Expert Group
  • H.264 and H.265/HEVC High Efficiency Video Coding
  • Samples can for instance be pixels.
  • a displacement vector is then used to refer to the resembling picture area. This makes the encoding of the referring picture area more efficient, since only the differences to the referenced picture area need to be encoded.
  • the displacement vector can be used within a video frame (intra frame) also referred to intra block copy in screen content extension of HEVC or referring to another video frame (inter frame) also referred to motion compensated prediction. While displacement vectors contribute to more efficient encoding, displacement vectors can be quite common; it is possible with several displacement vectors in each video frame, whereby the displacement vectors themselves take up significant data in an encoded bitstream. In state of the art video coding such as H.264 and HEVC, a prediction of the displacement vector is used to reduce the overhead for coding the
  • a difference displacement vector is coded and provided in the bitstream.
  • a difference displacement vector is coded and provided in the bitstream.
  • the coding of respective component of the difference displacement vector is done separately but identical. We describe here how it's done for the horizontal component. A flag indicates if the horizontal component is larger than zero. If its non-zero another flag indicates if its magnitude is larger than l. If it is larger than one, the magnitude of the horizontal difference component minus 2 is coded. A sign for the horizontal difference component is coded if the magnitude is larger than zero.
  • a method for encoding an input displacement vector as part of encoding a first block of samples of a video frame the input displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples.
  • the method is performed in an encoder and comprises the steps of: obtaining a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; selecting a first evaluation direction; obtaining a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; comparing the first label value and the second label value; determining the encoded displacement vector based on the comparison of the first label value and the second label value; and repeating the steps of obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
  • the method may further comprise the steps of: initialising an encoded displacement component in the first evaluation direction to the input displacement component in the first evaluation direction; decreasing a magnitude of the encoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value differ; setting an encoding indicator for the first evaluation direction when, and only when, the last second label value matches the first label value; wherein the step of repeating comprises also repeating the step of decreasing for the subsequent block of samples in the first evaluation direction until the exit condition is fulfilled.
  • setting the indicator is to be construed as setting the indicator to a true value, e.g. ⁇ or any other predetermined value to indicate a positive value. In contrast, when the indicator is not set, it is a false value e.g. o or not present or any other predetermined value to indicate the negative.
  • the step of initialising may comprise adjusting the encoded displacement component by a prediction displacement component, in the first evaluation direction; and wherein when the first time the step of obtaining a second label value is performed, the evaluation block is displaced from the first block of samples by the prediction displacement vector.
  • a starting position for an evaluation in a second direction is from the position of the first block displaced by the input displacement component in the first evaluation direction.
  • the exit condition maybe that an evaluation block, corresponding to the input displacement component in the evaluation direction, is reached.
  • the first direction may be a horizontal direction and the second direction is a vertical direction, or vice versa.
  • the method may further comprise the steps of: selecting a second evaluation direction; and performing the steps of initialising, obtaining a second label value, decreasing, repeating and setting for the second evaluation direction instead of the first evaluation direction.
  • the video frame of the first block of samples and the video frame of the second block of samples may be the same.
  • the video frame of the first block of samples and the video frame of the second block of samples may differ, and wherein when the first time the step of obtaining a second label value is performed, the evaluation block may be in a position corresponding to the first block of samples.
  • the size of the evaluation block may be determined in a unit which is also used for the input displacement vector.
  • the label values maybe based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters to be provided in the bitstream.
  • the method may further comprise the step of: inserting the encoding indicator for at least one of the first direction and the encoding indicator for the second direction in an encoded bitstream.
  • the method may further comprise the step of: inserting an encoded displacement component for the first and second directions in an encoded bitstream, when and only when an encoding indicator for the respective evaluation direction is set.
  • the method may further comprise the step of: inserting a label value for each block in the video frame of the first block of samples in an encoded bitstream.
  • the encoder comprises: a processor; and a memory storing instructions that, when executed by the processor, causes the encoder to: obtain a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; select a first evaluation direction; obtain a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; compare the first label value and the second label value; determine the encoded displacement vector based on the comparison of the first label value and the second label value; and repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
  • an encoder comprising: means for obtaining a first label value for a first block of samples, the first label value being based on at least one parameter related to the samples of a first block, the first label value being used for encoding an input displacement vector as part of encoding the first block of samples of a video frame, the input displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples; means for selecting a first evaluation direction; means for obtaining a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; means for comparing the first label value and the second label value; means for determining the encoded displacement vector based on the comparison of the first label value and the second label value; and means for repeating the obtaining a second label value, comparing and determining
  • a computer program for encoding an input displacement vector as part of encoding a first block of samples of a video frame, the input displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples.
  • the computer program comprises computer program code which, when run on an encoder causes the encoder to: obtain a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; select a first evaluation direction; obtain a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; compare the first label value and the second label value; determine the encoded displacement vector based on the comparison of the first label value and the second label value; and repeat the obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
  • a computer program product comprising a computer program according to the fourth aspect and a computer readable means on which the computer program is stored.
  • a method for determining a decoded displacement vector from an encoded displacement vector as part of decoding a first block of samples of a video frame the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples.
  • the method is performed in an decoder and comprises the steps of: obtaining a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; selecting a first evaluation direction; obtaining a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; comparing the first label value and the second label value; determining the decoded displacement vector based on the comparison of the first label value and the second label value; and repeating the steps of obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
  • the method may further comprise the steps of: initialising a decoded displacement vector in the first evaluation direction to the encoded displacement vector in the first evaluation direction; increasing a magnitude of the decoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value differ; decreasing a magnitude of the encoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value are equal; wherein the step of repeating comprises also repeating the steps of increasing and decreasing for the subsequent block of samples in the first evaluation direction until the exit condition is fulfilled; and the steps of initialising, obtaining the second label value, increasing, decreasing and repeating are only performed for a particular first evaluation direction when an encoding indicator for the first evaluation direction is set.
  • the exit condition maybe that the magnitude of the encoded displacement component in the first evaluation direction has reached zero. Reaching zero means that the magnitude of the encoded displacement component has been reduced to the point that zero has been reached. This also encompasses if the reduction in magnitude is so great that the sign of the encoded displacement component in the first evaluation direction changes sign (i.e. from positive to negative or vice versa) without actually assuming the value zero.
  • the evaluation block is displaced from the first block of samples by the prediction displacement vector.
  • the first direction may be a horizontal direction and the second direction is a vertical direction, or vice versa.
  • the method may further comprise the steps of: selecting a second evaluation direction; and performing the steps of initialising, obtaining a second label value, comparing, increasing, decreasing, determining, and repeating for the second evaluation direction instead of the first evaluation direction.
  • the video frame of the first block of samples and the video frame of the second block of samples may be the same.
  • the video frame of the first block of samples and the video frame of the second block of samples may differ.
  • the size of the evaluation block may be determined in a unit which is also used for the displacement vector.
  • the label values maybe based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters provided in the bitstream.
  • the method may further comprise the step of: reading the encoding indicator for the first direction and/ or the encoding indicator for the second direction from an encoded bitstream.
  • the method may further comprise the step of: reading label values for at least one block in the video frame of the first block of samples from an encoded bitstream.
  • a decoder for determining a decoded displacement vector from an encoded displacement vector as part of decoding a first block of samples of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples.
  • the decoder comprises: a processor; and a memory storing instructions that, when executed by the processor, causes the decoder to: obtain a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; selecting a first evaluation direction; obtain a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; compare the first label value and the second label value; determine the decoded displacement vector based on the comparison of the first label value and the second label value; and repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
  • a decoder comprising: means for obtaining a first label value for a first block of samples, the first label value being based on at least one parameter related to samples of the first block, for determining a decoded displacement vector from an encoded displacement vector as part of decoding the first block of samples of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples; means for selecting a first evaluation direction; means for obtaining a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; means for comparing the first label value and the second label value; means for determining the decoded displacement vector based on the comparison of the first label value and the second label value; and means for repeating the
  • a ninth aspect it is presented a computer program for determining a decoded displacement vector from an encoded displacement vector as part of decoding a first block of samples of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded
  • the computer program comprises computer program code which, when run on a decoder causes the decoder to: obtain a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; selecting a first evaluation direction; obtain a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; compare the first label value and the second label value; determine the decoded displacement vector based on the comparison of the first label value and the second label value; and repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
  • a computer program product comprising a computer program according to the ninth aspect and a computer readable means on which the computer program is stored.
  • all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein.
  • All references to "a/an/the element, apparatus, component, means, step, etc.” are to be interpreted openly as referring to at least one instance of the element, apparatus, component, means, step, etc., unless explicitly stated otherwise.
  • the steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.
  • Fig l is a schematic diagram illustrating an environment in which
  • Fig 2 is a schematic diagram illustrating an intra-frame displacement vector used by the encoder and decoder of Fig l
  • Fig 3 is a schematic diagram illustrating an inter frame displacement vector used by the encoder and decoder of Fig l;
  • Figs 4A-B are schematic diagrams illustrating how the displacement vector can be encoded and decoded by the encoder and decoder of Fig 1 using labels;
  • Figs 5A-B are flow charts illustrating methods for encoding an input displacement vector, performed by the encoder of Fig 1;
  • Figs 6A-B are flow charts illustrating methods for determining a decoded displacement vector, performed by the decoder of Fig 1;
  • Fig 7 is a schematic diagram illustrating functional modules of the encoder of Fig 1 according to one embodiment
  • Fig 8 is a schematic diagram illustrating functional modules of the decoder of Fig 1 according to one embodiment
  • Fig 9 is a schematic diagram illustrating some components of the encoder of Fig l according to one embodiment
  • Fig 10 is a schematic diagram illustrating some components of the decoder of Fig l according to one embodiment; and Fig 11 shows one example of a computer program product comprising computer readable means.
  • Fig 1 is a schematic diagram illustrating an environment in which
  • An encoder 1 is used to encode input video 3 to a bitstream 4 comprising encoded video.
  • the bitstream 4 is transferred to the decoder e.g. using a network connection or using physical media.
  • the decoder 2 reads and decodes the bitstream 4 to produce output video 5 which corresponds to the input video stream 3.
  • the encoding can be lossy, whereby the output video 5 is not identical to the input video 3.
  • the perceived quality loss depends on the bitrate of the bitstream 4; when the bitrate is high, the encoder can produce a bitstream which allows a better quality output video 5.
  • the video encoding /decoding can e.g. comply with any one of HEVC (High Efficiency Video Coding), MPEG (Moving Pictures Expert Group)-4 H.263, H.264, and MPEG-2, etc.
  • HEVC High Efficiency Video Coding
  • MPEG Motion Picture Expert Group
  • Fig 2 is a schematic diagram illustrating an intra-frame displacement vector 10 used by the encoder 1 and decoder 2 of Fig 1.
  • One type of displacement vector is a motion vector.
  • One way to encode video is to reuse samples which resemble the samples which are to be encoded. Samples can for instance be pixels.
  • a video frame 20 is divided into a number of blocks.
  • the video frame is divided into 25 (five by five) blocks. It is to be noted that the video frame can also be divided into blocks of different sizes.
  • Each block comprises a number of samples, where each sample relates to a picture element, i.e. pixel. In this example, each block comprises 16 by 16 samples.
  • blocks are encoded and decoded from left to right, one line at a time from the top down.
  • any other order of encoding and decoding blocks can equally well be used.
  • the coding tree in HEVC with a 64x64 block typically is typically the base coding unit.
  • Several 64x64 blocks in raster scan order constitutes the picture.
  • Each 64x64 block can be divided into 32x32, 16x16 or 8x8 coding units in a quad- tree order.
  • Each coding unit is further divided into one or several prediction units and transform units.
  • the prediction unit relates to a block with one or two specific displacement vector.
  • a single displacement vector refers to unidirectional prediction and when two displacement vectors are used refers to bi-prediction.
  • a displacement vector 10 is then used to refer to the second block of samples 13.
  • the origin of the displacement vector is at the top-left corner of block 12. This makes the encoding of the first block of samples more efficient, since only the displacement vector 10 and the differences to the second block of samples 13 need to be encoded.
  • the displacement vector 10 starts with a prediction displacement vector (from the first block of samples).
  • a prediction displacement vector is then determined both at the encoder and the decoder.
  • the difference between the displacement vector 10 and the prediction displacement vector is coded, the difference displacement vector starts from where the prediction displacement vector points and goes to where the displacement vector points, e.g. to the second block of samples 13 in this example.
  • Fig 3 is a schematic diagram illustrating an inter frame displacement vector 10 used by the encoder 1 and decoder 2 of Fig 1.
  • the current video frame contains the first block of samples 12, which is the block which is currently being encoded or decoded.
  • the second block of samples 13, however, is on the previous video frame 19, which has already been encoded or decoded.
  • the displacement vector 10 then starts at a block 12' of the previous video frame 19 which is in the same position as the first block of samples 12 of the current video frame 20.
  • the displacement vector 10 is here an inter frame displacement vector.
  • Fig 4A is a schematic diagram illustrating how the displacement vector 10 can be encoded and decoded according to embodiments presented herein by the encoder 1 and decoder 2 of Fig 1.
  • the blocks of the video frame each have a label value, indicated by capital letter A, B, C.
  • the size of all blocks are also same in this example but the invention can also be used when blocks have different sizes. Also, the blocks do not need to be rectangular they could even be arbitrary shaped regions.
  • the label values are based on at least one parameter related to the samples of the respective block. For instance, the label value can be based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters in the bitstream. As is explained in more detail below, the inventors have realised that by determining labels of the blocks, the encoding of the displacement vector 10 can be made more efficient.
  • the unit of the displacement vector can be any suitable unit.
  • the unit can be pixels, subpixels (e.g. quarters of pixels) or a multiple of pixels (e.g. 2 pixels, 4 pixels, etc.).
  • subpixels e.g. quarters of pixels
  • a multiple of pixels e.g. 2 pixels, 4 pixels, etc.
  • Figs 5A-B are flow charts illustrating methods for encoding an input displacement vector, performed by the encoder 1 of Fig 1. The methods will be described with reference also to Fig 4A.
  • Fig 4A there is a first block of samples 12, for which there is an input displacement vector 10, which indicates a reference to a previously encoded second block of samples 13.
  • the input displacement vector 10 comprises a first input displacement
  • the input displacement components can be expressed as vectors, allowing the vectors to form part of an arbitrary coordinate system.
  • the method is performed for encoding the input displacement vector 10 as part of encoding the first block of samples 12 of the video frame 20.
  • the first direction 17a can be a vertical direction and the second direction 17b can be a horizontal direction, or vice versa.
  • first direction 17a and the second direction 17b define a coordinate system which differs (e.g. at a different angle) from the coordinate system used for defining the blocks of the video frame.
  • the input displacement vector can be an intra-frame displacement vector, i.e. the video frame of the first block of samples and the video frame of the second block of samples is the same.
  • the input displacement vector can be an inter frame
  • displacement vector i.e. the video frame of the first block of samples and the second block of samples differ.
  • a first label value for the first block of samples is obtained.
  • the first label value is based on at least one parameter related to the samples of the first block.
  • the first label value can be e.g. be based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters to be provided in the bitstream.
  • the label can be derived using a specific label determination procedure, e.g. using one or more of the parameters exemplified above.
  • a first evaluation direction is selected.
  • a second label value for an evaluation block of samples is obtained.
  • the evaluation block is located in the first evaluation direction in relation to the first block of samples.
  • the second label value is based on at least one parameter related to the samples of the evaluation block.
  • the parameter(s) for the second label value correspond to the parameter(s) for the first label value.
  • the evaluation block is the block immediately above (following the first evaluation direction 17a) the first block of samples.
  • the evaluation block is in a starting position corresponding to the first block of samples, but in the frame of the second block of samples.
  • a labels differ step 47 the first label value and the second label value (i.e. for the evaluation block) are compared.
  • determine encoded vector step 50 the encoded displacement vector is determined based on the comparison of the first label value and the second label value. This determination can occur in several sub-determinations, until the exit condition of the subsequent conditional done step 52 is satisfied.
  • a conditional done step 52 it is determined whether an exit condition is fulfilled. If so, the method ends. Otherwise, the method returns to the obtain 2 nd label value step 46 for a subsequent block of samples in the first evaluation direction. For instance, the evaluation starts at the block adjacently above the first block of samples 12, and successively continues in the first direction 17a, block by block.
  • the exit condition can e.g. be that an evaluation block, corresponding to the input displacement component in the evaluation direction, is reached.
  • an encoded displacement component is initialised in the first evaluation direction to the input displacement component in the first evaluation direction.
  • the starting position for the evaluation can be the top-left sample of the first block of samples 12/12'.
  • this step comprises adjusting the encoded displacement component by a prediction displacement component, in the first evaluation direction.
  • This sets the starting point to where the prediction displacement vector points.
  • the evaluation block is displaced from the first block of samples (e.g. top-left sample of the first block of samples 12) by the prediction displacement vector (in the first evaluation direction).
  • the method takes different paths depending on the result of the conditional labels differ step 47. If the labels differ, the method proceeds to a decrease magnitude step 48. Otherwise, the method proceeds to the conditional done step 50. l8
  • a magnitude of the encoded displacement component in the first evaluation direction is decreased with the size of the evaluation block in the first evaluation direction.
  • the decrease of a magnitude involves addition by the size of the evaluation block (in the first evaluation direction) if the encoded displacement component is negative. If the encoded displacement component is positive, the decrease of a magnitude involves subtraction by the size of the evaluation block (in the first evaluation direction).
  • the size of the evaluation block is determined in a unit which is also used for the input displacement vector. This implies, e.g. when the displacement vector is specified in quarters of pixels, the size of the evaluation block is determined as the size in pixels times 4. The same applies to the decoding method.
  • conditional last label match step 51 it is determined whether the last second label value matches the first label value.
  • the last second label value is the latest second label value determined in this method for the displacement vector. If this is true, the method proceeds to a set encoding indicator step 53. Otherwise, the method proceeds to a conditional repeat for 2 nd
  • evaluation direction step 42' In the set encoding indicator step 53, an encoding indicator is set for the first evaluation direction.
  • step 42' it is determined whether the input displacement vector is also to be encoded in a second evaluation direction. If this is not the case, the method proceeds to an insert encoding indicator step 54. On the other hand, if this is the case, the method returns to the initialise step 44, after which the steps 44, 46, 47, 48, 50, 51, 53 are performed for the second evaluation direction instead of the first evaluation direction.
  • a starting position for the evaluation in the second direction can be from the position of the first block, displaced by the input displacement component in the first evaluation direction.
  • the encoding indicator for at least one of the first direction and the encoding indicator for the second direction is inserted to an encoded bitstream.
  • only encoding indicators which are set are inserted, which reduces usage of the bitstream when the either or both encoding indicators are not set.
  • encoded displacement components for the first and/ or second directions are inserted in the encoded bitstream.
  • the encoded displacement components can be entropy coded using any suitable entropy coding method to reduce bit usage. For instance, Context Adaptive Binary Arithmetic Coding (CABAC) or Context Adaptive Variable Length Coding (CAVLC) can be employed. This step is only performed when an encoding indicator for the respective evaluation direction is set.
  • CABAC Context Adaptive Binary Arithmetic Coding
  • CAVLC Context Adaptive Variable Length Coding
  • a label value for each block in the video frame of the first block of samples are inserted to an encoded bitstream.
  • the decoder simply reads the label values from the bitstream, rather than having to determine the label values again on the decoder side.
  • the order in which data is inserted into the bitstream is not important as long as the decoder is able to extract the data for the decoding process.
  • the coordinate system has its origin at the top -left sample of the current block 12.
  • the vertical component shall go from this position and upwards to a position that vertically is aligned with the displacement vector.
  • the horizontal component shall start from the ending point of the vertical component.
  • the direction up implies negative values and the direction left implies negative values.
  • Each block is a block of 16 by 16 samples.
  • the input displacement vector can be written as (-27, -35).
  • the label value 'A' is obtained for the first block of samples 12, e.g. by analysing the samples of the first block of samples 12.
  • the evaluation direction is selected as the first evaluation direction 17a, being a vertical direction and upwards (since the input displacement vector points at a second block above the first block).
  • the vertical encoded displacement component denoted edv y herein, is initialised to the vertical value of the input displacement vector, i.e. -35.
  • step 46 the first time this is performed, since the starting position is at the top-left sample of the first block and the direction is upwards, the evaluation block is the block above the first block 12, with label value ⁇ '.
  • step 47 it is determined that the labels are the same, whereby the magnitude of edv y is unmodified.
  • step 50 the block corresponding to the vertical input displacement component has not been reached yet, so the method returns to step 46, for the evaluation block one block up from the current evaluation block.
  • step 46 now, the evaluation block is the block two blocks above the first block 12, with label value 'B'.
  • step 47 it is determined that the labels differ, whereby, in step 48, the magnitude of edv y is decreased by 16, i.e.
  • step 50 the block corresponding to the vertical input displacement component has not been reached yet, so the method returns to step 46, for the evaluation block one block up from the current evaluation block.
  • the evaluation block is the block three blocks above the first block 12, with label value ⁇ '.
  • step 47 it is determined that the labels are the same, whereby the magnitude of edv y is unmodified.
  • step 50 the block corresponding to the vertical input displacement component has now been reached, so the method proceeds to step 51.
  • step 51 a match between labels of the first block and the last evaluation block is determined, whereby in step 53, a vertical encoding indicator is set to 1 or true or another value that indicates that the method is used in that direction for the first block of samples.
  • step 42' it is determined that the horizontal component has not been analysed yet, so the method returns to step 44, now with the evaluation direction being the horizontal direction.
  • step 44 the horizontal encoded displacement component, denoted edv x herein, is initialised to horizontal value of the input displacement vector, i.e. -27.
  • step 46 the evaluation block is the block three blocks above the first block 12, with label value ⁇ '.
  • step 47 it is determined that the labels are the same, whereby the magnitude of edv x is unmodified.
  • step 50 the block corresponding to the horizontal input displacement component has not been reached yet, so the method returns to step 46, for the evaluation block one block left from the current evaluation block.
  • step 46 the evaluation block is the block one block left of the block three blocks above the first block 12, with label value 'B'.
  • step 47 it is determined that the labels differ, whereby in step 48, the magnitude of edv x is decreased from 27 to 11.
  • step 50 the block corresponding to the horizontal input displacement component has not been reached yet, so the method returns to step 46, for the evaluation block one block left from the current evaluation block.
  • the evaluation block is the block two blocks left of the block three blocks above the first block 12, with label value ⁇ '.
  • step 47 it is determined that the labels are the same, whereby the magnitude of edv x is unmodified.
  • step 50 the block corresponding to the horizontal input displacement component has now been reached yet, so the method proceeds to step 51.
  • step 51 a match between labels of the first block and the last evaluation block is determined, whereby in step 53, a horizontal encoding indicator is set for the first block of samples in analogy with what is described above.
  • step 42' it is determined that both the vertical and the horizontal component have been analysed, so the method proceeds to the step 54.
  • step 54 the vertical and horizontal encoding indicators (which are both positive) are inserted into the bitstream.
  • step 56 edv y and edv x are inserted into the bitstream.
  • the encoding indicators and edv y and edv x are entropy coded prior to being inserted in the bitstream.
  • step 57 the label values of all blocks of the video frame are optionally inserted in the bitstream for use by the decoder.
  • the displacement vector is represented by (-11, -19) instead of (-27, -35), which allows the displacement vector to be encoded with fewer bits.
  • this method when this method is applied to many blocks in many frames, the efficiency of encoding is greatly improved.
  • Figs 6A-B are flow charts illustrating methods for determining a decoded displacement vector, performed by the decoder 2 of Fig 1. Reference is also made to Fig 4A, but now from the perspective of decoding a previously encoded displacement vector.
  • the encoded displacement vector is read from the bitstream prior to this method starting.
  • the encoded displacement vector comprises an encoded displacement component in a first direction and/or an encoded displacement component in a second direction.
  • the determining of the decoded displacement vector is performed as part of decoding a first block of samples of a video frame.
  • the decoded displacement vector corresponds to the input displacement vector mentioned above, and thus indicates a reference to a previously decoded second block of samples.
  • the decoded displacement vector comprises at least one of a first decoded displacement component in a first direction and a second decoded
  • the first direction 17a can be a vertical direction and the second direction 17b can be a horizontal direction, or vice versa.
  • the decoded displacement vector can be an intra-frame displacement vector, i.e. the video frame of the first block of samples and the video frame of the second block of samples is the same.
  • the decoded displacement vector can be an inter frame displacement vector, i.e. the video frame of the first block of samples and the second block of samples differ.
  • a first label value for the first block of samples is obtained.
  • the first label value is based on at least one parameter related to the samples of the first block.
  • the first label value can be e.g. be based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters that were provided in the bitstream.
  • the label value can be determined on analysis of parameters affecting the samples and/ or by directly getting label values from the bitstream.
  • a first evaluation direction is selected.
  • the first evaluation direction is the same on the encoder side and the decoder side.
  • a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples is obtained.
  • the second label value is based on at least one
  • the parameter(s) for the second label value correspond to the parameter(s) for the first label value.
  • a labels differ step 147 the first label value and the second label value are compared.
  • determine decoded vector step 150 the decoded displacement vector is determined based on the comparison of the first label value and the second label value.
  • a conditional done step 152 it is determined whether an exit condition is fulfilled. If so, the method ends. Otherwise, the method returns to the obtain 2 nd label value step 146.
  • the exit condition can e.g. be that the decoded displacement vector is completely decoded in the first evaluation direction.
  • a read label values step 137 label values for at least one block in the video frame of the first block of samples is read from an encoded bitstream. These label values can be used both for the first block of samples and for each evaluation block. The values only need to be read once for a video frame and can then be temporarily stored for all blocks of the video frames. When the label values are not needed anymore, they can be discarded.
  • This step can also include decoding the label values from an encoded form being part of the bitstream.
  • a read encoding indicator step 134 the encoding indicator for the first direction and/or the encoding indicator for the second direction are decoded from an encoded bitstream.
  • a conditional encoding indicator set step 143 it is determined whether an encoding indicator for the first evaluation direction is set. If this is the case, the method proceeds to an initialise step 144. Otherwise the method proceeds to a conditional repeat for 2 nd evaluation direction step 142'.
  • a decoded displacement vector is initialised in the first evaluation direction to the encoded displacement vector in the first evaluation direction.
  • the starting position for the evaluation block is displaced from the top-left sample of the first block of samples by the prediction displacement vector.
  • the prediction displacement vector is added to the decoded displacement vector. It is to be noted that it is also possible to initialise the decoded displacement component to zero and then increase the decoded vertical displacement on every iteration as part of the evaluation, but by initialising the decoded displacement vector to the encoded vertical displacement vector and then only need to update it when labels are different than the current label, fewer arithmetic operations are needed.
  • the method takes different paths depending on the result of the conditional labels differ step 147. If the labels do not differ, i.e. are the same, the method proceeds to a decrease magnitude step 149. Otherwise, if the labels differ, the method proceeds to an increase magnitude step 148.
  • displacement component in the first evaluation direction is decreased with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value are equal.
  • the magnitude of the encoded displacement component in the first evaluation direction is less than the size of the evaluation block, then it is set to zero in this step.
  • displacement component in the first evaluation direction is increased with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value are different.
  • the size of the evaluation block is determined in a unit which is also used for the displacement vector, e.g. pixels or quarter pixels or any other suitable unit.
  • the exit condition can be that the encoded displacement component in the first evaluation direction is zero.
  • step 142' it is determined whether the input displacement vector is also to be decoded in a second evaluation direction. If this is not the case, the method ends. On the other hand, if this is the case, the method returns to the read encoding indicator step 134, after which the steps 134, 143, 144, 146, 147, 148, 149, and 152 are performed for the second evaluation direction instead of the first evaluation direction.
  • the encoded displacement vector (edv x , edvy) from the bitstream is (-11, -19), which is to be decoded for the first block of samples 12.
  • the decoder needs to keep track of three entities: the current scanning position (for label comparison), the encoded
  • step 140 the label value 'A' is obtained for the first block of samples 12.
  • the label value is previously obtained from the bitstream in step 137.
  • the evaluation direction is selected as the first evaluation direction 17a, being a vertical direction (matching the first evaluation direction of the encoder).
  • step 134 the set vertical encoding indicator is read from the bitstream.
  • step 143 it is determined that the vertical encoding indicator is set, whereby the method continues to step 144.
  • step a decoded vertical displacement vector dv y is initialised to the encoded vertical displacement component, i.e. -19.
  • the encoded vertical displacement vector edv y remains as the read value, i.e. -19.
  • step 146 the first time this is performed, since the starting position is at the top-left sample of the first block and edv y is negative the evaluation block is the block above the first block 12, with label value ⁇ '.
  • step 147 it is determined that the labels are the same, whereby in step 149, the magnitude of edvy i decreased by 16, i.e. from -19 to -3. dv y is unmodified since the labels are the same.
  • step 152 the encoded vertical displacement component is not yet zero, so the method returns to step 146, for the evaluation block one block up from the current evaluation block.
  • step 146 the evaluation block is the block two blocks above the first block 12, with label value 'B'.
  • step 147 it is determined that the labels differ, whereby in step 148, dv y is increased in magnitude by 16, i.e. from -19 to -35.
  • step 152 the encoded vertical displacement component is not yet zero, so the method returns to step 146, for the evaluation block one block up from the current evaluation block.
  • step 146 the evaluation block is the block three blocks above the first block 12, with label value ⁇ '.
  • step 147 it is determined that the labels are the same, whereby in step 149, the magnitude of edv y is decreased by 3, i.e. from -3 to o. dv y is unmodified since the labels are the same.
  • step 152 the exit condition has now been met since the magnitude of edv y is zero, so the method proceeds to step 142'.
  • step 142' it is determined that the horizontal component has not been analysed yet, so the method returns to step 134, now with the evaluation direction being the horizontal direction.
  • step 134 the set horizontal encoding indicator is read from the bitstream. Hence in step 143, it is determined that the horizontal encoding indicator is set, whereby the method continues to step 144.
  • a decoded horizontal displacement vector dv x is initialised to -11, the encoded horizontal displacement vector edv x .
  • the encoded horizontal displacement vector edv x remains as the read value, i.e. -11.
  • the evaluation block is the block three blocks above the first block 12, with label value ⁇ '.
  • step 152 the encoded horizontal
  • step 146 the evaluation block is the block one block left of the block three blocks above the first block 12, with label value 'B'.
  • step 147 it is determined that the labels differ, whereby in step 148, dv x is increased in magnitude by 16, i.e. from -11 to -27. The magnitude of edv x is unmodified.
  • step 152 the encoded horizontal displacement component is not yet zero, so the method returns to step 146, for the evaluation block one block left from the current evaluation block.
  • step 146 the evaluation block is the block two blocks left of the block three blocks above the first block 12, with label value ⁇ '.
  • step 147 it is determined that the labels are the same, whereby in step 149, the magnitude of edv x is decreased by 11, i.e. from -11 to -o. dv x is unmodified.
  • step 152 the exit condition has now been met since the magnitude of edv x is zero, so the method proceeds to step 142'.
  • step 142' it is determined that both the vertical and the horizontal component have been analysed, so the method ends.
  • the labelling is based on the compressed motion vector magnitude in the reference picture which is referenced by a specific displacement vector.
  • the compressed motion is defined for each 16x16 region of a previously coded picture thus the labelling here is also performed on 16x16 blocks. Blocks with small motion magnitudes are given label o and other blocks are given label 1. Blocks that are intra coded are also given label 1.
  • the first block is assumed to have label 1. Other labelling schemes and regions are also possible; this is just an example.
  • First block is identical to prediction unit in HEVC vocabulary.
  • An HEVC decoder modification example will now be described with reference to Fig 4B.
  • Fig 4B is similar to Fig 4A, but here the predicted displacement vector 18 is illustrated.
  • the method is used when abs_mvd_minus2[o], the horizontal encoded displacement vector component in HEVC minus 2, or abs_mvd_minus2[i], the vertical encoded displacement vector component in HEVC minus 2, and corresponding encoding indicator is equal to 1 provided in the bitstream. Otherwise the HEVC method of deriving a decoded displacement vector component is used. Below we describe the approach for the derivation of the horizontal decoded displacement vector component which happens when the corresponding encoding indicator is set true otherwise the HEVC method of deriving a decoded displacement vector component is used.
  • the horizontal decoded displacement vector component dv x is initialized to the horizontal encoded displacement vector component edv x , which in HEVC is equal to, abs_mvd_greatero_flag[ o] *
  • the horizontal predicted displacement vector is added to dv x .
  • the starting position for the evaluation is at a corresponding sample to the top-left sample of the first block 12, here the current prediction unit to be decoded, in the reference picture, after adding the predicted displacement vector 18.
  • the scanning first starts inside the 16x16 block until the left border of it is reached for leftwards evaluation direction or the right border is reached for rightwards evaluation direction.
  • edvx is less than zero, the evaluation direction is leftwards and otherwise the evaluation direction is rightwards. If the label of the an evaluation block is different from the label of the first block, the magnitude dv x is increased by the number of samples, remaining until the border of the evaluation block is reached, multiplied by 4 since quarter pel accuracy is used for the displacement vector in HEVC.
  • the horizontal encoded displacement vector component edv x is unmodified.
  • the magnitude of edv x is reduced by the number of samples remaining until the border of the evaluation block is reached, multiplied with 4 or until it is zero.
  • the horizontal decoded displacement vector component dv x is unmodified. If the edv x is o the evaluation is exited otherwise it continues to the next block in the evaluation direction.
  • the encoded displacement vector and the input displacement vector are initialized to the difference between the desired displacement vector and the prediction displacement vector.
  • the starting position for the evaluation is at a corresponding sample to the top-left sample of the first block 12, here first block 12 is the current prediction unit to be encoded, in the reference picture, after adding the predicted displacement vector.
  • the magnitude of edv x is decreased by the number of samples remaining until the border of the evaluation block is reached, multiplied with 4 since quarter pel accuracy is used in HEVC.
  • the magnitude of the horizontal component of the input displacement vector dv x is decreased by the same amount.
  • the magnitude of the horizontal component of the input displacement vector dv x is reduced by the number of samples, remaining until the border of the evaluation block is reached, multiplied with 4, or until it is zero.
  • the horizontal component of the encoded displacement vector component edv x is unmodified.
  • the encoding indications can be provided when the magnitude of the horizontal component of the encoded
  • Table 1 Modified syntax for HEVC mvd coding
  • the method is only used when at least one of the encoded displacement vector components is larger than 1 otherwise the HEVC method is used.
  • Other thresholds could also be used, this is used an example.
  • the encoder modifies the corresponding position in the reference picture until it reaches the position that correspond to the horizontal component of the desired displacement vector component or if it's in a second direction until it reaches the position that corresponds to the top-left sample in the reference picture of the desired displacement vector.
  • Fig 7 is a schematic diagram showing functional modules of the encoder 1 of Fig 1 according to one embodiment.
  • the modules are implemented using software instructions such as a computer program executing in the encoder 1.
  • the modules correspond to the steps in the methods illustrated in Figs 5A-B.
  • An obtainer 70 is configured to perform the obtain 1 st label value step 40 and the obtain 2 nd label value step 46 of Figs 5A-B.
  • a direction selector 72 is configured to perform the select evaluation direction step 42 of Figs 5A-B and the conditional repeat for 2 nd evaluation direction step 142' of Fig 5B.
  • An initialiser 74 is configured to perform the initialise step 44 of Fig 5B.
  • a comparator 77 is configured to perform the labels differ step 47 and the conditional last label match step 51 of Fig 5B.
  • a reducer 78 is configured to perform the decrease magnitude step 48 of Fig 5B.
  • An evaluator 80 is configured to perform the conditional done step 52 of Figs 5A-B.
  • An indicator setter 82 is configured to perform the set encoding indicator step 53 of Fig 5B.
  • a bitstream generator 84 is configured to perform the insert encoding indicator step 54, the insert displacement component step 56 and the insert label values step 57 of Fig 5B.
  • Fig 8 is a schematic diagram showing functional modules of the decoder 2 of Fig 1 according to one embodiment.
  • the modules are implemented using software instructions such as a computer program executing in the decoder 2.
  • the modules correspond to the steps in the methods illustrated in Figs 6A-B.
  • An obtainer 170 is configured to perform the obtain 1 st label value step 140 and the obtain 2 nd label value step 146 of Figs 6A-B.
  • a direction selector 172 is configured to perform the select evaluation direction step 142 of Figs 6A-B and the conditional repeat for conditional 2 nd evaluation direction step 142 of Fig 6B.
  • An initialiser 174 is configured to perform the initialise step 144 of Fig 6B.
  • a comparator 177 is configured to perform the labels differ step 147 of Figs 6A-B.
  • a reducer 178 is configured to perform the decrease magnitude step 149 of Fig 6B.
  • An increaser 179 is configured to perform the increase magnitude step 148 of Fig 6B.
  • An evaluator 180 is configured to perform the conditional done step 152 of Figs 6A-B and the conditional encoding indicator set step 143 of Fig 6B.
  • An indicator reader 182 is configured to perform the read evaluation direction step 142 of Fig 6B.
  • a label reader 184 is configured to perform the read label values step 137 of Fig 6B.
  • Fig 9 is a schematic diagram showing some components of the encoder 1 of Fig 1.
  • a processor 60 is provided using any combination of one or more of a suitable central processing unit (CPU), multiprocessor, microcontroller, digital signal processor (DSP), application specific integrated circuit etc., capable of executing software instructions 65 stored in a memory 64, which can thus be a computer program product.
  • the processor 60 can be configured to execute the method described with reference to Figs 5A-B above.
  • the memory 64 can be any combination of read and write memory (RAM) and read only memory (ROM).
  • the memory 64 also comprises persistent storage, which, for example, can be any single one or combination of magnetic memory, optical memory, solid state memory or even remotely mounted memory.
  • a data memory 66 is also provided for reading and/ or storing data during execution of software instructions in the processor 60.
  • the data memory 66 can be any combination of read and write memory (RAM) and read only memory (ROM).
  • the encoder l further comprises an I/O interface 62 for communicating with other external entities.
  • the I/O interface 62 also includes a user interface for local or remote access.
  • Fig 10 is a schematic diagram showing some components of the decoder 2 of Fig 1.
  • a processor 160 is provided using any combination of one or more of a suitable central processing unit (CPU), multiprocessor, microcontroller, digital signal processor (DSP), application specific integrated circuit etc., capable of executing software instructions 165 stored in a memory 164, which can thus be a computer program product.
  • the processor 160 can be configured to execute the method described with reference to Figs 6A-B above.
  • the memory 164 can be any combination of read and write memory (RAM) and read only memory (ROM).
  • the memory 164 also comprises persistent storage, which, for example, can be any single one or combination of magnetic memory, optical memory, solid state memory or even remotely mounted memory.
  • a data memory 166 is also provided for reading and/or storing data during execution of software instructions in the processor 160.
  • the data memory 166 can be any combination of read and write memory (RAM) and read only memory (ROM).
  • the decoder 2 further comprises an I/O interface 162 for communicating with other external entities.
  • the I/O interface 162 also includes a user interface for local or remote access.
  • Fig 11 shows one example of a computer program product comprising computer readable means.
  • a computer program 91 can be stored, which computer program can cause a processor to execute a method according to embodiments described herein.
  • the computer program product is an optical disc, such as a CD (compact disc) or a DVD (digital versatile disc) or a Blu-Ray disc.
  • the computer program product could also be embodied in a memory of a device, such as the computer program product 64 of Fig 9 and/or the computer program product 164 of Fig 10.
  • While the computer program 91 is here schematically shown as a track on the depicted optical disk, the computer program can be stored in any way which is suitable for the computer program product, such as a removable solid state memory, e.g. a Universal Serial Bus (USB) drive.
  • a removable solid state memory e.g. a Universal Serial Bus (USB) drive.
  • USB Universal Serial Bus

Landscapes

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

Abstract

It is presented a method for encoding an input displacement vector. The input displacement vector comprises a first input displacement component and a second input displacement component. The method is performed in an encoder and comprises the steps of: obtaining a first label value for the first block of samples; selecting a first evaluation direction; obtaining a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples; comparing the first label value and the second label value; determining the encoded displacement vector based on the comparison of the first label value and the second label value; and repeating the steps of obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.

Description

ENCODING AND DECODING AN DISPLACEMENT VECTOR
TECHNICAL FIELD
The invention relates to methods, encoders, decoders, computer programs and computer program products for encoding and decoding an input displacement vector forming part of an encoded video frame.
BACKGROUND
The way digital video encoding is done improves continuously. With improved coding efficiency, better quality and/ or decreased bandwidth is achieved. One way to encode video is to reuse picture areas (samples) which resemble the samples which are to be encoded. This is utilized in state of the art video coding standards such as MPEG (Moving Pictures Expert Group)-2, H.264 and H.265/HEVC (High Efficiency Video Coding). Samples can for instance be pixels. A displacement vector is then used to refer to the resembling picture area. This makes the encoding of the referring picture area more efficient, since only the differences to the referenced picture area need to be encoded. The displacement vector can be used within a video frame (intra frame) also referred to intra block copy in screen content extension of HEVC or referring to another video frame (inter frame) also referred to motion compensated prediction. While displacement vectors contribute to more efficient encoding, displacement vectors can be quite common; it is possible with several displacement vectors in each video frame, whereby the displacement vectors themselves take up significant data in an encoded bitstream. In state of the art video coding such as H.264 and HEVC, a prediction of the displacement vector is used to reduce the overhead for coding the
displacement vector. If there is a non-zero difference between one component of the displacement vector and a prediction of the displacement vector, a difference displacement vector is coded and provided in the bitstream. Here follows a description of the approach in HEVC. The coding of respective component of the difference displacement vector is done separately but identical. We describe here how it's done for the horizontal component. A flag indicates if the horizontal component is larger than zero. If its non-zero another flag indicates if its magnitude is larger than l. If it is larger than one, the magnitude of the horizontal difference component minus 2 is coded. A sign for the horizontal difference component is coded if the magnitude is larger than zero.
Despite the use of prediction for coding the displacement vector they still contribute to a significant portion of the total bitrate. SUMMARY
It is an object to provide a more efficient way in which displacement vectors are encoded.
According to a first aspect, it is presented a method for encoding an input displacement vector as part of encoding a first block of samples of a video frame, the input displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples. The method is performed in an encoder and comprises the steps of: obtaining a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; selecting a first evaluation direction; obtaining a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; comparing the first label value and the second label value; determining the encoded displacement vector based on the comparison of the first label value and the second label value; and repeating the steps of obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled. The method may further comprise the steps of: initialising an encoded displacement component in the first evaluation direction to the input displacement component in the first evaluation direction; decreasing a magnitude of the encoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value differ; setting an encoding indicator for the first evaluation direction when, and only when, the last second label value matches the first label value; wherein the step of repeating comprises also repeating the step of decreasing for the subsequent block of samples in the first evaluation direction until the exit condition is fulfilled. It is to be noted that setting the indicator is to be construed as setting the indicator to a true value, e.g. ι or any other predetermined value to indicate a positive value. In contrast, when the indicator is not set, it is a false value e.g. o or not present or any other predetermined value to indicate the negative.
The step of initialising may comprise adjusting the encoded displacement component by a prediction displacement component, in the first evaluation direction; and wherein when the first time the step of obtaining a second label value is performed, the evaluation block is displaced from the first block of samples by the prediction displacement vector.
In the step of obtaining the second label value, a starting position for an evaluation in a second direction is from the position of the first block displaced by the input displacement component in the first evaluation direction. The exit condition maybe that an evaluation block, corresponding to the input displacement component in the evaluation direction, is reached.
The first direction may be a horizontal direction and the second direction is a vertical direction, or vice versa.
The method may further comprise the steps of: selecting a second evaluation direction; and performing the steps of initialising, obtaining a second label value, decreasing, repeating and setting for the second evaluation direction instead of the first evaluation direction.
The video frame of the first block of samples and the video frame of the second block of samples may be the same. The video frame of the first block of samples and the video frame of the second block of samples may differ, and wherein when the first time the step of obtaining a second label value is performed, the evaluation block may be in a position corresponding to the first block of samples.
In the step of decreasing, the size of the evaluation block may be determined in a unit which is also used for the input displacement vector.
In the step of obtaining a first label value and obtaining a second label value, the label values maybe based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters to be provided in the bitstream.
The method may further comprise the step of: inserting the encoding indicator for at least one of the first direction and the encoding indicator for the second direction in an encoded bitstream.
The method may further comprise the step of: inserting an encoded displacement component for the first and second directions in an encoded bitstream, when and only when an encoding indicator for the respective evaluation direction is set.
The method may further comprise the step of: inserting a label value for each block in the video frame of the first block of samples in an encoded bitstream. According to a second aspect, it is presented an encoder for encoding an input displacement vector as part of encoding a first block of samples of a video frame, the input displacement vector comprising a first input
displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples. The encoder comprises: a processor; and a memory storing instructions that, when executed by the processor, causes the encoder to: obtain a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; select a first evaluation direction; obtain a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; compare the first label value and the second label value; determine the encoded displacement vector based on the comparison of the first label value and the second label value; and repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
According to a third aspect, it is presented an encoder comprising: means for obtaining a first label value for a first block of samples, the first label value being based on at least one parameter related to the samples of a first block, the first label value being used for encoding an input displacement vector as part of encoding the first block of samples of a video frame, the input displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples; means for selecting a first evaluation direction; means for obtaining a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; means for comparing the first label value and the second label value; means for determining the encoded displacement vector based on the comparison of the first label value and the second label value; and means for repeating the obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
According to a fourth aspect, it is presented a computer program for encoding an input displacement vector as part of encoding a first block of samples of a video frame, the input displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples. The computer program comprises computer program code which, when run on an encoder causes the encoder to: obtain a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; select a first evaluation direction; obtain a second label value for an evaluation block of samples being located in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; compare the first label value and the second label value; determine the encoded displacement vector based on the comparison of the first label value and the second label value; and repeat the obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
According to a fifth aspect, it is presented a computer program product comprising a computer program according to the fourth aspect and a computer readable means on which the computer program is stored.
According to a sixth aspect, it is presented a method for determining a decoded displacement vector from an encoded displacement vector as part of decoding a first block of samples of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples. The method is performed in an decoder and comprises the steps of: obtaining a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; selecting a first evaluation direction; obtaining a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; comparing the first label value and the second label value; determining the decoded displacement vector based on the comparison of the first label value and the second label value; and repeating the steps of obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
The method may further comprise the steps of: initialising a decoded displacement vector in the first evaluation direction to the encoded displacement vector in the first evaluation direction; increasing a magnitude of the decoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value differ; decreasing a magnitude of the encoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value are equal; wherein the step of repeating comprises also repeating the steps of increasing and decreasing for the subsequent block of samples in the first evaluation direction until the exit condition is fulfilled; and the steps of initialising, obtaining the second label value, increasing, decreasing and repeating are only performed for a particular first evaluation direction when an encoding indicator for the first evaluation direction is set.
The exit condition maybe that the magnitude of the encoded displacement component in the first evaluation direction has reached zero. Reaching zero means that the magnitude of the encoded displacement component has been reduced to the point that zero has been reached. This also encompasses if the reduction in magnitude is so great that the sign of the encoded displacement component in the first evaluation direction changes sign (i.e. from positive to negative or vice versa) without actually assuming the value zero.
In the step of initialising, wherein when the first time the step of obtaining a second label value is performed, the evaluation block is displaced from the first block of samples by the prediction displacement vector.
The first direction may be a horizontal direction and the second direction is a vertical direction, or vice versa.
The method may further comprise the steps of: selecting a second evaluation direction; and performing the steps of initialising, obtaining a second label value, comparing, increasing, decreasing, determining, and repeating for the second evaluation direction instead of the first evaluation direction.
The video frame of the first block of samples and the video frame of the second block of samples may be the same.
The video frame of the first block of samples and the video frame of the second block of samples may differ.
In the steps of increasing and decreasing, the size of the evaluation block may be determined in a unit which is also used for the displacement vector.
In the step of obtaining a first label value and obtaining a second label value, the label values maybe based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters provided in the bitstream.
The method may further comprise the step of: reading the encoding indicator for the first direction and/ or the encoding indicator for the second direction from an encoded bitstream. The method may further comprise the step of: reading label values for at least one block in the video frame of the first block of samples from an encoded bitstream.
According to a seventh aspect, it is presented a decoder for determining a decoded displacement vector from an encoded displacement vector as part of decoding a first block of samples of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples. The decoder comprises: a processor; and a memory storing instructions that, when executed by the processor, causes the decoder to: obtain a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; selecting a first evaluation direction; obtain a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; compare the first label value and the second label value; determine the decoded displacement vector based on the comparison of the first label value and the second label value; and repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
According to an eighth aspect, it is presented a decoder comprising: means for obtaining a first label value for a first block of samples, the first label value being based on at least one parameter related to samples of the first block, for determining a decoded displacement vector from an encoded displacement vector as part of decoding the first block of samples of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples; means for selecting a first evaluation direction; means for obtaining a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; means for comparing the first label value and the second label value; means for determining the decoded displacement vector based on the comparison of the first label value and the second label value; and means for repeating the obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled. According to a ninth aspect, it is presented a computer program for determining a decoded displacement vector from an encoded displacement vector as part of decoding a first block of samples of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded
displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples. The computer program comprises computer program code which, when run on a decoder causes the decoder to: obtain a first label value for the first block of samples, the first label value being based on at least one parameter related to the samples of the first block; selecting a first evaluation direction; obtain a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples, the second label value being based on at least one parameter related to the samples of the evaluation block; compare the first label value and the second label value; determine the decoded displacement vector based on the comparison of the first label value and the second label value; and repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled. According to a tenth aspect, it is presented a computer program product comprising a computer program according to the ninth aspect and a computer readable means on which the computer program is stored. Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a/an/the element, apparatus, component, means, step, etc." are to be interpreted openly as referring to at least one instance of the element, apparatus, component, means, step, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.
BRIEF DESCRIPTION OF THE DRAWINGS
The invention is now described, by way of example, with reference to the accompanying drawings, in which:
Fig l is a schematic diagram illustrating an environment in which
embodiments presented herein can be implemented;
Fig 2 is a schematic diagram illustrating an intra-frame displacement vector used by the encoder and decoder of Fig l; Fig 3 is a schematic diagram illustrating an inter frame displacement vector used by the encoder and decoder of Fig l;
Figs 4A-B are schematic diagrams illustrating how the displacement vector can be encoded and decoded by the encoder and decoder of Fig 1 using labels;
Figs 5A-B are flow charts illustrating methods for encoding an input displacement vector, performed by the encoder of Fig 1;
Figs 6A-B are flow charts illustrating methods for determining a decoded displacement vector, performed by the decoder of Fig 1;
Fig 7 is a schematic diagram illustrating functional modules of the encoder of Fig 1 according to one embodiment; Fig 8 is a schematic diagram illustrating functional modules of the decoder of Fig 1 according to one embodiment; Fig 9 is a schematic diagram illustrating some components of the encoder of Fig l according to one embodiment;
Fig 10 is a schematic diagram illustrating some components of the decoder of Fig l according to one embodiment; and Fig 11 shows one example of a computer program product comprising computer readable means.
DETAILED DESCRIPTION
The invention will now be described more fully hereinafter with reference to the accompanying drawings, in which certain embodiments of the invention are shown. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided by way of example so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art. Like numbers refer to like elements throughout the description.
Fig 1 is a schematic diagram illustrating an environment in which
embodiments presented herein can be implemented. An encoder 1 is used to encode input video 3 to a bitstream 4 comprising encoded video. The bitstream 4 is transferred to the decoder e.g. using a network connection or using physical media. The decoder 2 reads and decodes the bitstream 4 to produce output video 5 which corresponds to the input video stream 3. The encoding can be lossy, whereby the output video 5 is not identical to the input video 3. The perceived quality loss depends on the bitrate of the bitstream 4; when the bitrate is high, the encoder can produce a bitstream which allows a better quality output video 5.
The video encoding /decoding can e.g. comply with any one of HEVC (High Efficiency Video Coding), MPEG (Moving Pictures Expert Group)-4 H.263, H.264, and MPEG-2, etc. By providing a bitstream with reduced bitrate requirements, the resulting output video 5 can be generated with higher quality. Alternatively (or additionally), less bandwidth is needed for the bitstream 4. It is thus a benefit to increase encoding efficiency. Fig 2 is a schematic diagram illustrating an intra-frame displacement vector 10 used by the encoder 1 and decoder 2 of Fig 1. One type of displacement vector is a motion vector. One way to encode video is to reuse samples which resemble the samples which are to be encoded. Samples can for instance be pixels. A video frame 20 is divided into a number of blocks. In this example, the video frame is divided into 25 (five by five) blocks. It is to be noted that the video frame can also be divided into blocks of different sizes. Each block comprises a number of samples, where each sample relates to a picture element, i.e. pixel. In this example, each block comprises 16 by 16 samples.
In embodiments presented herein, blocks are encoded and decoded from left to right, one line at a time from the top down. However, any other order of encoding and decoding blocks can equally well be used. For example the coding tree in HEVC with a 64x64 block typically is typically the base coding unit. Several 64x64 blocks in raster scan order constitutes the picture. Each 64x64 block can be divided into 32x32, 16x16 or 8x8 coding units in a quad- tree order. Each coding unit is further divided into one or several prediction units and transform units. The prediction unit relates to a block with one or two specific displacement vector. A single displacement vector refers to unidirectional prediction and when two displacement vectors are used refers to bi-prediction. Looking now to a specific first block of samples 12, this here contains renders a circle. However, there is already a circle encoded (or decoded) previously in a second block of samples 13. Note that the second block of samples 13 do not need to align to the blocks used for encoding.
A displacement vector 10 is then used to refer to the second block of samples 13. The origin of the displacement vector is at the top-left corner of block 12. This makes the encoding of the first block of samples more efficient, since only the displacement vector 10 and the differences to the second block of samples 13 need to be encoded.
Optionally, the displacement vector 10 starts with a prediction displacement vector (from the first block of samples). Such a prediction displacement vector is then determined both at the encoder and the decoder. In such a case, the difference between the displacement vector 10 and the prediction displacement vector is coded, the difference displacement vector starts from where the prediction displacement vector points and goes to where the displacement vector points, e.g. to the second block of samples 13 in this example.
Since the first block of samples 12 and the second block of samples 13 are in the same video frame, the displacement vector 10 is here an intra frame displacement vector 10. Fig 3 is a schematic diagram illustrating an inter frame displacement vector 10 used by the encoder 1 and decoder 2 of Fig 1. Here, there is a previous video frame 19 and a current video frame 20. The current video frame contains the first block of samples 12, which is the block which is currently being encoded or decoded. The second block of samples 13, however, is on the previous video frame 19, which has already been encoded or decoded. The displacement vector 10 then starts at a block 12' of the previous video frame 19 which is in the same position as the first block of samples 12 of the current video frame 20. Hence, the displacement vector 10 is here an inter frame displacement vector. Fig 4A is a schematic diagram illustrating how the displacement vector 10 can be encoded and decoded according to embodiments presented herein by the encoder 1 and decoder 2 of Fig 1. Here, the blocks of the video frame each have a label value, indicated by capital letter A, B, C. The size of all blocks are also same in this example but the invention can also be used when blocks have different sizes. Also, the blocks do not need to be rectangular they could even be arbitrary shaped regions. The label values are based on at least one parameter related to the samples of the respective block. For instance, the label value can be based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters in the bitstream. As is explained in more detail below, the inventors have realised that by determining labels of the blocks, the encoding of the displacement vector 10 can be made more efficient.
The unit of the displacement vector can be any suitable unit. For example, the unit can be pixels, subpixels (e.g. quarters of pixels) or a multiple of pixels (e.g. 2 pixels, 4 pixels, etc.). For simplicity, we will use pixels for the examples presented herein.
Figs 5A-B are flow charts illustrating methods for encoding an input displacement vector, performed by the encoder 1 of Fig 1. The methods will be described with reference also to Fig 4A. In Fig 4A, there is a first block of samples 12, for which there is an input displacement vector 10, which indicates a reference to a previously encoded second block of samples 13. The input displacement vector 10 comprises a first input displacement
component in a first direction 17a and a second input displacement component in a second direction 17b. Optionally, the input displacement components can be expressed as vectors, allowing the vectors to form part of an arbitrary coordinate system. The method is performed for encoding the input displacement vector 10 as part of encoding the first block of samples 12 of the video frame 20. The first direction 17a can be a vertical direction and the second direction 17b can be a horizontal direction, or vice versa.
Alternatively, the first direction 17a and the second direction 17b define a coordinate system which differs (e.g. at a different angle) from the coordinate system used for defining the blocks of the video frame.
As explained above with reference to Fig 2, the input displacement vector can be an intra-frame displacement vector, i.e. the video frame of the first block of samples and the video frame of the second block of samples is the same. l6
Alternatively, the input displacement vector can be an inter frame
displacement vector, i.e. the video frame of the first block of samples and the second block of samples differ.
In an obtain 1st label value step 40 a first label value for the first block of samples is obtained. The first label value is based on at least one parameter related to the samples of the first block. The first label value can be e.g. be based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters to be provided in the bitstream. In the encoding, the label can be derived using a specific label determination procedure, e.g. using one or more of the parameters exemplified above.
In a select evaluation direction step 42, a first evaluation direction is selected. In an obtain 2nd label value step 46 a second label value for an evaluation block of samples is obtained. The evaluation block is located in the first evaluation direction in relation to the first block of samples. The second label value is based on at least one parameter related to the samples of the evaluation block. The parameter(s) for the second label value correspond to the parameter(s) for the first label value. Looking to Fig 4A, the first time this step is performed, the evaluation block is the block immediately above (following the first evaluation direction 17a) the first block of samples.
When the displacement vector is an inter frame displacement vector, the first time this step is performed, the evaluation block is in a starting position corresponding to the first block of samples, but in the frame of the second block of samples.
In a labels differ step 47, the first label value and the second label value (i.e. for the evaluation block) are compared. In determine encoded vector step 50, the encoded displacement vector is determined based on the comparison of the first label value and the second label value. This determination can occur in several sub-determinations, until the exit condition of the subsequent conditional done step 52 is satisfied. In a conditional done step 52, it is determined whether an exit condition is fulfilled. If so, the method ends. Otherwise, the method returns to the obtain 2nd label value step 46 for a subsequent block of samples in the first evaluation direction. For instance, the evaluation starts at the block adjacently above the first block of samples 12, and successively continues in the first direction 17a, block by block.
The exit condition can e.g. be that an evaluation block, corresponding to the input displacement component in the evaluation direction, is reached.
Looking now to Fig 5B, only new or modified steps compared to the method illustrated by the flow chart of Fig 5A will be described. In an initialise step 44, an encoded displacement component is initialised in the first evaluation direction to the input displacement component in the first evaluation direction. For instance, the starting position for the evaluation can be the top-left sample of the first block of samples 12/12'.
Optionally, this step comprises adjusting the encoded displacement component by a prediction displacement component, in the first evaluation direction. This sets the starting point to where the prediction displacement vector points. In other words, the first time the obtain 2nd label value step is performed, the evaluation block is displaced from the first block of samples (e.g. top-left sample of the first block of samples 12) by the prediction displacement vector (in the first evaluation direction).
Here, the method takes different paths depending on the result of the conditional labels differ step 47. If the labels differ, the method proceeds to a decrease magnitude step 48. Otherwise, the method proceeds to the conditional done step 50. l8
In the decrease magnitude step 48, a magnitude of the encoded displacement component in the first evaluation direction is decreased with the size of the evaluation block in the first evaluation direction. The decrease of a magnitude involves addition by the size of the evaluation block (in the first evaluation direction) if the encoded displacement component is negative. If the encoded displacement component is positive, the decrease of a magnitude involves subtraction by the size of the evaluation block (in the first evaluation direction).
The size of the evaluation block is determined in a unit which is also used for the input displacement vector. This implies, e.g. when the displacement vector is specified in quarters of pixels, the size of the evaluation block is determined as the size in pixels times 4. The same applies to the decoding method.
In a conditional last label match step 51, it is determined whether the last second label value matches the first label value. The last second label value is the latest second label value determined in this method for the displacement vector. If this is true, the method proceeds to a set encoding indicator step 53. Otherwise, the method proceeds to a conditional repeat for 2nd
evaluation direction step 42'. In the set encoding indicator step 53, an encoding indicator is set for the first evaluation direction.
In a conditional repeat for 2nd evaluation direction step 42' it is determined whether the input displacement vector is also to be encoded in a second evaluation direction. If this is not the case, the method proceeds to an insert encoding indicator step 54. On the other hand, if this is the case, the method returns to the initialise step 44, after which the steps 44, 46, 47, 48, 50, 51, 53 are performed for the second evaluation direction instead of the first evaluation direction. A starting position for the evaluation in the second direction can be from the position of the first block, displaced by the input displacement component in the first evaluation direction.
In the insert encoding indicator step 54, the encoding indicator for at least one of the first direction and the encoding indicator for the second direction is inserted to an encoded bitstream. In one embodiment, only encoding indicators which are set are inserted, which reduces usage of the bitstream when the either or both encoding indicators are not set.
In an insert displacement component to bitstream step 56, encoded displacement components for the first and/ or second directions are inserted in the encoded bitstream. Prior to insertion, the encoded displacement components (optionally also including encoding indicators and/or label values) can be entropy coded using any suitable entropy coding method to reduce bit usage. For instance, Context Adaptive Binary Arithmetic Coding (CABAC) or Context Adaptive Variable Length Coding (CAVLC) can be employed. This step is only performed when an encoding indicator for the respective evaluation direction is set.
In an insert a label values to bitstream step 57, a label value for each block in the video frame of the first block of samples are inserted to an encoded bitstream. In this way, the decoder simply reads the label values from the bitstream, rather than having to determine the label values again on the decoder side.
It is to be noted the order in which data is inserted into the bitstream is not important as long as the decoder is able to extract the data for the decoding process.
Looking now to the example of Fig 4A with reference to Fig 5B, an example of how the encoding method works will be described. In the example, the coordinate system has its origin at the top -left sample of the current block 12. Thus, in this example, the vertical component shall go from this position and upwards to a position that vertically is aligned with the displacement vector. The horizontal component shall start from the ending point of the vertical component. In the coordinate system of Fig 4A, the direction up implies negative values and the direction left implies negative values. Each block is a block of 16 by 16 samples. The input displacement vector 10 here comprises a vertical component, in the first direction 17a, of two blocks and three pixels, i.e. (-16) + (-16) + (-3) = -35 pixels. In the horizontal direction 17b, the input displacement vector 10 here comprises a horizontal component of one block and eleven pixels, i.e. (-16) + (-11) = -27 pixels. In short, the input displacement vector can be written as (-27, -35). In step 40, the label value 'A' is obtained for the first block of samples 12, e.g. by analysing the samples of the first block of samples 12. In step 42, the evaluation direction is selected as the first evaluation direction 17a, being a vertical direction and upwards (since the input displacement vector points at a second block above the first block). In step 44, the vertical encoded displacement component, denoted edvy herein, is initialised to the vertical value of the input displacement vector, i.e. -35.
In step 46, the first time this is performed, since the starting position is at the top-left sample of the first block and the direction is upwards, the evaluation block is the block above the first block 12, with label value Ά'. In step 47, it is determined that the labels are the same, whereby the magnitude of edvy is unmodified. In step 50, the block corresponding to the vertical input displacement component has not been reached yet, so the method returns to step 46, for the evaluation block one block up from the current evaluation block. In step 46 now, the evaluation block is the block two blocks above the first block 12, with label value 'B'. In step 47, it is determined that the labels differ, whereby, in step 48, the magnitude of edvy is decreased by 16, i.e. from -35 to -19. In step 50, the block corresponding to the vertical input displacement component has not been reached yet, so the method returns to step 46, for the evaluation block one block up from the current evaluation block. In step 46 now, the evaluation block is the block three blocks above the first block 12, with label value Ά'. In step 47, it is determined that the labels are the same, whereby the magnitude of edvy is unmodified. In step 50, the block corresponding to the vertical input displacement component has now been reached, so the method proceeds to step 51.
In step 51, a match between labels of the first block and the last evaluation block is determined, whereby in step 53, a vertical encoding indicator is set to 1 or true or another value that indicates that the method is used in that direction for the first block of samples. In step 42', it is determined that the horizontal component has not been analysed yet, so the method returns to step 44, now with the evaluation direction being the horizontal direction.
In step 44, the horizontal encoded displacement component, denoted edvx herein, is initialised to horizontal value of the input displacement vector, i.e. -27.
In step 46, the evaluation block is the block three blocks above the first block 12, with label value Ά'. In step 47, it is determined that the labels are the same, whereby the magnitude of edvx is unmodified. In step 50, the block corresponding to the horizontal input displacement component has not been reached yet, so the method returns to step 46, for the evaluation block one block left from the current evaluation block.
In step 46 now, the evaluation block is the block one block left of the block three blocks above the first block 12, with label value 'B'. In step 47, it is determined that the labels differ, whereby in step 48, the magnitude of edvx is decreased from 27 to 11. In step 50, the block corresponding to the horizontal input displacement component has not been reached yet, so the method returns to step 46, for the evaluation block one block left from the current evaluation block. In step 46 now, the evaluation block is the block two blocks left of the block three blocks above the first block 12, with label value Ά'. In step 47, it is determined that the labels are the same, whereby the magnitude of edvx is unmodified. In step 50, the block corresponding to the horizontal input displacement component has now been reached yet, so the method proceeds to step 51.
In step 51, a match between labels of the first block and the last evaluation block is determined, whereby in step 53, a horizontal encoding indicator is set for the first block of samples in analogy with what is described above. In step 42', it is determined that both the vertical and the horizontal component have been analysed, so the method proceeds to the step 54. In step 54, the vertical and horizontal encoding indicators (which are both positive) are inserted into the bitstream. In step 56, edvy and edvx are inserted into the bitstream. Optionally, the encoding indicators and edvy and edvx are entropy coded prior to being inserted in the bitstream. Also, in step 57, the label values of all blocks of the video frame are optionally inserted in the bitstream for use by the decoder.
Using this method, the displacement vector is represented by (-11, -19) instead of (-27, -35), which allows the displacement vector to be encoded with fewer bits. Hence, when this method is applied to many blocks in many frames, the efficiency of encoding is greatly improved.
Figs 6A-B are flow charts illustrating methods for determining a decoded displacement vector, performed by the decoder 2 of Fig 1. Reference is also made to Fig 4A, but now from the perspective of decoding a previously encoded displacement vector. The encoded displacement vector is read from the bitstream prior to this method starting. The encoded displacement vector comprises an encoded displacement component in a first direction and/or an encoded displacement component in a second direction. The determining of the decoded displacement vector is performed as part of decoding a first block of samples of a video frame. The decoded displacement vector corresponds to the input displacement vector mentioned above, and thus indicates a reference to a previously decoded second block of samples. The decoded displacement vector comprises at least one of a first decoded displacement component in a first direction and a second decoded
displacement component in a second direction. The first direction 17a can be a vertical direction and the second direction 17b can be a horizontal direction, or vice versa.
As explained above, the decoded displacement vector can be an intra-frame displacement vector, i.e. the video frame of the first block of samples and the video frame of the second block of samples is the same. Alternatively, the decoded displacement vector can be an inter frame displacement vector, i.e. the video frame of the first block of samples and the second block of samples differ.
In an obtain 1st label value step 140, a first label value for the first block of samples is obtained. The first label value is based on at least one parameter related to the samples of the first block. The first label value can be e.g. be based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters that were provided in the bitstream. The label value can be determined on analysis of parameters affecting the samples and/ or by directly getting label values from the bitstream.
In a select evaluation direction step 142, a first evaluation direction is selected. The first evaluation direction is the same on the encoder side and the decoder side.
In an obtain 2nd label step 146, a second label value for an evaluation block of samples in the first evaluation direction in relation to the first block of samples is obtained. The second label value is based on at least one
parameter related to the samples of the evaluation block. The parameter(s) for the second label value correspond to the parameter(s) for the first label value.
In a labels differ step 147, the first label value and the second label value are compared. In determine decoded vector step 150, the decoded displacement vector is determined based on the comparison of the first label value and the second label value.
In a conditional done step 152, it is determined whether an exit condition is fulfilled. If so, the method ends. Otherwise, the method returns to the obtain 2nd label value step 146. The exit condition can e.g. be that the decoded displacement vector is completely decoded in the first evaluation direction.
Looking now to Fig 6B, only new or modified steps compared to the method illustrated by the flow chart of Fig 6A will be described.
In a read label values step 137, label values for at least one block in the video frame of the first block of samples is read from an encoded bitstream. These label values can be used both for the first block of samples and for each evaluation block. The values only need to be read once for a video frame and can then be temporarily stored for all blocks of the video frames. When the label values are not needed anymore, they can be discarded. This step can also include decoding the label values from an encoded form being part of the bitstream.
In a read encoding indicator step 134, the encoding indicator for the first direction and/or the encoding indicator for the second direction are decoded from an encoded bitstream. In a conditional encoding indicator set step 143 it is determined whether an encoding indicator for the first evaluation direction is set. If this is the case, the method proceeds to an initialise step 144. Otherwise the method proceeds to a conditional repeat for 2nd evaluation direction step 142'. In the initialise step 144, a decoded displacement vector is initialised in the first evaluation direction to the encoded displacement vector in the first evaluation direction. Optionally, when there is a prediction displacement vector, the starting position for the evaluation block is displaced from the top-left sample of the first block of samples by the prediction displacement vector. In that case the prediction displacement vector is added to the decoded displacement vector. It is to be noted that it is also possible to initialise the decoded displacement component to zero and then increase the decoded vertical displacement on every iteration as part of the evaluation, but by initialising the decoded displacement vector to the encoded vertical displacement vector and then only need to update it when labels are different than the current label, fewer arithmetic operations are needed.
Here, the method takes different paths depending on the result of the conditional labels differ step 147. If the labels do not differ, i.e. are the same, the method proceeds to a decrease magnitude step 149. Otherwise, if the labels differ, the method proceeds to an increase magnitude step 148.
In the decrease magnitude step 149, a magnitude of the encoded
displacement component in the first evaluation direction is decreased with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value are equal. When the magnitude of the encoded displacement component in the first evaluation direction is less than the size of the evaluation block, then it is set to zero in this step.
In the increase magnitude step 148, a magnitude of the decoded
displacement component in the first evaluation direction is increased with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value are different.
The size of the evaluation block is determined in a unit which is also used for the displacement vector, e.g. pixels or quarter pixels or any other suitable unit. In the conditional done step 152, the exit condition can be that the encoded displacement component in the first evaluation direction is zero.
In a conditional repeat for 2nd evaluation direction step 142' it is determined whether the input displacement vector is also to be decoded in a second evaluation direction. If this is not the case, the method ends. On the other hand, if this is the case, the method returns to the read encoding indicator step 134, after which the steps 134, 143, 144, 146, 147, 148, 149, and 152 are performed for the second evaluation direction instead of the first evaluation direction. Looking now to the example of Fig 4A with reference to Fig 6B, an example of how the decoding method works will be described. This example corresponds to the encoding example above. Hence, the encoded displacement vector (edvx, edvy) from the bitstream is (-11, -19), which is to be decoded for the first block of samples 12. The decoder needs to keep track of three entities: the current scanning position (for label comparison), the encoded
displacement vector (for stop condition) and the decoded displacement vector (the resulting vector).
In step 140, the label value 'A' is obtained for the first block of samples 12. Alternatively, the label value is previously obtained from the bitstream in step 137. In step 142, the evaluation direction is selected as the first evaluation direction 17a, being a vertical direction (matching the first evaluation direction of the encoder). In step 134, the set vertical encoding indicator is read from the bitstream. Hence in step 143, it is determined that the vertical encoding indicator is set, whereby the method continues to step 144. In step 144, a decoded vertical displacement vector dvy is initialised to the encoded vertical displacement component, i.e. -19. The encoded vertical displacement vector edvy remains as the read value, i.e. -19.
In step 146, the first time this is performed, since the starting position is at the top-left sample of the first block and edvyis negative the evaluation block is the block above the first block 12, with label value Ά'. In step 147, it is determined that the labels are the same, whereby in step 149, the magnitude of edvy i decreased by 16, i.e. from -19 to -3. dvy is unmodified since the labels are the same. In step 152, the encoded vertical displacement component is not yet zero, so the method returns to step 146, for the evaluation block one block up from the current evaluation block.
In step 146 now, the evaluation block is the block two blocks above the first block 12, with label value 'B'. In step 147, it is determined that the labels differ, whereby in step 148, dvy is increased in magnitude by 16, i.e. from -19 to -35. In step 152, the encoded vertical displacement component is not yet zero, so the method returns to step 146, for the evaluation block one block up from the current evaluation block.
In step 146 now, the evaluation block is the block three blocks above the first block 12, with label value Ά'. In step 147, it is determined that the labels are the same, whereby in step 149, the magnitude of edvy is decreased by 3, i.e. from -3 to o. dvy is unmodified since the labels are the same. In step 152 the exit condition has now been met since the magnitude of edvy is zero, so the method proceeds to step 142'.
In step 142', it is determined that the horizontal component has not been analysed yet, so the method returns to step 134, now with the evaluation direction being the horizontal direction.
In step 134, the set horizontal encoding indicator is read from the bitstream. Hence in step 143, it is determined that the horizontal encoding indicator is set, whereby the method continues to step 144.
In step 144, a decoded horizontal displacement vector dvx is initialised to -11, the encoded horizontal displacement vector edvx . The encoded horizontal displacement vector edvx remains as the read value, i.e. -11.
In step 146, the evaluation block is the block three blocks above the first block 12, with label value Ά'. In step 147, it is determined that the labels are the same, whereby in step 149, the magnitude of edvx is decreased until it reaches the left border pixel but since it starts at the left border pixel no change is made. dvx is also unmodified. In step 152, the encoded horizontal
displacement component is not yet zero, so the method returns to step 146, for the evaluation block one block left from the current evaluation block. In step 146 now, the evaluation block is the block one block left of the block three blocks above the first block 12, with label value 'B'. In step 147, it is determined that the labels differ, whereby in step 148, dvx is increased in magnitude by 16, i.e. from -11 to -27. The magnitude of edvx is unmodified. In step 152, the encoded horizontal displacement component is not yet zero, so the method returns to step 146, for the evaluation block one block left from the current evaluation block.
In step 146 now, the evaluation block is the block two blocks left of the block three blocks above the first block 12, with label value Ά'. In step 147, it is determined that the labels are the same, whereby in step 149, the magnitude of edvx is decreased by 11, i.e. from -11 to -o. dvx is unmodified. In step 152, the exit condition has now been met since the magnitude of edvx is zero, so the method proceeds to step 142'.
In step 142', it is determined that both the vertical and the horizontal component have been analysed, so the method ends. The encoded
displacement vector (edvx, edvy) has now correctly been decoded to (-27, -35).
Here follows an example of how the method could be applied on top of HEVC. In this example the labelling is based on the compressed motion vector magnitude in the reference picture which is referenced by a specific displacement vector. The compressed motion is defined for each 16x16 region of a previously coded picture thus the labelling here is also performed on 16x16 blocks. Blocks with small motion magnitudes are given label o and other blocks are given label 1. Blocks that are intra coded are also given label 1. The first block is assumed to have label 1. Other labelling schemes and regions are also possible; this is just an example. First block is identical to prediction unit in HEVC vocabulary. An HEVC decoder modification example will now be described with reference to Fig 4B. Fig 4B is similar to Fig 4A, but here the predicted displacement vector 18 is illustrated.
On the decoder side the method is used when abs_mvd_minus2[o], the horizontal encoded displacement vector component in HEVC minus 2, or abs_mvd_minus2[i], the vertical encoded displacement vector component in HEVC minus 2, and corresponding encoding indicator is equal to 1 provided in the bitstream. Otherwise the HEVC method of deriving a decoded displacement vector component is used. Below we describe the approach for the derivation of the horizontal decoded displacement vector component which happens when the corresponding encoding indicator is set true otherwise the HEVC method of deriving a decoded displacement vector component is used.
The horizontal decoded displacement vector component dvx is initialized to the horizontal encoded displacement vector component edvx, which in HEVC is equal to, abs_mvd_greatero_flag[ o] *
( abs_mvd_minus2[ o] + 2 ) * ( 1 - 2 * mvd_sign_flag[ o ] ).
Since prediction of the displacement vector is used in HEVC the horizontal predicted displacement vector is added to dvx. The starting position for the evaluation is at a corresponding sample to the top-left sample of the first block 12, here the current prediction unit to be decoded, in the reference picture, after adding the predicted displacement vector 18.
Since the starting position can be anywhere inside a 16x16 block in the reference picture, the scanning first starts inside the 16x16 block until the left border of it is reached for leftwards evaluation direction or the right border is reached for rightwards evaluation direction.
If edvxis less than zero, the evaluation direction is leftwards and otherwise the evaluation direction is rightwards. If the label of the an evaluation block is different from the label of the first block, the magnitude dvx is increased by the number of samples, remaining until the border of the evaluation block is reached, multiplied by 4 since quarter pel accuracy is used for the displacement vector in HEVC. The horizontal encoded displacement vector component edvx is unmodified.
If the label of the an evaluation block is same as the label of the first block the magnitude of edvxis reduced by the number of samples remaining until the border of the evaluation block is reached, multiplied with 4 or until it is zero. The horizontal decoded displacement vector component dvx is unmodified. If the edvx is o the evaluation is exited otherwise it continues to the next block in the evaluation direction.
HEVC encoder modification example:
On the encoder side the encoded displacement vector and the input displacement vector are initialized to the difference between the desired displacement vector and the prediction displacement vector.
Here follows evaluation in the horizontal direction. First it is checked if the ending position in the reference picture after adding the horizontal component of the input displacement vector to the collocated sample of the top-left sample in the first block (in HEVC the current prediction unit) is at a block that has the same label as the first block. If this is the case the method can be used in the horizontal direction and an encoding indication for the horizontal direction is set to 1 otherwise it is set to zero. If the method cannot be used, the mvd (motion vector difference) coding parameters for the horizontal direction (greater than o flag, greater than 1 flag, mvd minus 2, sign flag) are set as normally for HEVC. If the method can be used in the horizontal direction it continues as follows.
The starting position for the evaluation is at a corresponding sample to the top-left sample of the first block 12, here first block 12 is the current prediction unit to be encoded, in the reference picture, after adding the predicted displacement vector.
If the horizontal component of the encoded displacement vector edvxis less than zero the evaluation direction is leftwards and otherwise the evaluation direction is rightwards.
If the label of the an evaluation block is different from the label of the first block the magnitude of edvxis decreased by the number of samples remaining until the border of the evaluation block is reached, multiplied with 4 since quarter pel accuracy is used in HEVC. The magnitude of the horizontal component of the input displacement vector dvx is decreased by the same amount.
If the label of the an evaluation block is same as the label of the first block the magnitude of the horizontal component of the input displacement vector dvx is reduced by the number of samples, remaining until the border of the evaluation block is reached, multiplied with 4, or until it is zero. The horizontal component of the encoded displacement vector component edvx is unmodified.
If the dvx is o the evaluation is exited otherwise it continues to the next block in the evaluation direction. The encoding indications (enable_label_mv_scanning) can be provided when the magnitude of the horizontal component of the encoded
displacement vector abs_mvd_minus2[o], is provided, or when the magnitude of the vertical component of the encoded displacement vector abs_mvd_minus2[o] is provided, e.g. in accordance with Table 1 where one example of how the syntax for HEVC mvd coding has been modified. : if( abs_mvd_greaterO_flag[ 0 ] ) {
if( abs_mvd_greaterl_flag[ 0 ] ){
abs_mvd_minus2[ 0 ] ae(v) enable label mv scanning [0] ae(v)
}
mvd sign _flag[ 0 ] ae(v)
}
if( abs_mvd_greaterO_flag[ 1 ] ) {
if( abs_mvd_greaterl_flag[ 1 ] ){
abs_mvd_minus2[ 1 ] ae(v) enable label mv scanning [1] ae(v)
}
mvd sign _flag[ 1 ] ae(v)
Table 1: Modified syntax for HEVC mvd coding
From above table it can be noted that the method is only used when at least one of the encoded displacement vector components is larger than 1 otherwise the HEVC method is used. Other thresholds could also be used, this is used an example.
It can also be noted that in one embodiment, instead of reducing an input displacement vector component until it reaches zero, the encoder modifies the corresponding position in the reference picture until it reaches the position that correspond to the horizontal component of the desired displacement vector component or if it's in a second direction until it reaches the position that corresponds to the top-left sample in the reference picture of the desired displacement vector.
Fig 7 is a schematic diagram showing functional modules of the encoder 1 of Fig 1 according to one embodiment. The modules are implemented using software instructions such as a computer program executing in the encoder 1. The modules correspond to the steps in the methods illustrated in Figs 5A-B.
An obtainer 70 is configured to perform the obtain 1st label value step 40 and the obtain 2nd label value step 46 of Figs 5A-B. A direction selector 72 is configured to perform the select evaluation direction step 42 of Figs 5A-B and the conditional repeat for 2nd evaluation direction step 142' of Fig 5B.
An initialiser 74 is configured to perform the initialise step 44 of Fig 5B. A comparator 77 is configured to perform the labels differ step 47 and the conditional last label match step 51 of Fig 5B.
A reducer 78 is configured to perform the decrease magnitude step 48 of Fig 5B.
An evaluator 80 is configured to perform the conditional done step 52 of Figs 5A-B.
An indicator setter 82 is configured to perform the set encoding indicator step 53 of Fig 5B.
A bitstream generator 84 is configured to perform the insert encoding indicator step 54, the insert displacement component step 56 and the insert label values step 57 of Fig 5B.
Fig 8 is a schematic diagram showing functional modules of the decoder 2 of Fig 1 according to one embodiment. The modules are implemented using software instructions such as a computer program executing in the decoder 2. The modules correspond to the steps in the methods illustrated in Figs 6A-B. An obtainer 170 is configured to perform the obtain 1st label value step 140 and the obtain 2nd label value step 146 of Figs 6A-B.
A direction selector 172 is configured to perform the select evaluation direction step 142 of Figs 6A-B and the conditional repeat for conditional 2nd evaluation direction step 142 of Fig 6B. An initialiser 174 is configured to perform the initialise step 144 of Fig 6B. A comparator 177 is configured to perform the labels differ step 147 of Figs 6A-B.
A reducer 178 is configured to perform the decrease magnitude step 149 of Fig 6B. An increaser 179 is configured to perform the increase magnitude step 148 of Fig 6B.
An evaluator 180 is configured to perform the conditional done step 152 of Figs 6A-B and the conditional encoding indicator set step 143 of Fig 6B.
An indicator reader 182 is configured to perform the read evaluation direction step 142 of Fig 6B.
A label reader 184 is configured to perform the read label values step 137 of Fig 6B.
Fig 9 is a schematic diagram showing some components of the encoder 1 of Fig 1. A processor 60 is provided using any combination of one or more of a suitable central processing unit (CPU), multiprocessor, microcontroller, digital signal processor (DSP), application specific integrated circuit etc., capable of executing software instructions 65 stored in a memory 64, which can thus be a computer program product. The processor 60 can be configured to execute the method described with reference to Figs 5A-B above. The memory 64 can be any combination of read and write memory (RAM) and read only memory (ROM). The memory 64 also comprises persistent storage, which, for example, can be any single one or combination of magnetic memory, optical memory, solid state memory or even remotely mounted memory. A data memory 66 is also provided for reading and/ or storing data during execution of software instructions in the processor 60. The data memory 66 can be any combination of read and write memory (RAM) and read only memory (ROM). The encoder l further comprises an I/O interface 62 for communicating with other external entities. Optionally, the I/O interface 62 also includes a user interface for local or remote access.
Other components of the encoder 1 are omitted in order not to obscure the concepts presented herein.
Fig 10 is a schematic diagram showing some components of the decoder 2 of Fig 1. A processor 160 is provided using any combination of one or more of a suitable central processing unit (CPU), multiprocessor, microcontroller, digital signal processor (DSP), application specific integrated circuit etc., capable of executing software instructions 165 stored in a memory 164, which can thus be a computer program product. The processor 160 can be configured to execute the method described with reference to Figs 6A-B above.
The memory 164 can be any combination of read and write memory (RAM) and read only memory (ROM). The memory 164 also comprises persistent storage, which, for example, can be any single one or combination of magnetic memory, optical memory, solid state memory or even remotely mounted memory.
A data memory 166 is also provided for reading and/or storing data during execution of software instructions in the processor 160. The data memory 166 can be any combination of read and write memory (RAM) and read only memory (ROM).
The decoder 2 further comprises an I/O interface 162 for communicating with other external entities. Optionally, the I/O interface 162 also includes a user interface for local or remote access.
Other components of the decoder 2 are omitted in order not to obscure the concepts presented herein.
Fig 11 shows one example of a computer program product comprising computer readable means. On this computer readable means a computer program 91 can be stored, which computer program can cause a processor to execute a method according to embodiments described herein. In this example, the computer program product is an optical disc, such as a CD (compact disc) or a DVD (digital versatile disc) or a Blu-Ray disc. As explained above, the computer program product could also be embodied in a memory of a device, such as the computer program product 64 of Fig 9 and/or the computer program product 164 of Fig 10. While the computer program 91 is here schematically shown as a track on the depicted optical disk, the computer program can be stored in any way which is suitable for the computer program product, such as a removable solid state memory, e.g. a Universal Serial Bus (USB) drive.
The invention has mainly been described above with reference to a few embodiments. However, as is readily appreciated by a person skilled in the art, other embodiments than the ones disclosed above are equally possible within the scope of the invention, as defined by the appended patent claims.

Claims

1. A method for encoding an input displacement vector (10) as part of encoding a first block of samples (12) of a video frame, the input
displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples (13), the method being performed in an encoder (1) and comprising the steps of:
obtaining (40) a first label value for the first block of samples (12), the first label value being based on at least one parameter related to the samples of the first block;
selecting (42) a first evaluation direction;
obtaining (46) a second label value for an evaluation block of samples (i4a-f) being located in the first evaluation direction in relation to the first block of samples (12), the second label value being based on at least one parameter related to the samples of the evaluation block;
comparing (47) the first label value and the second label value;
determining (50) the encoded displacement vector based on the comparison of the first label value and the second label value; and
repeating (52) the steps of obtaining (46) a second label value, comparing (47) and determining (50) for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
2. The method according to claim 1, further comprising the steps of:
initialising (44) an encoded displacement component in the first evaluation direction to the input displacement component in the first evaluation direction;
decreasing (48) a magnitude of the encoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value differ;
setting (53) an encoding indicator for the first evaluation direction when, and only when, the last second label value matches the first label value; wherein the step of repeating (50) comprises also repeating the step of decreasing for the subsequent block of samples in the first evaluation direction until the exit condition is fulfilled.
3. The method according to claim 2, wherein the step of initialising (44) comprises adjusting the encoded displacement component by a prediction displacement component, in the first evaluation direction; and
wherein when the first time the step of obtaining (46) a second label value is performed, the evaluation block is displaced from the first block of samples by the prediction displacement vector.
4. The method according to claim 2 or 3, wherein in the step of obtaining (46) the second label value, a starting position for an evaluation in a second direction is from the position of the first block displaced by the input displacement component in the first evaluation direction.
5. The method according to any one of the preceding claims, wherein the exit condition is that an evaluation block, corresponding to the input displacement component in the evaluation direction, is reached.
6. The method according to any one of the preceding claims, wherein the first direction is a horizontal direction and the second direction is a vertical direction, or vice versa.
7. The method according to any one of claims 2 to 6, further comprising the steps of:
selecting (42') a second evaluation direction; and
performing the steps of initialising (44), obtaining (46) a second label value, decreasing (48), repeating (50) and setting (53) for the second evaluation direction instead of the first evaluation direction.
8. The method according to any one of the preceding claims, wherein the video frame of the first block of samples and the video frame of the second block of samples is the same.
9. The method according to any one of claims 1 to 7, wherein the video frame of the first block of samples and the video frame of the second block of samples differ, and wherein when the first time the step of obtaining (46) a second label value is performed, the evaluation block is in a position corresponding to the first block of samples (12).
10. The method according to any one of claims 2 to 9, wherein in the step of decreasing (48), the size of the evaluation block is determined in a unit which is also used for the input displacement vector.
11. The method according to any one of the preceding claims, wherein in the step of obtaining (40) a first label value and obtaining (46) a second label value, the label values are based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters to be provided in the bitstream.
12. The method according to any one of the preceding claims, further comprising the step of:
inserting (54) the encoding indicator for at least one of the first direction and the encoding indicator for the second direction in an encoded bitstream.
13. The method according to any one of the preceding claims, further comprising the step of:
inserting (56) an encoded displacement components for the first and second directions in an encoded bitstream, when and only when an encoding indicator for the respective evaluation direction is set.
14. The method according to any one of the preceding claims, further comprising the step of:
inserting (57) a label value for each block in the video frame of the first block of samples in an encoded bitstream.
15. An encoder (1) for encoding an input displacement vector (10) as part of encoding a first block of samples (12) of a video frame, the input
displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples (13), the encoder (1) comprising:
a processor (60); and
a memory (64) storing instructions (66) that, when executed by the processor, causes the encoder (1) to:
obtain a first label value for the first block of samples (12), the first label value being based on at least one parameter related to the samples of the first block;
select a first evaluation direction;
obtain a second label value for an evaluation block of samples (i4a-f) being located in the first evaluation direction in relation to the first block of samples (12), the second label value being based on at least one parameter related to the samples of the evaluation block;
compare the first label value and the second label value;
determine the encoded displacement vector based on the comparison of the first label value and the second label value; and
repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
16. An encoder (1) comprising:
means for obtaining a first label value for a first block of samples (12), the first label value being based on at least one parameter related to the samples of a first block, the first label value being used for encoding an input displacement vector (10) as part of encoding the first block of samples (12) of a video frame, the input displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples (13); means for selecting a first evaluation direction;
means for obtaining a second label value for an evaluation block of samples (i4a-f) being located in the first evaluation direction in relation to the first block of samples (12), the second label value being based on at least one parameter related to the samples of the evaluation block;
means for comparing the first label value and the second label value; means for determining the encoded displacement vector based on the comparison of the first label value and the second label value; and
means for repeating the obtaining a second label value, comparing and determining for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
17. A computer program (91) for encoding an input displacement vector (10) as part of encoding a first block of samples (12) of a video frame, the input displacement vector comprising a first input displacement component in a first direction and a second input displacement component in a second direction, the input displacement vector indicating a reference to a previously encoded second block of samples (13), the computer program comprising computer program code which, when run on an encoder (1) causes the encoder (1) to:
obtain a first label value for the first block of samples (12), the first label value being based on at least one parameter related to the samples of the first block;
select a first evaluation direction;
obtain a second label value for an evaluation block of samples (i4a-f) being located in the first evaluation direction in relation to the first block of samples (12), the second label value being based on at least one parameter related to the samples of the evaluation block;
compare the first label value and the second label value;
determine the encoded displacement vector based on the comparison of the first label value and the second label value; and
repeat the obtaining a second label value, comparing and determining (50) for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
18. A computer program product (90) comprising a computer program according to claim 17 and a computer readable means on which the computer program is stored.
19. A method for determining a decoded displacement vector (10) from an encoded displacement vector as part of decoding a first block of samples (12) of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples (13), the method being performed in an decoder (2) and comprising the steps of:
obtaining (140) a first label value for the first block of samples (12), the first label value being based on at least one parameter related to the samples of the first block;
selecting (142) a first evaluation direction;
obtaining (146) a second label value for an evaluation block of samples (i4a-f) in the first evaluation direction in relation to the first block of samples (12), the second label value being based on at least one parameter related to the samples of the evaluation block;
comparing (147) the first label value and the second label value;
determining (150) the decoded displacement vector based on the comparison of the first label value and the second label value; and
repeating (152) the steps of obtaining (146) a second label value, comparing (147) and determining (150) for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
20. The method according to claim 19, further comprising the steps of: initialising (144) a decoded displacement vector in the first evaluation direction to the encoded displacement vector in the first evaluation direction; increasing (148) a magnitude of the decoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value differ;
decreasing (149) a magnitude of the encoded displacement component in the first evaluation direction with the size of the evaluation block in the first evaluation direction when, and only when, the first label value and the second label value are equal;
wherein the step of repeating (152) comprises also repeating the steps of increasing (148) and decreasing (149) for the subsequent block of samples in the first evaluation direction until the exit condition is fulfilled; and
the steps of initialising, obtaining the second label value, increasing, decreasing and repeating are only performed for a particular first evaluation direction when an encoding indicator for the first evaluation direction is set
21. The method according to claim 20, wherein the exit condition is that the magnitude of the encoded displacement component in the first evaluation direction has reached zero.
22. The method according to claim 21, wherein in the step of initialising (144), comprises adjusting the decode displacement component by a prediction displacement component, in the first evaluation direction; and wherein when the first time the step of obtaining (146) a second label value is performed, the evaluation block is displaced from the first block of samples by the prediction displacement vector.
23. The method according to any one of claims 19 to 22, wherein the first direction is a horizontal direction and the second direction is a vertical direction, or vice versa.
24. The method according to any one of claims 20 to 23, further comprising the steps of:
selecting (142') a second evaluation direction; and
performing the steps of initialising (144), obtaining (146) a second label value, comparing (147), increasing (148), decreasing (149), determining (150), and repeating (152) for the second evaluation direction instead of the first evaluation direction.
25. The method according to any one of claims 19 to 24, wherein the video frame of the first block of samples and the video frame of the second block of samples is the same.
26. The method according to any one of claims 19 to 24, wherein the video frame of the first block of samples and the video frame of the second block of samples differ.
27. The method according to any one of claims 19 to 26, wherein in the steps of increasing (148) and decreasing (149), the size of the evaluation block is determined in a unit which is also used for the displacement vector.
28. The method according to any one of claims 19 to 27, wherein in the step of obtaining (140) a first label value and obtaining (146) a second label value, the label values are based on any one or more of colours of block samples, luminance of block samples, depth layer of block samples, spatial frequencies of block samples and one or several other label values or coding parameters provided in the bitstream.
29. The method according to any one of claims 19 to 28, further comprising the step of:
reading (134) the encoding indicator for the first direction and/ or the encoding indicator for the second direction from an encoded bitstream.
30. The method according to any one of claim 19 to 29, further comprising the step of:
reading (137) label values for at least one block in the video frame of the first block of samples from an encoded bitstream.
31. A decoder (2) for determining a decoded displacement vector (10) from an encoded displacement vector as part of decoding a first block of samples (12) of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples (13), the decoder comprising:
a processor (60); and
a memory (64) storing instructions (66) that, when executed by the processor, causes the decoder (2) to:
obtain a first label value for the first block of samples (12), the first label value being based on at least one parameter related to the samples of the first block;
selecting a first evaluation direction;
obtain a second label value for an evaluation block of samples (i4a-f) in the first evaluation direction in relation to the first block of samples (12), the second label value being based on at least one parameter related to the samples of the evaluation block;
compare the first label value and the second label value;
determine the decoded displacement vector based on the comparison of the first label value and the second label value; and
repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
32. A decoder comprising :
means for obtaining (140) a first label value for a first block of samples (12), the first label value being based on at least one parameter related to samples of the first block, for determining a decoded displacement vector (10) from an encoded displacement vector as part of decoding the first block of samples (12) of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples (13);
means for selecting (142) a first evaluation direction;
means for obtaining (146) a second label value for an evaluation block of samples (i4a-f) in the first evaluation direction in relation to the first block of samples (12), the second label value being based on at least one parameter related to the samples of the evaluation block;
means for comparing (147) the first label value and the second label value;
means for determining (150) the decoded displacement vector based on the comparison of the first label value and the second label value; and
means for repeating (152) the obtaining (146) a second label value, comparing (147) and determining (150) for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
33. A computer program (91) for determining a decoded displacement vector (10) from an encoded displacement vector as part of decoding a first block of samples (12) of a video frame, the decoded displacement vector comprising at least one of a first decoded displacement component in a first direction and a second decoded displacement component in a second direction, the decoded displacement vector indicating a reference to a previously decoded second block of samples (13), the computer program comprising computer program code which, when run on a decoder (2) causes the decoder (2) to:
obtain a first label value for the first block of samples (12), the first label value being based on at least one parameter related to the samples of the first block;
selecting a first evaluation direction;
obtain a second label value for an evaluation block of samples (i4a-f) in the first evaluation direction in relation to the first block of samples (12), the second label value being based on at least one parameter related to the samples of the evaluation block;
compare the first label value and the second label value;
determine the decoded displacement vector based on the comparison of the first label value and the second label value; and
repeat the instructions to obtain a second label value, compare and determine for a subsequent block of samples in the first evaluation direction until an exit condition is fulfilled.
34. A computer program product (90) comprising a computer program according to claim 33 and a computer readable means on which the computer program is stored.
PCT/SE2015/050327 2015-03-19 2015-03-19 Encoding and decoding an displacement vector WO2016148620A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/SE2015/050327 WO2016148620A1 (en) 2015-03-19 2015-03-19 Encoding and decoding an displacement vector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/SE2015/050327 WO2016148620A1 (en) 2015-03-19 2015-03-19 Encoding and decoding an displacement vector

Publications (1)

Publication Number Publication Date
WO2016148620A1 true WO2016148620A1 (en) 2016-09-22

Family

ID=52875207

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/SE2015/050327 WO2016148620A1 (en) 2015-03-19 2015-03-19 Encoding and decoding an displacement vector

Country Status (1)

Country Link
WO (1) WO2016148620A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040114688A1 (en) * 2002-12-09 2004-06-17 Samsung Electronics Co., Ltd. Device for and method of estimating motion in video encoder
WO2014205339A2 (en) * 2013-06-21 2014-12-24 Qualcomm Incorporated Intra prediction from a predictive block

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040114688A1 (en) * 2002-12-09 2004-06-17 Samsung Electronics Co., Ltd. Device for and method of estimating motion in video encoder
WO2014205339A2 (en) * 2013-06-21 2014-12-24 Qualcomm Incorporated Intra prediction from a predictive block

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
BOYKOV Y ET AL: "Fast approximate energy minimization via graph cuts", IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, IEEE COMPUTER SOCIETY, USA, vol. 23, no. 11, 1 November 2001 (2001-11-01), pages 1222 - 1239, XP011093916, ISSN: 0162-8828, DOI: 10.1109/34.969114 *
LAROCHE G ET AL: "AHG5: Vector prediction for Intra Block Copy", 15. JCT-VC MEETING; 23-10-2013 - 1-11-2013; GENEVA; (JOINT COLLABORATIVE TEAM ON VIDEO CODING OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ); URL: HTTP://WFTP3.ITU.INT/AV-ARCH/JCTVC-SITE/,, no. JCTVC-O0122-v2, 23 October 2013 (2013-10-23), XP030115125 *
S-T HSIANG ET AL: "SCCE1: Test 3.5 - Block vector difference coding", 18. JCT-VC MEETING; 30-6-2014 - 9-7-2014; SAPPORO; (JOINT COLLABORATIVE TEAM ON VIDEO CODING OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ); URL: HTTP://WFTP3.ITU.INT/AV-ARCH/JCTVC-SITE/,, no. JCTVC-R0133-v2, 1 July 2014 (2014-07-01), XP030116402 *
TREETASANATAVORN UNIV OF ERLANGEN-NUREMBERG (GERMANY) S ET AL: "Model based segmentation of motion fields in compressed video sequences using partition projection and relaxation", VISUAL COMMUNICATIONS AND IMAGE PROCESSING; 12-7-2005 - 15-7-2005; BEIJING,, 12 July 2005 (2005-07-12), XP030080848 *

Similar Documents

Publication Publication Date Title
US11388440B2 (en) Method and apparatus for a low complexity transform unit partitioning structure for HEVC
US11677983B2 (en) Methods and apparatus for improved entropy encoding and decoding
US10750169B2 (en) Method and apparatus for intra chroma coding in image and video coding
KR101538837B1 (en) Multiple sign bit hiding within a transform unit
US20160309196A1 (en) Method of coding and decoding imageds, coding and decoding device, and computer programs corresponding there to
US9609344B2 (en) Coding and decoding images with sign data hiding
KR102114641B1 (en) Method of video coding by prediction of the partitioning of a current block, method of decoding, coding and decoding devices and computer programs corresponding thereto
US10547872B2 (en) Encoding device, decoding device, and encoding method and decoding method thereof
US20130195200A1 (en) Methods and devices for context modeling to enable modular processing
US10178405B2 (en) Enhanced coding and decoding using intra block copy mode
CN114009015A (en) Transmission encoding technique for converting omitted blocks
KR102267770B1 (en) Method and device for determining a set of modifiable elements in a group of pictures
WO2015008417A1 (en) Video coding device, video decoding device, video coding method, video decoding method, and program
KR20150024857A (en) Method for encoding a current block of a first image component relative to a reference block of at least one second image component, encoding device and corresponding computer program
US20130235940A1 (en) Methods and devices for context modeling to enable modular processing
CA2801095C (en) Methods and devices for context modeling to enable modular processing
JP7194539B2 (en) Encoding device, decoding device and program
WO2016148620A1 (en) Encoding and decoding an displacement vector
JP6421426B2 (en) Encoding method conversion apparatus and program
CN109672889A (en) The method and device of the sequence data head of constraint
RU2782400C2 (en) Method of encoding and decoding images, device for encoding and decoding and corresponding software
JP4847423B2 (en) Moving picture encoding apparatus and computer program
KR20240049359A (en) History-based Rice parameter derivation for wavefront parallel processing in video coding.
KR20160059512A (en) Method and apparatus for decision of initial block vector search point and search range of intra block copy in video encoder

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15716598

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15716598

Country of ref document: EP

Kind code of ref document: A1