GB2521117A - Method of encoding or decoding a video frame - Google Patents

Method of encoding or decoding a video frame Download PDF

Info

Publication number
GB2521117A
GB2521117A GB1318867.7A GB201318867A GB2521117A GB 2521117 A GB2521117 A GB 2521117A GB 201318867 A GB201318867 A GB 201318867A GB 2521117 A GB2521117 A GB 2521117A
Authority
GB
United Kingdom
Prior art keywords
coding unit
macroblocks
encoding
sub coding
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
GB1318867.7A
Other versions
GB2521117B (en
GB201318867D0 (en
Inventor
St Phane Baron
Romain Guignard
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to GB1318867.7A priority Critical patent/GB2521117B/en
Publication of GB201318867D0 publication Critical patent/GB201318867D0/en
Publication of GB2521117A publication Critical patent/GB2521117A/en
Application granted granted Critical
Publication of GB2521117B publication Critical patent/GB2521117B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/174Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a slice, e.g. a line of blocks or a group of blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes

Landscapes

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

Abstract

The invention relates to a method of encoding an image (for example intra-frame encoding) comprising a coding unit using spatial prediction on macroblocks of pixels. The coding unit comprising a plurality of lines of macroblocks of pixels Slice 1, Slice 2, Slice N . Sub coding units of macroblocks of pixels B1, B2...Bn are defined in said coding unit. Each defined sub coding unit belongs to a single line of macroblocks of pixels. An encoding configuration is defined for each defined sub coding unit, wherein the encoding configuration comprises a scanning direction for example a raster scan, that may be based on a criterion of the expected compression or a property of at least one macroblock in the sub coding unit. The sub coding units are encoded by applying spatial predictions based on the determined encoding configurations. Also disclosed is a method and device for decoding said encoded image and a computer program and storage means for carrying out the said encoding.

Description

Method of encoding or decoding a video frame
FIELD OF THE INVENTION
The invention relates to the field of live video streaming and more particularly to a scheme for determining a scanning direction for encoding and decoding blocks of pixels of an image in an encoder or a decoder adapted to low latency video streaming.
BACKGROUND OF THE INVENTION
Low latency video streaming is a growing trend in the field of the wireless transmission Due to the constant increase of the video definition, the streaming of a video requires increasing resources in terms of memory, computation (CPU) power, bandwidth etc. To solve the problem of the increasing needs in terms of bandwidth, codec technologies such as H,264/AVC (called H.264 in the following) or HEVC for instance, provide powerful means to reduce the required bandwidth while keeping a good level of quality. However, attempting to embed these codec technologies in light portable devices, such as phones or cameras, is not straightforward.
High CPU power is required to perform the coding of a video and there is a corresponding penalty on battery life.
There is also a high memory requirement. The H.264 and HEVC codecs for instance, generally require storing several images in memory in order to perform efficient prediction. In case of high definition images, the amount of memory required, especially high speed memory, is significant.
To cope with these issues, a new generation of codecs, adapted to low resource consumption, has arisen. These codecs only consider intra frame prediction, i.e. without any reference to another frame, making it possible to store in memory only a reduced part of one image corresponding to a given number of lines of pixels, and thus to reduce the encoding process complexity.
Many video codecs divide each video frame into a given number of parts called slices. A slice is a coding unit that can be decoded without any reference to data of any other slice of the same frame. In an intra-only video codec (such as the H.264 intra), each slice is therefore encoded without any reference to a previous slice, or frame since no inter frame prediction is used. Although an inter frame prediction coding would be a very powerful tool in order to increase the compression rate, it would have a negative effect on error propagation in case of losses (packet losses or bit errors). Indeed, not only the image parts directly related to the lost data are lost but also parts predicted directly or indirectly from this lost part. Slice based intra codecs also have the advantage of reducing the required memory, since it is not necessary to store previous slice data to encode or decode the current ones.
In order to finely adapt the throughput of a slice based intra codec to unpredictable wireless conditions while keeping a constant image quality, a rate control may be used to dynamically adapt the size of each slice, The size may be given in number of macroblocks.
Slices can have different shapes, from a shape corresponding to a complete line of consecutive macroblocks in an image to a random shape with slice covering a plurality of lines of macroblocks and with non-consecutive macroblocks. When the rate control of a video codec dynamically adapts the size of each slice of a given frame to a given rate, the slices may not be aligned with lines of macroblocks. Figure 3 illustrates the difference between a slice based Intra codec with constant slice size aligned on lines of macroblocks and a slice based Intra codec with adaptive slice size. As can be seen in frame 300, slices 51 (310), 52 (320), 53, 54, ..., Sn correspond to lines of macroblocks and are therefore made of a fixed number of macroblocks. Frame 350 shows a case in which the slices Si (360), S2 (370), S3, .., Sn are not aligned with lines of macroblocks and may cover several lines of macroblocks. In frame 350, the number of macroblocks could be different for each slice.
Arrows in dashed lines in this figure show the scanning scheme applied for encoding (and decoding) the macroblocks in a frame. The scanning scheme is generally fixed by the compression standard and determines in which order the macroblocks must be encoded and decoded. Fixing an encoding and a decoding order in a video codec is particularly important since the coder and the decoder have to apply symmetric processes to avoid any decoding drift. In the video compression domain, "symmetric" means that all reconstructed data used for spatial and temporal prediction in the encoder and the decoder are rigorously identical. Since in video codec, macroblocks are encoded predictively, applying the same scanning scheme on the encoder and the decoder contributes to insure that a predicted macroblock use the same predictor as reference for its prediction at the encoder and the decoder. In Figure 3 a conventional scanning scheme known as raster scan is described. In this scanning scheme macroblocks are sequentially scanned from left to right and from top to bottom. The first scanned element is therefore the element situated in the upper left corner, and then the first upper line is read from left to right. At the end of the line, the second line is read starting with the first left element, and so on until the last element in the lower right corner of the frame.
This scan is similar to the one used when reading a book page written with a Latin alphabet.
Other scanning schemes have been proposed in the literature generally to improve the compression efficiency, We can mention for instance the "spiral scan" scanning scheme wherein the scanning is performed in spiral starting from the center of a region to encode. This scheme is particularly adapted to frames including regions of interest (ROT) but in general it does not provide any improvement when applied to a region covering partially one or two lines of macroblocks. In addition, we can note that the spiral scan is generally combined with the use of the FMO (Flexible Macroblock Ordering) functionality of H.264 which requires the transmission of information representing the slice position for each ROT slice, which decreases further the compression performances. A slice based intra codec encodes each macroblock by computing the difference between the current macroblock, and a predictor macroblock obtained from reconstructed pixels of already encoded macroblocks in the neighborhood of the macroblock to encode when available. The more similar the two macroblocks are, the more efficient the compression is. The H.264 and HEVC standards propose several prediction directions allowing determining predictor macroblocks from reconstructed pixels at the external boundary of the macroblock to encode. For instance, H.264 proposes 9 prediction directions for the 4x4 blocks (8 directions, plus a DC prediction mode using an average predictor macroblock) and 4 for the 16x16 blocks (3 directions, plus the DC predictor mode). An encoder then selects in this set of predictors, the predictor optimizing a rate distortion criterion. If no reconstructed pixels can be found at the external boundary of the macroblock to encode, the predictor macroblock is a DC predictor macroblock computed with default values. Thus, the first macroblock in raster scan order of an Intra slice is necessarily encoded with the DC prediction mode based on the default DC predictor. However, using the DC predictor macroblock as predictor can have a negative effect on the compression rate since the difference between the DC predictor block and the content of the current macroblock to encode may be important. A macroblock encoded using the default DC predictor macroblock has a high probability to be close to a macroblock encoded without prediction.
Slice based Intra codec using the traditional raster scan scanning scheme and in which slices are not aligned with lines of macroblocks would increase the number of macroblocks having no reconstructed pixels available in their neighborhood. Consequently the number of DC predicted macroblocks using the default DC predictor would increase leading to a decrease of the compression efficiency. This issue is illustrated for instance in the figure 4. It can be observed that the macroblock Bm 443 belonging to slice#N 440 will be encoded using a DC prediction based on the default DC predictor since the macroblock Bm 443 has no surrounding macroblock belonging to the slice N 440, and consequently, no reconstructed pixels at its external boundary. As a consequence, when encoding the slice#N 440, a loss of coding efficiency will occur when encoding the block Bm 443. Indeed, for this slice, two DC predicted macroblocks are encoded while only one is needed for slices aligned on lines of macroblocks. Such loss of efficiency will appear in all slices that are not aligned with a line of macroblocks of a frame.
As can be seen above, slice based Intra codec with adaptive slice size may introduce a coding efficiency issue when slices are not aligned on lines of macroblocks.
SUMMARY OF THE INVENTION
The present invention has been devised to address one or more of the foregoing concerns. In particular, embodiments of the present invention aim to address the above mentioned problems by providing a scanning scheme reducing the loss of encoding efflciency faced by line based Intra codec when using dynamic slice size rate control.
According to a first aspect, the invention provides a method of encoding an image comprising a coding unit using spatial prediction on macroblocks of pixels, the coding unit comprising a plurality of lines of macroblocks of pixels, the method comprising defining sub coding units of macroblocks of pixels in said coding unit, wherein each defined sub coding unit belongs to a single line of macroblocks of pixels, determining an encoding configuration for each defined sub coding unit of macroblocks, wherein the encoding configuration comprises a scanning direction, and encoding the sub coding units of the coding unit by applying spatial predictions based on the determined encoding configurations. Determining the encoding configuration at the level of the sub coding unit and in particular at the level of a sub-slice allows adjusting with more accuracy the encoding configurations. The scanning direction is one of the encoding configurations making it possible increasing to probability of a macroblock to be efficiently predicted by a spatial prediction.
In an embodiment the encoding configuration comprises also the location in the horizontal direction of the image of the sub coding unit. The location in the horizontal direction of the image of the sub coding unit is a second important parameter making it possible to increase the probability of a macroblock to be efficiently predicted by a spatial predictor.
In an embodiment the scanning direction of a sub coding unit is selected in a set of predefined scanning directions. This feature allows reducing the complexity of the method in the determination of the encoding configurations and to reduce the encoding cost of said encoding configurations in terms of bitrate.
In an embodiment the scanning direction of the first sub coding unit of the coding unit is fixed to one predefined scanning direction. This feature allows reducing more the complexity of the method and avoids encoding in the slice bitstream the encoding configurations of the first subslice, In an embodiment the scanning direction of the first sub coding unit of the coding unit is determined randomly in the set of predefined scanning directions.
This embodiment allows increase the diversity of the scanning directions and as a consequence avoids avoiding systematically a same direction providing low coding efficiency.
In an embodiment the scanning direction of a sub coding unit of the coding unit is selected in the set of predefined scanning directions in function of the number of the line of macroblocks to which the sub coding unit belongs. This feature allows avoiding encoding the encoding configuration in the slice bitstream and limits therefore loss in the coding efficiency due the encoding configurations encoding.
In an embodiment the scanning direction of a sub coding unit of the coding unit depends on at least one criterion representative of the expected compression performance of the sub coding unit. As a consequence the method allows determining the best encoding configurations providing the best encoding performances.
In an embodiment the at least one criterion comprises a property of at least one macroblock in the sub coding unit. Studying the properties of only one macroblock of the sub coding unit allows reducing the complexity of the method while taking account some properties of the sub coding unit.
In an embodiment the property is the position in the image and/or the complexity of at least one macroblock in the sub coding unit.
In an embodiment the at least one criterion is the availability of spatial predictors for predicting macroblocks of the sub coding unit. This embodiment allows adjusting the encoding parameters to the availability of predictors and consequently to increase the compression efficiency.
In an embodiment the scanning direction determined for the sub coding unit of the coding unit is the one maximising the number of available spatial predictors. Accordingly the more there is available spatial predictors the more the probability of finding a good spatial predictor is high.
In an embodiment the scanning direction of a sub coding unit of a coding unit depends of the scanning direction of another sub coding unit of the same coding unit. Consequently a decoder applying the invention could infer the encoding parameters of one sub coding unit from another sub coding unit without requiring the encoding parameters to be encoded in the coding unit bitstream.
In an embodiment the scanning direction of a sub coding unit depends on the sub coding unit location in the line of macroblocks to which the sub coding unit belongs. Consequently a decoder applying the invention could infer the encoding parameters of one sub coding unit from said location without requiring the encoding parameters to be encoded in the coding unit bitstream.
In an embodiment the location of the sub coding unit of macroblocks in the line of macroblocks to which the coding unit belongs is selected in a set of a predefined locations. Again, this feature allows reducing the complexity of the method by reducing the search space of the locations.
In an embodiment the location of the sub coding unit of macroblocks in the line of macroblocks to which the sub coding unit belongs is fixed to a predefined location. Again, this feature allows reducing the complexity of the method by avoiding any search for the first sub coding unit.
In an embodiment the location of the sub coding unit of macroblocks in the line of macroblocks to which the sub coding unit belongs depends on the location of another sub coding unit sharing the same line of macroblocks.
Consequently a decoder applying the invention could infer the encoding parameters of one sub coding unit from said location without requiring the encoding parameters to be encoded in the coding unit bitstream.
In an embodiment the location of the sub coding unit of macroblocks in the line of macroblocks to which the sub coding unit belongs depends on the availability of pixels allowing generating spatial predictors for the macroblocks of said sub coding unit. Insuring the availability of pixels able to generate spatial predictors is a key point to improve the coding efficiency.
In an embodiment the location of the sub coding unit of macroblocks in the line of macroblocks to which the sub coding unit belongs is determined as the one maximizing the number of pixels allowing generating spatial predictors.
Maximizing the number of pixels allowing generating spatial predictors allows increasing the number of predictors and therefore to improve the coding efficiency.
In an embodiment several different encoding configurations are tested and the one providing the best compression performance is selected for encoding the sub coding unit. Testing several encoding configurations allows improving the determination of the encoding configuration providing the best compression efficiency.
In an embodiment the number of tested encoding configurations depends on the actual compression performance of already tested encoding configurations.
This feature allows reducing the complexity of the method of determining the best encoding configuration by allowing stopping the search when a sufficiently sufficient encoding configuration is found.
In an embodiment the number of tested encoding configurations depends on a time remaining before a transmission on a network of the coding unit.
Consequently, it is insured that the best possible configuration is determined without slowing down the transmission of the coding unit on the network.
In an embodiment a syntax element representing the determined encoding configurations is encoded in the image bitstream. This syntax element allows determining the encoding configuration determined by the encoder and therefore determining how decoding the coding unit.
In an embodiment the syntax element is encoded in the coding unit header.
This embodiment allows the decoder retrieving efficiently the syntax element. In addition a decoder not applying the invention can ignore rapidly a coding unit comprising this syntax element.
In a second aspect, the invention provides a method of decoding a bitstream portion representing a coding unit of an image, pixels of macroblocks of pixels of said coding unit having been spatially predicted, said coding unit comprising a plurality of sub coding units, a sub coding unit being a portion of a coding unit belonging to a single line of macroblocks of the image, the method comprising for the coding unit: * obtaining information representative of an encoding configuration for each sub coding unit of the coding unit, wherein the encoding configuration comprises a scanning direction, * decoding the coding unit by applying spatial predictions to the macroblocks of each sub coding unit depending on the obtained information representative of the encoding configuration.
This aspect allows a decoder receiving bitstream portion representing coding units with improved coding efficiency and to recognize the specific encoding parameters of these coding units.
In an embodiment the encoding configuration comprises also a location in the horizontal direction of the image of the sub coding unit. Accordingly a second important encoding parameter is obtained from the bitstream of the coding unit.
In an embodiment the encoding configuration is obtained from a syntax element associated with the bitstream portion. Providing encoding configurations in a syntax element allows decoders applying the invention retrieving efficiently the encoding parameters of coding units.
In an embodiment the encoding configuration is inferred from information representative of the location of the sub coding unit in the image. Consequently, no encoding parameters are encoded in the bitstream and the encoding cost of each coding unit is reduced in terms of bitrate.
In an embodiment the encoding configuration is inferred from the encoding information of another sub coding unit in the same coding unit. Consequently, no encoding parameters are encoded in the bitstream for said sub coding unit and the encoding cost of each coding unit is reduced in terms of bitrate.
In an embodiment the encoding configuration is inferred from the encoding information of another coding unit sharing the same line of macroblocks.
Consequently, no encoding parameters are encoded in the bitstream for said sub coding unit and the encoding cost of each coding unit is reduced in terms of bitrate, In a third aspect, the invention provides device for encoding an image comprising a coding unit using spatial prediction on macroblocks of pixels, the coding unit comprising a plurality of lines of macroblocks of pixels, the device comprising a module able to handle coding units belonging to a plurality of lines of macroblocks of pixels said module comprising a module for defining sub coding units of macroblocks of pixels in a coding unit, wherein each defined sub coding unit belongs to a single line of macroblocks of pixels, a module for determining an encoding configuration for each defined sub coding unit of macroblocks, wherein the encoding configuration comprises a scanning direction and a module for encoding the sub coding units of the coding unit by applying spatial predictions based on the determined encoding configurations.
In an embodiment the encoding configuration comprises also a location in the horizontal direction of the image of the sub coding unit.
In an embodiment the scanning direction of a sub coding unit determined by the module for determining en encoding configuration is selected in a set of predefined scanning directions, In an embodiment the scanning direction of the first sub coding unit of the coding unit is fixed to one predefined scanning direction.
In an embodiment the scanning direction of the first sub coding unit of the coding unit is determined randomly by the module for determining an encoding configuration in the set of predefined scanning directions.
In an embodiment the scanning direction of a sub coding unit of the coding unit is selected by the module for determining an encoding configuration in the set of predefined scanning directions in function of the number of the line of macroblocks to which the sub coding unit belongs.
In an embodiment the scanning direction of a sub coding unit of the coding unit depends on at least one criterion representative of the expected compression performance of the sub coding unit.
In an embodiment the at least one criterion comprises a property of at least one macroblock in the sub coding unit.
In an embodiment the property is the position in the image and/or the complexity of at least one macroblock in the sub coding unit.
In an embodiment the at least one criterion is the availability of spatial predictors for predicting macroblocks of the sub coding unit.
In an embodiment the scanning direction determined by the module for determining an encoding configuration for the sub coding of the coding unit is the one maximising the number of available spatial predictors.
In an embodiment the scanning direction of a sub coding of a coding unit depends of the scanning direction of another sub coding unit of the same coding unit.
In an embodiment the scanning direction of a sub coding unit depends on the sub coding unit location in the line of macroblocks to which it belongs.
In an embodiment the location of the sub coding unit of macroblocks in the lines of macroblocks it belongs to is selected by the module for determining an encoding configuration in a set of predefined locations.
In an embodiment the location of the sub coding unit of macroblocks in the lines of macroblocks to which it belongs is fixed to a predefined location.
In an embodiment the location of the sub coding unit of macroblocks in the lines of macroblocks to which it belongs depends on the location of another sub coding unit sharing the same line of macroblocks.
In an embodiment the location of the sub coding unit of macroblocks in the lines of macroblocks to which it belongs depends on the availability of pixels allowing generating spatial predictors for the macroblocks of said sub coding unit.
In an embodiment the location of the sub coding unit of macroblocks in the lines of macroblocks to which it belongs is determined as the one maximizing the number of pixels allowing generating spatial predictors.
In an embodiment several different encoding configurations are tested by the module for determining an encoding configuration and the one providing the best compression performance is selected for encoding the sub coding unit.
In an embodiment the number of tested encoding configurations depends on the actual compression performance of already tested encoding configurations.
In an embodiment the number of tested encoding configurations depends on a time remaining before a transmission on a network of the coding unit.
In an embodiment a syntax element representing the determined encoding configurations is encoded in the image bitstream by the module for encoding the coding unit.
In an embodiment the syntax element is encoded in the coding unit header.
In a fourth aspect, the invention provides a device for decoding a bitstream portion representing a coding unit of an image, pixels of macroblocks of pixels of said coding unit having spatially predicted, said coding unit comprising a plurality of sub coding units, a sub coding unit being a portion of a coding unit belonging to one line of macroblocks of the image, the device for decoding comprising a module for obtaining information representative of an encoding configuration for each sub coding unit of the coding unit, wherein the encoding configuration comprises a scanning direction and a module for decoding the coding unit by applying spatial predictions in each sub coding unit depending on the obtained information representative of the encoding configuration.
In an embodiment the encoding configuration comprises also a location in the horizontal direction of the image of the sub coding unit.
In an embodiment the encoding configuration is obtained from a syntax element associated with the bitstream portion.
In an embodiment the encoding configuration is inferred from information representative of the location of the sub coding unit in the image.
In an embodiment the encoding configuration is inferred from the encoding information of another sub coding unit in the same coding unit.
In an embodiment the encoding configuration is inferred from the encoding information of another coding unit sharing the same line of macroblocks.
In a fifth aspect, the invention provides non-transitory computer-readable medium storing a program which, when executed by a microprocessor or computer in an encoding or decoding device causes the device to perform the method of the first and second aspect.
In a sixth aspect the invention provides an information storage means readable by a computer or a microprocessor storing instructions of a computer program, wherein it makes it possible to implement the method of the first and second aspect.
At least part of the methods according to the invention may be computer implemented. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a "circuit", "module" or "system". Furthermore, the present invention may take the form of a computer program product embodied in any tangible medium of expression having computer usable program code embodied in the medium.
Since the present invention can be implemented in software, the present invention can be embodied as computer readable code for provision to a programmable apparatus on any suitable carrier medium. A tangible carrier medium may comprise a storage medium such as a floppy disk, a CD-ROM, a hard disk drive, a USB key, a memory card, a magnetic tape device or a solid state memory device and the like. A transient carrier medium may include a signal such as an electrical signal, an electronic signal, an optical signal, an acoustic signal, a magnetic signal or an electromagnetic signal, e.g. a microwave or RF signal.
BRIEF DESCRIPTION OF THE DRAWINGS
Embodiments of the invention will now be described, by way of example only, and with reference to the following drawings in which: Figure 1 represents a video streaming system capable of implementing an embodiment of the invention.
Figure 2 is a block diagram illustrating a schematic configuration of a communication apparatus adapted to incorporate the invention.
Figure 3 shows an encoding scheme according to the prior art.
Figure 4 illustrates an issue of the encoding scheme according to the prior art when using a variable slice size encoding.
Figure 5 shows an encoding scheme according to an embodiment of the invention solving the state of the art issue.
Figure 6 shows an algorithm according to an embodiment of the invention used during the encoding of a video frame.
Figure 7 details a part of the algorithm of figure 6 in order to encode a sub-slice.
Figure 8 shows a decoding algorithm according to an embodiment of the invention.
Figure 9 shows a modification of the syntax of a slice according to the invention.
Figure 10 shows Intra prediction modes adapted to the invention.
Figure 11 shows an encoding scheme according to another embodiment of the invention solving the state of the art issue.
Figure 12 shows details of an embodiment of step 620 in figure 6.
Figure 13 shows details of an embodiment of step 1215 in figure 12.
Figure 14 shows details of an embodiment of step 1220 in figure 12.
DETAILED DESCRIPTION OF THE EMBODIMENTS
Figure 1 shows an example of a video streaming system capable of implementing an embodiment of the invention.
A wireless camera 120 streams a video comprising video frames to the wireless display 110 via the wireless LAN 100 (Local Area Network). The camera 120 embeds an Intra only codec whereby each slice of a frame is encoded as a standalone decodable unit. This codec is not fully compliant with current standards H.264 and HEVC but can be seen as an evolution of these standards for error resilience purpose. More specifically, besides a major part of the syntax of H264 which is re-used, a new syntax element representing the scanning directions in slices is added to this codec. Such codec type provides a low latency and avoids error propagation in a video frame.
In order to finely adapt the throughput of the video codec to the network conditions, the rate control of the codec embedded in the camera 120 adapts the size of each slice according to the network conditions, for example to the available bandwidth of the wireless LAN 100.
Figure 2 is a block diagram illustrating a schematic configuration of a communication apparatus adapted to incorporate the invention.
The communication apparatus may be a transmitting device or a receiving device such as the camera device 120 or the display 110 of figure 1. Reference numeral 202 is a RAM which functions as a main memory, a work area, etc., of CPU 201. CPU 201 is capable of executing instructions on powering up the communicating apparatus from program ROM 203. After the powering up, CPU 201 is capable of executing instructions from the main memory 202 relating to a software application after those instructions have been loaded from the program ROM 203 or the hard-disc (HD) 206 for example. Such software application, when executed by the CPU 201, causes the steps of the flowcharts shown in one or more of the figures 6 to 8 to be performed.
Reference numeral 204 represents the network interfaces that can be a single network interface or composed of a set of different network interfaces like for instance several wireless interfaces, or different kinds of wired or wireless interfaces. Data packets are written to the network interface for transmission or read from the network interface for reception under the control of the software application running in the CPU 201. Reference numeral 205 represents a user interface to display information to, and/or receive inputs from, a user.
I/O module 207 represents a module able to receive or send data from/to external devices as video sensors or display devices.
Figure 5 shows an encoding method comprising a scan scheme according to an embodiment of the invention, The figure 5 describes a scan scheme applied to the video frame 400 of figure 4, the scan direction being also symbolized by a dashed line.
The number, the position, the order and the size (in number of macroblock) of each slice are the same as in the example of the figure 4: in figure 5, only the scan direction changes.
In figure 5, the scan direction is changed in order to improve the coding efficiency. Considering the slice#N 540 (corresponding to slice#N 440 of figure 4), the scan direction is changed after the encoding of the macroblock Bm- 1 546. The scan direction from left to right of figure 4 is changed to right to left.
The next encoded macroblock is therefore the macroblock Bn 551, and the (n-m) remaining macroblocks of the slice#N 540 will be encoded following the right to left direction. It follows that the encoding of the macroblock Bn will limit the loss of encoding efficiency, since there are reconstructed pixels available at the top external boundary of the macroblock Bn. For example, pixels at the bottom of the macroblock BI (544) can be used to construct a predictor block for the macroblock Bn 551.
Scan direction of slice#1 510 is not changed since macroblock Bk 513 has reconstructed pixels available at its top boundary (reconstructed pixels at the bottom of blocks Bi 511 and B2 512).
Concerning slice#3 530, there is no need to change the scan direction.
Indeed, whatever direction is chosen, no reconstructed pixels from the second line of macroblocks are available for predicting macroblocks of the part of slice#3 located on the third line of macroblocks. In that case, modifying the scanning direction will have no effect on improving the coding efficiency.
The figure 5 illustrates that changing the scan direction allows reducing the use of the DC prediction based on the default DC predictor by increasing the number of possible predictors. This proposed scanning policy, by modifying the processing order of macroblocks, allows reducing the loss of encoding efficiency encountered when using the state of the art encoding method based on the raster scan scheme.
Figure 11 shows an encoding method comprising a modification of the processing order of macroblocks according to an embodiment of the invention.
Comparing to figure 4, in figure 11 not only the scanning direction is modified when judicious but also the position of the slice themselves. However the number and the size of slices is kept. As in figure 4 and 5, slice#N covers partially two lines of macroblocks. However, the second part of slice#N is now located on the right side of the frame. Displacing this second part allows benefiting of the reconstructed pixels of slice#N located on the previous line of macroblocks. All macroblocks of the second part have reconstructed pixels in their external boundary, allowing defining a plurality of Intra predictor for each macroblock. As can be seen this new processing order of macroblocks allows reducing the use of the DC prediction based on the default DC predictor. In case of slice#N, only one DC predicted macroblock will be necessary.
The same modification of the processing order is applied to slice#3. But, in that case, the displacement of the second part of slice#3 is combined to a modification of the scanning direction. Indeed, by modifying the scanning order, the DC prediction with the default DC predictor of macroblock BI 1131 can be avoided. In addition, the macroblocks between Bx 1133 and By 1132 will benefit of the availability of reconstructed pixels at their top boundary.
Figure 6 shows an algorithm of the encoding scheme according to an embodiment of the invention. The algorithm is used during the encoding of a video frame.
In step 610, some characteristics of the next slice (i.e. the next coding unit) to encode are obtained. In particular, the required size of the next slice in number of macroblocks representing one of such characteristics is obtained from a control module of the codec. The required size could be obtained by dividing the bitrate available on the network for transmitting the next slice by the average size in bits/s of a macroblock computed on previously encoded macroblocks of the same frame or of a previous frame. From the required size, the algorithm determines the number of sub-slices (also called sub coding units) constituting the slice. Since slices can cover a plurality of lines of macroblocks within a frame, a sub-slice is defined as the part of a slice belonging to only one line of macroblocks and made of contiguous macroblocks. For instance, in figure 5, slice#N 540 is made of two sub-slices, one corresponding to the macroblocks Bi to Bm-1, the second correspond to the macroblock Bm to Bn.
Depending on the size constraint and on the position of the previous slice, a slice can comprise one sub-slice or a plurality of sub-slices.
The algorithm of figure 6 continues with the processing of each sub-slice of a slice. In step 620 an encoding configuration is determined for the current sub-slice. The encoding configuration of a sub-slice is characterized by three parameters: * a number of macroblocks to encode in the sub-slice: this number depends on the number of macroblocks already encoded for the slice and on the number of macroblocks that can be encoded in the current line of macroblocks; * a scanning direction: for each sub-slice two scanning directions are possible: from left to right and from right to left.
* a location in the macroblock line: if the sub-slice covers partially a line of macroblocks, i.e. does not constitute a full line of macroblocks, two locations are possible. Either the sub-slice comprises the rightmost macroblock of the line of macroblocks or the sub-slice comprises the leftmost macroblocks of the line of macro blocks.
As described below, the scanning direction and the location of the sub-slice in the line of macroblock can be fixed randomly or arbitrarily depending on the sub-slice location in the image, or in function of the encoding configuration of another sub-slice. It can also depend on other criterion representative of the expected compression performance of the sub-slice. These criterions could be the complexity or the position of some macroblocks in the sub-slice, or the availability of predictors for the macroblocks of the sub-slice, Figure 12 describes in details the algorithm performed during step 620.
This algorithm starts by determining the two variables CMB (1200) and NMB (1205) representing respectively the capacity of the current line of macroblocks in terms of macroblocks to encode and the number of macroblock remaining to encode in the slice. CMB is determined in function of the macroblocks already encoded for the current line. NMB is the difference between the target number of macroblocks for the slice and the number of macroblocks already encoded.
These two variables are compared during step 1210. If NMB is above or equal to CMB, the current sub-slice fills the reminder of the current line and the number of macroblocks in the sub-slice is the number of macroblocks reminding in the line corresponding to CMB. In that case there is no choice for the location of the sub-slice and the algorithm continues directly with the determination of the scanning direction in step 1220, If NMB is lower than CMB, the next sub-slice doesn't fill the current line and the location of this sub-slice needs to be determined. The number of macroblocks in the sub-slice is given by NMB Figure 13 describes in more details step 1215. The first step of the algorithm of figure 13 consists in checking the availability of predictors for the current sub-slice computed from the line of pixels above the current line of macroblocks for at least one location of sub-slice. If no predictors are available the location of the current sub-slice is set to the leftmost possible position in the current line of macroblocks during step 1315. Otherwise, the algorithm continues with step 1320. Simple algorithms could be applied in step 1320. It can be based for instance on a statistical analysis on several video sequences of the location providing in average the best compression results. If for instance the leftmost position appear to provide in average the best compression results this location could be systematically applied in step 1320. In a preferred embodiment, step 1320 consists in searching the location maximizing the number of pixels in the above line of pixels available for generating predictors.
Maximizing the number of pixels available for generating predictors makes it possible to increase the number of predictors which has a direct impact on the compression efficiency. In a particular embodiment, two locations of the sub-slice are tested: either the leftmost possible position or the rightmost possible position. For each position, the number of neighboring pixels on the top boundary of the current sub-slice that can be used for generating predictors is calculated. The location maximizing this number is selected in step 1310. In case of equality, the leftmost position is selected.
Figure 14 describes in details step 1220. This algorithm starts with step 1410 which is identical to step 1310. If no predictors are available the scanning direction is fixed. Several embodiments for fixing this direction could be used.
In one embodiment, the scanning direction can be set to the raster scan direction.
In another embodiment, the scanning direction could depend on the line number, for instance right to left for odd lines numbers, and left to right for even line numbers.
In an embodiment, the scanning direction can be chosen randomly.
We can also remark that the first macroblock to be encoded in a sub-slice depends directly on the scanning direction. If the scanning direction is left to right, then the first macroblock to be encoded is the macroblock of the sub-slice the more on the left (macroblock Bi in slice#N 540). If the scanning direction is right to left, then the first macroblock to be encoded is the macroblock of the sub-slice the more on the right (macroblock Bm-1 in slice#N 540).
In an embodiment, the fixed scanning direction could depend on the properties of the first macroblock to encode.
One property could be the location of the macroblock in the frame. It is known that the most important part of a frame is located in the center. It is then important to better encode the macroblocks close to the frame center to preserve important parts of the frame. One effect of the rate control applied during the encoding of a slice is that when too much bitrate has been used for encoding the first macroblocks of a sub-slice, the rate control reduces the bitrate allocated to the remaining macroblocks to encode in order to respect the target bitrate constraint. As a consequence, the last macroblocks of the sub-slice may have a poor quality. Since macroblocks close to the frame center must be preserved, it is better to start the encoding by the macroblock the closest to the frame center. The scanning direction can be deduced from the location of the first macroblock to encode.
A second property could be the complexity of the first macroblock to encode. A macroblock which is complex to encode has little chance to be well predicted by any predictor. Consequently, applying a DC prediction on complex macroblocks would not affect the compression performances. The determination of the first macroblock to encode could be based on the complexity of the two candidate macroblocks, the macroblock the more complex being selected to be the first to be encoded. The variance of the macroblock could be used as a measure representative of the macroblock complexity.
Again, the scanning direction can be deduced from the location of the first macroblock to encode.
In another embodiment, the two properties can be combined to determine the first macroblock to encode and deduce the scanning direction. For instance when the two candidate macroblocks have close complexities, the distance to the frame center could be used as a fallback criterion to determine the first macroblock to encode. Similarly, if the two candidate macroblocks are at the same distance from the frame center, then the macroblock complexity could be used as a fallback criterion to determine the first macroblock to encode.
When predictors are available, step 1410 is followed by step 1420. In a simple embodiment, the scanning direction in the current sub-slice could be taken as the direction opposite to the direction used in the previous sub-slice.
Such simple algorithm could be used for instance when the scanning direction of the previous sub-slice was chosen randomly, or fixed to the raster scan direction or in function of the line number. In another embodiment, other criteria such as the position of the first macroblock to encode in the sub-slice or the complexity of this first macroblock could be also used. In a preferred embodiment, the scanning direction depends on the number of predictors available for the macroblocks of the current sub-slice. The scanning direction maximizing this number is chosen. In this embodiment, for each possible scanning direction, the availability of each of the 9 Intra prediction directions proposed by H.264 is tested. The number of available predictors is incremented as soon as a prediction direction is available. The two final numbers of available predictors, each corresponding to one scanning direction, are then compared.
The scanning direction maximizing the number of available predictors is then selected.
Then at step 640 the current sub-slice is encoded. Step 640 is described in more details in relation to figure 7.
In step 650 it is checked if testing another scanning direction for the currently encoded sub-slice is required. Step 650 and step 680 are optional and are used optionally to check and improve the encoding configuration decision.
Indeed, the result of the encoding may not be satisfying and the bitrate after encoding may be above the expected bitrate, In the preferred embodiment of the invention, step 640 is followed directly by step 660 where the characteristics of the encoding configuration are stored in memory for later use.
Alternatively in step 650, all possible encoding configurations are tested.
Step 680 is systematically applied after step 650 until all possible combinations of sub-slice locations and scanning directions are tested. The sub-slice location could be changed with respect to the previous encoding configuration only if predictors are available for the current sub-slice. If no predictor is available, only the scanning direction can be modified and only 2 encoding configurations are possible. Otherwise, four encoding configuration can be tested. The new encoding configuration is then applied during step 640 and the encoding results of all encoding configuration tested are compared in step 650.
A further alternative for step 650, is for the decision taken in step 650 to continue with other encoding configuration to be dependent on the time remaining before transmitting the encoded slice data. If the time remaining is sufficient to loop back to step 620 with another encoding configuration, the step 650 is followed by step 680. Otherwise, step 650 is followed by step 660 and best encoding configuration is selected between the tested encoding configurations, In a still further alternative of step 650, the decision taken in step 650 depends on the encoding performances. If it appears after encoding the sub-slice that the rate control had to decrease strongly the quality of the macroblocks between the beginning and the end of the sub-slice to meet the rate constraint, then another encoding configuration is tested. Indeed, in that case, it could be interesting to check if another configuration would deliver a more homogeneous quality in the sub-slice, This test could then consist in comparing with a PSNR (Peak Signal to Noise Ratio) the quality of the first and the last macroblock in the slice with respect to the original macroblocks.
In the case of the above alternatves, step 660 consists in determining the best scanning direction by comparing the bitrate after encoding of each tested scanning direction. The direction minimizing the bitrate and/or providing the most homogeneous encoding is kept and the encoding configuration is stored in step 660.
Step 660 is followed by step 670 where it is tested if the current sub-slice is the last sub-slice of the slice. If no, the algorithm oops back to step 620.
Otherwise, the streaming of the encoded slice is started in step 690.
Step 690 creates the bit stream associated to the encoded unit (insertion in a NAL unit of the bitstream corresponding to the best scanning direction), and sends it to the receiver as the display device 110. In order to be correctly decoded, during step 690 the encoding configuration of each sub-slice stored in step 660 is added at the beginning of the bit stream. This could be done for instance by adding at least one byte D 910 after the slice header 900 at the beginning of the slice data 920 (see figure 9). This new syntax element could indicate the encoding configuration to be used by the decoder for each sub-slice. In the syntax element, each sub-slice is represented by a flag made of two bits. The first bit indicates the location of the sub-slice in the line: 0 for leftmost, 1 for rightmost. The second bit indicates the scanning direction: 0 for right to left and 1 for left to right for instance. Remaining bits (if any) in the syntax element D are set to 0.
In another embodiment, the location of the first sub-slice of a slice could be inferred from the position of the first macroblock in the slice indicated by the syntax element first_mbjnslice in the slice header.
Note that those additional bytes are optional if a default scanning direction is used in the slice or if the directions can be inferred at the decoder for instance when the direction depends of the parity of the line number. Of course if more scan directions have to be used, more than one byte can be used, the resulting overhead being still negligible.
Figure 7 details the step 640 of the algorithm of figure 6 in order to encode a sub-slice.
The current macroblock is encoded at step 641 using known Intra prediction technics, as those proposed in H.264 for instance. However, according to the invention, in the step 641, the interpretation of the prediction direction can be changed, depending on the scan direction. For instance, in the case of an H.264 compression, the prediction direction 1 corresponds to the "horizontal" direction. With this prediction direction a block predictor is created from the pixels located at the external left boundary of the block to encode.
According to the present invention, if the scan direction is "right to left", the prediction direction 1 is changed so as to indicate that the pixels located on the right of the current macroblock are used for generating a predictor.
Figure 10 shows the prediction directions for the 4x4 blocks as described in H.264 (1010 to 1013), and the required modification in case of scan direction inversion (1020 to 1023).
Figure 1010 shows the pixels that can be used as predictors (A to Ni) for predicting the pixels (a to p) of a 4x4 block as defined by the standard H.264.
Figure 1011 shows the prediction directions available in H.264, each Intra prediction mode corresponding to a prediction direction showed on figure 1011.
Note that mode 2 corresponds to the DC mode and is not represented on the figure. For the mode 2, the DC value is a mean of the pixel A to D and Ito L. Two examples of application of the prediction direction are given in figure 1012 for the prediction direction 3 and 1013 for the prediction direction 4.
In this figure, the arrows indicate the direction of propagation of the predictor pixel value.
Figure 1020 to 1023 show how the encoder and decoder understand the prediction direction in case of inversion of the scan direction (from right to left instead of left to right).
Figure 1020 shows the position of the pixel (A to M) that can be used as predictor for the pixel (a to p) to be encoded.
The prediction direction used are then those shown on figure 1021.
Prediction mode 2 is not represented. For mode 2, the pixel value is computed as a mean of the A to D and Ito L pixels. This is the same computing as for the normal direction, but because the predictor pixel are not located at the same place (typically predictor pixels I to L are located on the left for normal direction and on the right for the reverse direction), the DC value for a given block can be different depending on the scan direction.
Two examples of application of the prediction direction are shown in figure 1022 (for the prediction direction 3) and 1023 (for the prediction direction 4).
Step 642 tests if the end of the current sub-slice is reached. If the end of the sub-slice is reached, step 645 is executed; otherwise, step 644 is executed.
In step 645 the bit stream corresponding to the encoding of the current slice using the current encoding direction is stored in a temporary memory.
Some metrics are also stored in order to assess or measure the encoding quality as the size of the bit stream, the average OP value, or other equivalent metrics. Then the algorithm executes the step 670 of figure 6.
In step 644 the next macroblock to be encoded is determined according to the latest encoded macroblock and to the current scan direction.
Figure 8 shows a decoding algorithm according to an embodiment of the invention. Figure 8 describes the operations performed by the decoding unit to be able to decode the encoded slice received. As an example, the operations may be performed by the decoding unit of the display device 110 to be able to decode and display the encoded slice received from the camera 120.
In step 810 the syntax element D 910 following the slice header is read and the list of encoding configurations to be used to decode the current slice are stored in a temporary memory.
In step 820 the encoding configuration of the current sub-slice is read from the temporary memory.
In step 830 the position of the next macroblock to be decoded is determined based on the scanning direction and the sub-slice location indicated in the encoding configuration determined in step 820 and on the macroblocks already decoded for the current sub-slice, Then in step 840, the next macroblock is decoded using decoding method corresponding to the encoding method used in step 641 (for example one proposed in H264), Depending on the scan direction, the interpretation of the prediction direction can be changed. For instance, in the case of an H.264 compression, the prediction direction 1 corresponds to the horizontal" direction with scan from left to right and indicates that the reconstructed pixels at the external left boundary are used to construct a block predictor for the block to decode macroblock. According to the present invention, if the scan direction is "right to left", the prediction direction 1 is changed so as to indicate to use the pixels at the external right boundary to construct a macroblock predictor for the macroblock to decode, Step 850 tests if the end of the current slice is reached so that no more macroblock to decode is present in the bit stream for this slice. The end of a slice is identified by the decoder when a new slice header is found.
If the end of the current slice is reached, the algorithm stops unit reception of a new slice, otherwise, step 860 is executed.
Step 860 tests if the end of the line is reached so that no more non-decoded macroblock is present in the current line of macroblocks for the current sub-slice.
If the end of line is reached the algorithm loops back to step 820 and the encoding configuration of the next sub-slice is read from the temporary memory.
If step 860 determines that the end of line is not reached, step 830 is executed in order to decode the next macroblock of the current sub-slice.

Claims (10)

  1. CLAIMS1. A method of encoding an image using spatial prediction, the image represented by coding units including a plurality of macroblocks of pixels, at least one coding unit extending across a plurality of lines of macroblocks, the method comprising: * defining sub coding units of said at least one coding unit, wherein each defined sub coding unit belongs to a single line of macroblocks of pixels; * determining an encoding configuration for each defined sub coding unit of macroblocks, wherein the encoding configuration comprises a scanning direction, and * encoding the sub coding units of the coding unit by applying spatial predictions according to the determined encoding configurations.
  2. 2. A method according to claim 1 wherein the encoding configuration comprises also the location in the horizontal direction of the image of the sub coding unit.
  3. 3. A method according to claim 1 or 2 wherein the scanning direction of a sub coding unit is selected in a set of predefined scanning directions.
  4. 4. A method according to claim 3 wherein the scanning direction of the first sub coding unit of the coding unit is fixed to one predefined scanning direction
  5. 5. A method according to claim 3 wherein the scanning direction of the first sub coding unit of the coding unit is determined randomly in the set of predefined scanning directions,
  6. 6. A method according to claim 3 wherein the scanning direction of a sub coding unit of the coding unit is selected in the set of predefined scanning directions in function of the number of the line of macroblocks to which the sub coding unit belongs.
  7. 7. A method according to claim 3 wherein the scanning direction of a sub coding unit of the coding unit depends on at least one criterion representative of the expected compression performance of the sub coding unit,
  8. 8. A method according to claim 7 wherein the at least one criterion comprises a property of at least one macroblock in the sub coding unit
  9. 9. A method according to claim 8 wherein the property is the position in the image and/or the complexity of at least one macroblock in the sub coding unit.
  10. 10.A method according to any claim from claim 7 to 9 wherein the at least one criterion is the availability of spatial predictors for predicting macroblocks of the sub coding unit 11 A method according to claim 10 wherein the scanning direction determined for the sub coding unit of the coding unit is the one maximising the number of available spatial predictors.12.A method according to any preceding claim wherein the scanning direction of a sub coding unit of a coding unit depends of the scanning direction of another sub coding unit of the same coding unit.13.A method according to any preceding claim wherein the scanning direction of a sub coding unit depends on the sub coding unit location in the line of macroblocks to which the sub coding unit belongs.14.A method according to any preceding claim from claim 2 to claim 13 wherein the location of the sub coding unit of macroblocks in the line of macroblocks to which the coding unit belongs is selected in a set of predefined locations.lEA method according to claim 14 wherein the location of the sub coding unit of macroblocks in the line of macroblocks to which the sub coding unit belongs is fixed to a predefined location.16.A method according to claim 14 wherein the location of the sub coding unit of macroblocks in the line of macroblocks to which the sub coding unit belongs depends on the location of another sub coding unit sharing the same line of macroblocks.17.A method according to claim 14 wherein the location of the sub coding unit of macroblocks in the line of macroblocks to which the sub coding unit belongs depends on the availability of pixels allowing generating spatial predictors for the macroblocks of said sub coding unit.18.A method according to claim 17 wherein the location of the sub coding unit of macroblocks in the line of macroblocks to which the sub coding unit belongs is determined as the one maximizing the number of pixels allowing generating spatial predictors.19.A method according to any preceding claim wherein several different encoding configurations are tested and the one providing the best compression performance is selected for encoding the sub coding unit 20.A method according to claim 19 wherein the number of tested encoding configurations depends on the actual compression performance of already tested encoding configurations.21.A method according to claims 19 or 20 wherein the number of tested encoding configurations depends on a time remaining before a transmission on a network of the coding unit.22.A method according to any preceding claim wherein a syntax element representing the determined encoding configurations is encoded in the image bitstream.23.A method according to claim 22 wherein the syntax element is encoded in the coding unit header.24.A method of decoding a bitstream portion representing a coding unit of an image, pixels of macroblocks of pixels of said coding unit having been spatially predicted, said coding unit comprising a plurality of sub coding units, a sub coding unit being a portion of a coding unit belonging to a single line of macroblocks of the image, the method comprising for the coding unit: * obtaining information representative of an encoding configuration for each sub coding unit of the coding unit, wherein the encoding configuration comprises a scanning direction, * decoding the coding unit by applying spatial predictions to the macroblocks of each sub coding unit depending on the obtained information representative of the encoding configuration.25.A method according to claim 24 wherein the encoding configuration comprises also a location in the horizontal direction of the image of the sub coding unit.26.A method according to claim 24 or 25 wherein the encoding configuration is obtained from a syntax element associated with the bitstream portion, 27.A method according to claim 24 or 25 wherein the encoding configuration is inferred from information representative of the location of the sub coding unit in the image.28.A method according to claim 24 or 27 wherein the encoding configuration is inferred from the encoding information of another sub coding unit in the same coding unit.29.A method according to claim 24 or 28 wherein the encoding configuration is inferred from the encoding information of another coding unit sharing the same line of macroblocks.30.A device for encoding an image comprising a coding unit using spatial prediction on macroblocks of pixels, the coding unit comprising a plurality of lines of macroblocks of pixels, the device comprising a module able to handle coding units belonging to a plurality of lines of macroblocks of pixels said module comprising: * a module for defining sub coding units of macroblocks of pixels in a coding unit, wherein each defined sub coding unit belongs to a single line of macroblocks of pixels; * a module for determining an encoding configuration for each defined sub coding unit of macroblocks, wherein the encoding configuration comprises a scanning direction, * a module for encoding the sub coding units of the coding unit by applying spatial predictions based on the determined encoding configurations.31.A device according to claim 30 wherein the encoding configuration comprises also a location in the horizontal direction of the image of the sub coding unit.32.A device according to claim 30 or 31 wherein the scanning direction of a sub coding unit determined by the module for determining en encoding configuration is selected in a set of predefined scanning directions.33.A device according to claim 32 wherein the scanning direction of the first sub coding unit of the coding unit is fixed to one predefined scanning direction.34.A device according to claim 32 wherein the scanning direction of the first sub coding unit of the coding unit is determined randomly by the module for determining an encoding configuration in the set of predefined scanning directions.35.A device according to claim 32 wherein the scanning direction of a sub coding unit of the coding unit is selected by the module for determining an encoding configuration in the set of predefined scanning directions in function of the number of the line of macroblocks to which the sub coding unit belongs.36.A device according to claim 32 wherein the scanning direction of a sub coding unit of the coding unit depends on at least one criterion representative of the expected compression performance of the sub coding unit.37.A device according to claim 36 wherein the at least one criterion comprises a property of at least one macroblock in the sub coding unit.38.A device according to claim 37 wherein the property is the position in the image and/or the complexity of at least one macroblock in the sub coding unit.39.A device according to any claim from claim 36 to 38 wherein the at least one criterion is the availability of spatial predictors for predicting macroblocks of the sub coding unit.40.A device according to claim 39 wherein the scanning direction determined by the module for determining an encoding configuration for the sub coding of the coding unit is the one maximising the number of available spatial predictors.41.A device according to any preceding claim wherein the scanning direction of a sub coding of a coding unit depends of the scanning direction of another sub coding unit of the same coding unit.42.A device according to any preceding claim wherein the scanning direction of a sub coding unit depends on the sub coding unit location in the line of macroblocks to which it belongs.43.A device according to any preceding claim from claim 2 to claim 13 wherein the location of the sub coding unit of macroblocks in the lines of macroblocks it belongs to is selected by the module for determining an encoding configuration in a set of predefined locations.44.A device according to claim 43 wherein the location of the sub coding unit of macroblocks in the lines of macroblocks to which it belongs is fixed to a predefined location.45,A device according to claim 43 wherein the location of the sub coding unit of macroblocks in the lines of macroblocks to which it belongs depends on the location of another sub coding unit sharing the same line of macroblocks.46.A device according to claim 43 wherein the location of the sub coding unit of macroblocks in the lines of macroblocks to which it belongs depends on the availability of pixels allowing generating spatial predictors for the macroblocks of said sub coding unit.47.A device according to claim 46 wherein the location of the sub coding unit of macroblocks in the lines of macroblocks to which it belongs is determined as the one maximizing the number of pixels allowing generating spatial predictors.48.A device according to any preceding claim wherein several different encoding configurations are tested by the module for determining an encoding configuration and the one providing the best compression performance is selected for encoding the sub coding unit.49,A device according to claim 48 wherein the number of tested encoding configurations depends on the actual compression performance of already tested encoding configurations.50,A device according to claims 48 or 49 wherein the number of tested encoding configurations depends on a time remaining before a transmission on a network of the coding unit.51.A device according to any preceding claim wherein a syntax element representing the determined encoding configurations is encoded in the image bitstream by the module for encoding the coding unit.52.A device according to claim 51 wherein the syntax element is encoded in the coding unit header.53.A device for decoding a bitstream portion representing a coding unit of an image, pixels of macroblocks of pixels of said coding unit having spatially predicted, said coding unit comprising a plurality of sub coding units, a sub coding unit being a portion of a coding unit belonging to one line of macroblocks of the image, the device for decoding comprising: * A module for obtaining information representative of an encoding configuration for each sub coding unit of the coding unit, wherein the encoding configuration comprises a scanning direction, * A module for decoding the coding unit by applying spatial predictions in each sub coding unit depending on the obtained information representative of the encoding configuration.54.A device according to claim 53 wherein the encoding configuration comprises also a location in the horizontal direction of the image of the sub coding unit.55.A device according to claim 53 or 54 wherein the encoding configuration is obtained from a syntax element associated with the bitstream portion, 56.A device according to claim 53 or 55 wherein the encoding configuration is inferred from information representative of the location of the sub coding unit in the image.57.A device according to claim 53 or 56 wherein the encoding configuration is inferred from the encoding information of another sub coding unit in the same coding unit.58.A method according to claim 53 or 57 wherein the encoding configuration is inferred from the encoding information of another coding unit sharing the same line of macroblocks.59.A non-transitory computer-readable medium storing a program which, when executed by a microprocessor or computer in an encoding or decoding device causes the device to perform the method steps according to any claims 1 to 29.60,An information storage means readable by a computer or a microprocessor storing instructions of a computer program, wherein it makes it possible to implement the method according to any one of the claims 1 to 29.61.A method substantially as hereinbefore described with reference to, and shown in, Fig. 6to 8 and l2to 14 of the accompanying drawings.62.An encoding or decoding device as hereinbefore described with reference to, and shown in Figs. 1 and 2 of the accompanying drawings.
GB1318867.7A 2013-10-25 2013-10-25 Method of encoding or decoding a video frame Active GB2521117B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
GB1318867.7A GB2521117B (en) 2013-10-25 2013-10-25 Method of encoding or decoding a video frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
GB1318867.7A GB2521117B (en) 2013-10-25 2013-10-25 Method of encoding or decoding a video frame

Publications (3)

Publication Number Publication Date
GB201318867D0 GB201318867D0 (en) 2013-12-11
GB2521117A true GB2521117A (en) 2015-06-17
GB2521117B GB2521117B (en) 2017-02-15

Family

ID=49767148

Family Applications (1)

Application Number Title Priority Date Filing Date
GB1318867.7A Active GB2521117B (en) 2013-10-25 2013-10-25 Method of encoding or decoding a video frame

Country Status (1)

Country Link
GB (1) GB2521117B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016124154A1 (en) * 2015-02-08 2016-08-11 同济大学 Image coding method and apparatus, and image decoding method and apparatus
CN105872539A (en) * 2015-02-08 2016-08-17 同济大学 Image coding method and device, and image decoding method and device
WO2017059044A1 (en) * 2015-09-29 2017-04-06 Qualcomm Incorporated Delta qp for quantization of rectangular transform units, short distance intra prediction (sdip) based video coding
WO2017197434A1 (en) * 2016-05-20 2017-11-23 Canon Kabushiki Kaisha Method, apparatus and system for encoding and decoding video data

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2306732A1 (en) * 2008-06-27 2011-04-06 Fujitsu Limited Image compression device and image restoration device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2306732A1 (en) * 2008-06-27 2011-04-06 Fujitsu Limited Image compression device and image restoration device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016124154A1 (en) * 2015-02-08 2016-08-11 同济大学 Image coding method and apparatus, and image decoding method and apparatus
CN105872539A (en) * 2015-02-08 2016-08-17 同济大学 Image coding method and device, and image decoding method and device
CN105872539B (en) * 2015-02-08 2020-01-14 同济大学 Image encoding method and apparatus, and image decoding method and apparatus
US10750180B2 (en) 2015-02-08 2020-08-18 Tongji University Image coding method and apparatus, and image decoding method and apparatus
US11431977B2 (en) 2015-02-08 2022-08-30 Xi'an Zhongxing New Software Co., Ltd Image coding method and apparatus, and image decoding method and apparatus
WO2017059044A1 (en) * 2015-09-29 2017-04-06 Qualcomm Incorporated Delta qp for quantization of rectangular transform units, short distance intra prediction (sdip) based video coding
US10218975B2 (en) 2015-09-29 2019-02-26 Qualcomm Incorporated Transform precision manipulation in video coding
WO2017197434A1 (en) * 2016-05-20 2017-11-23 Canon Kabushiki Kaisha Method, apparatus and system for encoding and decoding video data

Also Published As

Publication number Publication date
GB2521117B (en) 2017-02-15
GB201318867D0 (en) 2013-12-11

Similar Documents

Publication Publication Date Title
RU2722536C1 (en) Output of reference mode values and encoding and decoding of information representing prediction modes
US10397575B2 (en) Image coding apparatus, image coding method, and program, and image decoding apparatus, image decoding method, and program
US10893298B2 (en) Method and apparatus for video coding
US10812810B2 (en) Method and apparatus for video coding in merge mode
US9445114B2 (en) Method and device for determining slice boundaries based on multiple video encoding processes
US10291925B2 (en) Techniques for hardware video encoding
US9813716B2 (en) Video encoder and video encoding method
US9648340B2 (en) Method and device for encoding/decoding motion vector
US10623746B2 (en) Method and apparatus for video coding
JP2017528987A (en) Predictive coding, decoding method, corresponding encoder, decoder and electronic device
JP7198665B2 (en) Multi-Region Search Coverage for Block Prediction Modes for Display Stream Compression (DSC)
US20140355690A1 (en) Method and apparatus for entropy-encoding capable of parallel processing, and method and apparatus for entropy-decoding capable of parallel processing
US20160269740A1 (en) Method and apparatus for encoding multilayer video, and method and apparatus for decoding multilayer video
CA2996190A1 (en) Variable partition size for block prediction mode for display stream compression (dsc)
KR20170137090A (en) Rate-constrained fallback mode for display stream compression
US11025913B2 (en) Encoding video using palette prediction and intra-block copy
US9635388B2 (en) Moving image encoding device, moving image encoding method, and computer program product
GB2521117A (en) Method of encoding or decoding a video frame
JP2024059909A (en) Method and device for image encoding and decoding - Patents.com
US20150010069A1 (en) Intra video coding in error prone environments
CN110650337B (en) Image encoding method, decoding method, encoder, decoder and storage medium
US20130083846A1 (en) Image encoding apparatus, image encoding method, image encoding program, image decoding apparatus, image decoding method, and image decoding program
KR101540510B1 (en) Method of intra prediction using additional prediction candidate and apparatus thereof
US10805611B2 (en) Method and apparatus of constrained sequence header
RU2808075C1 (en) Method for image coding and decoding, coding and decoding device and corresponding computer programs