TECHNICAL FIELD

The present disclosure relates to image processing technologies, and in particular, to a video encoding and decoding method, apparatus and system.

BACKGROUND

3DTV (Three-Dimensional Television) is a most common three-dimensional television technology. Using the technology, two independent views, a left one and a right one, are displayed on one screen, and the left eye and the right eye separately receive different views, so as to achieve a 3D three-dimensional effect. At present, when a service provider provides a 3DTV service, it is expected that an encoding tool and a transmission device that are of an original 2DTV (Two-Dimensional Television) are used as much as possible to reduce video production costs and transmission device costs.

To satisfy the foregoing requirement, a frame packing 3DTV technology is used to pack a left view and a right view into one frame of image, and then a 2D encoder and a 2D transmission device are used to perform encoding and transmission; a message about how to pack the two views is added to an encoded bitstream, or a message that directly indicates separate location information of the two views in the frame is added, and after a decoder performs decoding, the two views are output according to the foregoing message.

There is a plurality of packing types for views that use the frame packing 3DTV technology.FIG.1exemplarily shows two packing types, namely, a left-right type and a top-bottom type. For one packing type, there may also be different packing cases according to different flipping types. The flipping type indicates whether an arrangement order of a left-right view is flipped or an arrangement data of a top-bottom view is flipped.FIG.1shows different images formed by using different packing types and flipping types.

All existing decoders of various different types include two main parts: a decoding module and a local memory. The local memory is used to store a picture that is encoded but is not decoded and a decoded picture, where the decoded picture needs to be used as a reference frame for decoding a subsequent picture or outputting time of the decoded picture is not reached. The decoder needs to allocate enough storage resources to the local memory, and the decoding module needs to consume calculation resources of the decoder.

A video that needs to be transmitted forms a bitstream after being encoded, and profile information and level information of each bitstream are transmitted in each bitstream. A profile indicates coding tools used by an encoder during video encoding (for example, in a main profile, a bit depth of a pixel is only 8 bits, a picture parameter set identifier PPS id cannot exceed 63, and tile coding is not enabled; however, all of these constraints do not exist in a high profile), and if the decoder does not support one of the coding tools thereof, decoding cannot be performed. A level indicates a calculation capability and a storage resource that are required when the decoder performs decoding. For example, a current hevc draft defines level 4 and level 4.1, where the level 4 and the level 4.1 respectively indicate that a decoder conforming to the two standards can reach 32 frame/s and 64 frame/s when a high definition bitstream whose resolution is 1920*1080 is decoded, but a decoder that conforms only to a standard below the level 4 cannot decode the high definition bitstream whose resolution is 1920*1080.

In a practical application, if the decoder receives a 3D video bitstream encoded by using the frame packing 3DTV technology, but the decoder is connected to a 2D display device, then after a picture is decoded by the decoder, only one of two views is obtained and then output to the 2D display device, as shown inFIG.2. When solutions in the prior art are adopted, a higher-level decoder is required to perform decoding on the 3D video bitstream and then output the decoded picture to the 2D display device, because a Profile and Level requirement for encoding or decoding a 3D video bitstream is relatively higher than a Profile and Level requirement for encoding or decoding a 2D video bitstream. In addition, concerning the 2D display device, calculation and storage resources of the decoder are wasted because a picture that does not need to be displayed by the 2D display device also needs to be decoded.

SUMMARY

In view of this, to resolve the foregoing problem of wasting calculation and storage resources of a decoder or an encoder, the following technical solutions are used in implementation manners of the present disclosure.

A video encoding method, where a video includes a picture sequence and the method includes:

determining an independently decodable view in a to-be-encoded picture according to a configuration file corresponding to the video;

dividing the picture into at least two tiles, where an area corresponding to one or more tiles that cover the independently decodable view is an independently decodable area;

generating an auxiliary message corresponding to the picture, where the auxiliary message includes a location identifier of the independently decodable area, and the location identifier of the independently decodable area includes one or more tile identifiers (tile id); and

encoding all tiles included in the picture to form an encoded video bitstream, where the encoded video bitstream includes the auxiliary message.

A video decoding method, including:

receiving a video bitstream, where the video bitstream includes a to-be-decoded video and an auxiliary message, and the to-be-decoded video includes a to-be-decoded picture sequence;

acquiring a to-be-decoded picture;

obtaining a location identifier of an independently decodable area of the to-be-decoded picture according to the auxiliary message, where the location identifier of the independently decodable area includes tile identifiers (tile id) of one or more tiles; and

obtaining the independently decodable area of the to-be-decoded picture according to the location identifier of the independently decodable area, and decoding the independently decodable area.

A video encoder, where a video includes a picture sequence, including:

an independently decodable view determining unit, configured to determine an independently decodable view in a to-be-encoded picture according to a configuration file corresponding to the video;

a tile dividing unit, configured to divide the picture into at least two tiles), where an area corresponding to one or more tiles that cover the independently decodable view is an independently decodable area;

an auxiliary message generating unit, configured to generate an auxiliary message corresponding to the picture, where the auxiliary message includes a location identifier of the independently decodable area, and the location identifier of the independently decodable area includes one or more tile identifiers (tile id); and

an encoding executing unit, configured to encode all tiles included in the picture to form an encoded video bitstream, where the encoded video bitstream includes the auxiliary message.

Optionally, the encoding executing unit further includes: a determining unit, configured to: determine whether a current to-be-encoded tile is a tile in the independently decodable area; if yes, set an independently decodable area of an encoded picture to be a candidate inter-frame reference area of the current tile; if no, set a whole picture area of the encoded picture to be the candidate inter-frame reference area of the current tile; and when an inter-frame algorithm is used for encoding, select an optimal reference area according to the foregoing candidate inter-frame reference area corresponding to the to-be-encoded tile.

A video decoder, including:

a receiving unit, configured to receive a video bitstream, where the video bitstream includes a to-be-decoded video and an auxiliary message, and the to-be-decoded video includes a to-be-decoded picture sequence; and

a decoding executing unit, configured to: acquire a to-be-decoded picture; obtain a location identifier of an independently decodable area of the to-be-decoded picture according to the auxiliary message, where the location identifier of the independently decodable area includes tile identifiers (tile id) of one or more tiles; and obtain the independently decodable area of the to-be-decoded picture according to the location identifier of the independently decodable area, and decode the independently decodable area.

An encoder, configured to encode a video, where the video includes a picture sequence, and the encoder includes:

one or more processors;

one or more memories; and

one or more programs, where the one or more programs are stored in the one or more memories, and in addition, the one or more programs are configured to be executed by the one or more processors, and the one or more programs include:

an instruction configured to determine an independently decodable view in a to-be-encoded picture according to a configuration file corresponding to the video;

an instruction configured to divide the picture into at least two tiles, where an area corresponding to one or more tiles that cover the independently decodable view is an independently decodable area;

an instruction configured to generate an auxiliary message corresponding to the picture, where the auxiliary message includes a location identifier of the independently decodable area, and the location identifier of the independently decodable area includes one or more tile identifiers (tile id); and

an instruction configured to encode all tiles included in the picture to form an encoded video bitstream, where the encoded video bitstream includes the auxiliary message.

A decoder, including:

one or more processors;

one or more memories; and

one or more programs, where the one or more programs are stored in the one or more memories, and in addition, the one or more programs are configured to be executed by the one or more processors, and the one or more programs include:

an instruction configured to receive a video bitstream, where the video bitstream includes a to-be-decoded video and an auxiliary message, and the to-be-decoded video includes a to-be-decoded picture sequence;

an instruction configured to acquire a to-be-decoded picture;

an instruction configured to obtain a location identifier of an independently decodable area of the to-be-decoded picture according to the auxiliary message, where the location identifier of the independently decodable area includes tile identifiers (tile id) of one or more tiles; and

an instruction configured to obtain the independently decodable area of the to-be-decoded picture according to the location identifier of the independently decodable area, and decode the independently decodable area.

An encoder, disposed in a source apparatus for processing a video and configured to encode the video, where the video includes a picture sequence, and the encoder includes:

one or more circuits, configured to: determine an independently decodable view in a to-be-encoded picture according to a configuration file corresponding to the video; divide the picture into at least two tiles, where an area corresponding to one or more tiles that cover the independently decodable view is an independently decodable area; generate an auxiliary message corresponding to the picture, where the auxiliary message includes a location identifier of the independently decodable area, and the location identifier of the independently decodable area includes one or more tile identifiers (tile id); and encode all tiles included in the picture to form an encoded video bitstream, where the encoded video bitstream includes the auxiliary message.

A decoder, where the decoder is disposed in a receiving apparatus for processing a video, including:

one or more circuits, configured to: receive a video bitstream, where the video bitstream includes a to-be-decoded video and an auxiliary message, and the to-be-decoded video includes a to-be-decoded picture sequence; acquire a to-be-decoded picture; obtain a location identifier of an independently decodable area of the to-be-decoded picture according to the auxiliary message, where the location identifier of the independently decodable area includes tile identifiers (tile id) of one or more tiles; and obtain the independently decodable area of the to-be-decoded picture according to the location identifier of the independently decodable area, and decode the independently decodable area.

A computer-readable storage medium, where the computer-readable storage medium stores a plurality of instructions, and when the instructions are executed by a device, the device is triggered to perform the following operations:

determining an independently decodable view in a to-be-encoded picture in a video according to a configuration file corresponding to the video;

dividing the picture into at least two tiles, where an area corresponding to one or more tiles that cover the independently decodable view is an independently decodable area;

generating an auxiliary message corresponding to the picture, where the auxiliary message includes a location identifier of the independently decodable area, and the location identifier of the independently decodable area includes one or more tile identifiers (tile id); and

encoding all tiles included in the picture to form an encoded video bitstream, where the encoded video bitstream includes the auxiliary message.

A computer-readable storage medium, where the computer-readable storage medium stores a plurality of instructions, and when the instructions are executed by a device, the device is triggered to perform the following operations:

receiving a video bitstream, where the video bitstream includes a to-be-decoded video and an auxiliary message, and the to-be-decoded video includes a to-be-decoded picture sequence;

acquiring a to-be-decoded picture;

obtaining a location identifier of an independently decodable area of the to-be-decoded picture according to the auxiliary message, where the location identifier of the independently decodable area includes tile identifiers (tile id) of one or more tiles; and

obtaining the independently decodable area of the to-be-decoded picture according to the location identifier of the independently decodable area, and decoding the independently decodable area.

As described in the foregoing various implementation forms, optionally, the auxiliary message may further include an independently decodable area identifier, and the independently decodable area identifier is used to identify whether the picture includes the independently decodable area.

As described in the foregoing various implementation forms, optionally, the auxiliary message further includes cropping information used for decoding the independently decodable area, and the cropping information includes a horizontal coordinate or a vertical coordinate of a top, bottom, left or right border of the independently decodable view relative to the independently decodable area.

As described in the foregoing various implementation forms, optionally, the auxiliary message further includes profile information used for decoding the independently decodable area, and the profile information is used to identify a coding tool set in the independently decodable area.

As described in the foregoing various implementation forms, optionally, the auxiliary message further includes level information used for decoding the independently decodable area, the level information is used to identify level information that a decoder needs to satisfy, and the level information is obtained by means of calculation according to a ratio of the independently decodable area to the picture.

As described in the foregoing various encoding implementation forms, optionally, the step of encoding all tiles included in the to-be-encoded picture further includes: determining whether a current to-be-encoded tile is a tile in the independently decodable area; if yes, setting an independently decodable area of an encoded picture to be a candidate inter-frame reference area of the current tile; if no, setting a whole picture area of the encoded picture to be the candidate inter-frame reference area of the current tile; and when an inter-frame algorithm is used for encoding, selecting an optimal reference area according to the foregoing candidate inter-frame reference area corresponding to the to-be-encoded tile.

As described in the foregoing various implementation forms, optionally, the picture sequence includes pictures of different packing types and flipping types; and the configuration file stores a packing type and a flipping type of each frame of picture in the picture sequence, and independently decodable views corresponding to the pictures of different packing types and flipping types.

As described in the foregoing various implementation forms, optionally, the auxiliary message further includes location identifiers, which are corresponding to the pictures of different packing types and flipping types, of independently decodable areas.

As described in the foregoing various implementation forms, optionally, the auxiliary message further includes cropping information that is corresponding to the pictures of different packing types and flipping types and used for decoding the independently decodable areas.

As described in the foregoing various decoding implementation forms, optionally, the implementation forms further include: cropping the independently decodable area according to the cropping information in the auxiliary message to obtain the independently decodable view.

As described in the foregoing various implementation forms, optionally, the auxiliary message further includes profile information that is corresponding to the pictures of different packing types and flipping types and used for decoding the independently decodable areas.

As described in the foregoing various implementation forms, optionally, the auxiliary message further includes level information that is corresponding to the pictures of different packing types and flipping types and used for decoding the independently decodable areas.

As described in the foregoing various implementation forms, optionally, the auxiliary message is carried in supplemental enhancement information (Supplemental Enhancement Information, SEI).

As described in the foregoing various implementation forms, optionally, the auxiliary message is carried in a sequence parameter set (SPS).

A video encoding and decoding system, including the encoder provided in the foregoing various implementation forms and the decoder provided in the foregoing various implementation forms.

A video bitstream, including: a to-be-decoded video and an auxiliary message, where the to-be-decoded video includes a to-be-decoded picture sequence, and the auxiliary message includes a location identifier that indicates an independently decodable area of the picture sequence, where the location identifier of the independently decodable area includes tile identifiers (tile id) of one or more tiles.

Technical effects of the foregoing implementation forms are analyzed as follows: encoded

According to the foregoing encoding implementation forms, an auxiliary message is added to a bitstream, where Profile and Level information in the auxiliary message applies only to a sub-bitstream formed for an independently decodable area, which lowers a requirement for performance of a decoder.

According to the foregoing decoding implementation forms, a decoder may obtain, according to an auxiliary message, only an independently decodable area in a picture to perform decoding, that is, the decoding is performed only on the independently decodable area, thereby lowering a requirement for performance of the decoder and saving calculation and storage resources of the decoder. In addition, a profile and level requirement corresponding to a sub-bitstream of an independently encodable area generally lowers a requirement for performance and storage of the decoder. Therefore, after the decoder is initialized, decoding time and electric power consumption of the decoder can be reduced and the requirement for the storage of the decoder is lowered. If the decoder does not meet a profile and level requirement of an original video bitstream, but the decoder meets the profile and level requirement corresponding to a sub-bitstream of an independently encodable area, then support of the decoder for a 3D video bitstream that has a high requirement for a resolution or bit rate and is compatible with 2D display is increased.

