WO2009149671A1 - 视频数据的打包、编解码方法及装置及*** - Google Patents

视频数据的打包、编解码方法及装置及*** Download PDF

Info

Publication number
WO2009149671A1
WO2009149671A1 PCT/CN2009/072250 CN2009072250W WO2009149671A1 WO 2009149671 A1 WO2009149671 A1 WO 2009149671A1 CN 2009072250 W CN2009072250 W CN 2009072250W WO 2009149671 A1 WO2009149671 A1 WO 2009149671A1
Authority
WO
WIPO (PCT)
Prior art keywords
stripe
decoding
strip
encoding
macroblock
Prior art date
Application number
PCT/CN2009/072250
Other languages
English (en)
French (fr)
Inventor
何芸
毛振
郑萧桢
郑建铧
Original Assignee
华为技术有限公司
清华大学
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
Priority claimed from CN 200810110177 external-priority patent/CN101394550B/zh
Application filed by 华为技术有限公司, 清华大学 filed Critical 华为技术有限公司
Publication of WO2009149671A1 publication Critical patent/WO2009149671A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/438Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving encoded video stream packets from an IP network
    • H04N21/4382Demodulation or channel decoding, e.g. QPSK demodulation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234327Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by decomposing into layers, e.g. base layer and one or more enhancement layers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2383Channel coding or modulation of digital bit-stream, e.g. QPSK modulation

Definitions

  • the present invention relates to the field of video communication technologies, and in particular, to a method, device and system for packaging, encoding and decoding video data. Background of the invention
  • an image may be divided into a plurality of image blocks or macroblocks, and motion estimation is performed in units of blocks or macroblocks, and residuals after motion estimation are transformed and quantized, and finally, the quantized coefficients are entropy encoded.
  • the information obtained by entropy coding is written into the code stream.
  • Continuous image encoding information is included in the code stream, and the continuous image encoding information may be referred to as a video stream.
  • the video stream In order to send the video stream to the decoding end, the video stream needs to be packaged by data packetization, categorization, etc., to divide the video stream into a plurality of data packets containing the encoded data, so that the data packet passes through a specific network.
  • the video stream is transmitted to the decoder.
  • the purpose of the above packing process is to divide the video stream so that it can be adapted to be transmitted in the corresponding network.
  • the decoding end after receiving the data packet corresponding to the video stream sent by the encoding end, the decoding end combines the contents of the data packet in a certain manner with certain rules, and performs inverse quantization, inverse transform, motion compensation. A reconstructed image is obtained after processing.
  • the macroblocks may also be grouped together in a certain organization manner as a slice, and the corresponding strips may be combined into corresponding stripe sets. At this time, if a reasonable packing processing method can be adopted for the corresponding stripe or stripe set, the phenomenon of network packet loss and error diffusion will be effectively handled.
  • the packing method for the stripe and the stripe set includes: encapsulating the code stream obtained according to the encoded stripe data in a NAL (Network Abstraction Layer) unit, and grouping the single NAL unit into one data. package.
  • the packetization method used includes: First, converting data between every two adjacent start code prefixes (0x000001) in the code stream into one NAL unit, and then, a single NAL unit is grouped into one data packet.
  • the corresponding packet processing method reduces network packet loss and error resistance and decoding performance, thereby causing degradation of video transmission performance.
  • Embodiments of the present invention provide a method, a device, and a system for packaging, encoding, and decoding video data, so as to effectively improve the ability to resist network packet loss and error, and decoding performance, and improve video transmission effects.
  • a method of packaging video data including:
  • a packaging device for video data comprising:
  • a stripe set obtaining unit configured to obtain a stripe set to be sent, the stripe set includes one or more strips
  • a packing operation unit configured to collect, according to the stripe set acquired by the stripe set acquiring unit The encoding mode between the strips performs a packing operation on one or more strips included in the strip set.
  • a method of video encoding including:
  • an entropy coded fill symbol is written after encoding of a specific macroblock data in the stripe, the specific macroblock being at least the last macroblock in the stripe and at least before the last macroblock A macro block.
  • a video encoding device includes:
  • a strip coding unit configured to perform an encoding operation on the current stripe
  • an entropy coded padding unit configured to write an entropy coded padding after the encoding of the specific macroblock data in the stripe is performed in the stripe encoding unit, where the specific macroblock is The last macroblock in the stripe and at least one macroblock before the last macroblock.
  • a method of video decoding comprising:
  • the macroblock comprising the last macroblock in the stripe and at least one macro before the last macroblock Piece;
  • a video decoding device includes:
  • An entropy coded fill symbol reading unit configured to read an entropy coded fill symbol after decoding of the macroblock data in the stripe in a process of decoding a stripe, the macroblock comprising a last macroblock in the stripe And at least one macroblock before the last macroblock; and a determining unit, configured to detect whether the stripe decoding ends after the entropy coded padding unit reads the entropy coded padding symbol.
  • a method of video encoding including:
  • the encapsulation of the stripe data stream is performed according to the maximum number of bits that the entropy encoding can write to the end of the strip entropy encoding.
  • a video encoding device includes:
  • a strip coding unit configured to perform an encoding operation on the current stripe
  • a code stream filling unit configured to perform a filling operation of the stripe data code stream according to a maximum number of bits that can be written into the code stream when the entropy encoding ends at the end of the strip entropy encoding after the strip encoding unit ends the entropy encoding for the stripe .
  • a method of video decoding comprising:
  • the location detection stripe decoding is ended after the current position of the bitstream pointer, and the specified position is terminated according to the encoding end at the end of the strip entropy encoding.
  • the entropy coding can be determined by the maximum number of bits that can be written to the code stream.
  • a video decoding device includes: a decoding unit, configured to perform a decoding operation on the current stripe;
  • a decoding determining unit configured to: after the decoding unit completes the macroblock decoding in the stripe, specify whether the location detection stripe decoding ends after the current position of the bitstream pointer, where the specified location is according to the encoding end Entropy coding determines the maximum number of bits that can be written to the code stream at the end of strip entropy coding.
  • a method of video encoding including:
  • the end parameter information of the stripe generated at the end of the stripe is obtained, and the end parameter information of the stripe is written in the encoded code stream, where the end parameter information includes: the number of bits generated when the strip ends Or the number of macroblocks included in the stripe.
  • a video encoding device includes:
  • a strip coding unit configured to perform an encoding operation on the current stripe
  • An end parameter writing unit configured to write end parameter information of the stripe in the encoded code stream during the encoding stripe process, where the end parameter information includes: a bit generated when the strip ends The number or number of macroblocks included in the stripe.
  • a method of video decoding comprising:
  • the end parameter information includes: the number of bits generated at the end of the strip, or the number of macroblocks included in the stripe;
  • Whether the decoding of the strip is completed is determined according to the end parameter information.
  • a video decoding device includes:
  • the end parameter obtaining unit is configured to parse the end parameter information of the stripe in the encoded code stream during the decoding of the stripe, where the end parameter information includes: the number of bits generated when the strip ends, or the stripe includes Number of macroblocks;
  • a stripe decoding unit configured to determine, according to the end parameter information acquired by the end parameter acquiring unit, whether decoding for the current stripe is completed, to implement a decoding operation for the stripe.
  • the embodiment of the present invention adopts an implementation scheme of performing packet processing on a video stream according to an encoding manner between strips, thereby ensuring that data after being packaged is obtained.
  • the packet loss and error diffusion phenomenon can be effectively processed, and the performance of the video codec system is improved.
  • the end point of the strip can be quickly and accurately recognized at the decoding end, thereby improving the decoding accuracy.
  • the performance of the video codec system is further improved.
  • FIG. 1 is a schematic diagram of a stripe set division provided by an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a codec apparatus and system according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another codec apparatus and system according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a codec apparatus and system according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of another codec apparatus and system according to an embodiment of the present invention. Mode for carrying out the invention Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
  • one or more strips included in the stripe set may be according to an encoding manner between strips in the stripe set. Take the packing operation.
  • the coding manner may include, but is not limited to, an independent coding mode or a non-independent numbering mode.
  • the packet may be packed in a stripe set or a stripe set in a stripe according to a setting of a stripe set parameter and a network transmission condition, and the stripe set includes one or more A stripe, the strip may comprise macroblocks that are contiguous in scan order, for example, macroblocks that are contiguous in raster scan order.
  • the corresponding stripe set parameter may include, but is not limited to: a parameter for identifying whether the current stripe belongs to the current stripe set, or a parameter for identifying whether the current stripe set stripe has codec independence (ie, Whether the parameter is encoded by the independent coding method during the strip coding process, and other parameters related to the current stripe set packing, and so on.
  • the process of performing the packing operation on the stripe set according to the stripe set parameter may include: if the stripe set is a stripe coded by an independent coding mode, each strip of the strip set is respectively Independently encapsulated in a data packet; if the stripe set contains at least one stripe coded by non-independent coding, that is, the stripe set contains strips that are not encoded by independent coding, then the strips in the strip set are combined. Packaged in a single packet.
  • the packet processing may be performed according to the current network bandwidth, which may be: First, it may be determined according to the current network bandwidth. The number of stripes that can be encapsulated in a data packet. Then, according to the number of stripes that can be encapsulated, the strips in the stripe set are encapsulated in one or more data packets that meet the current network bandwidth transmission requirements.
  • the packaging manner that can be adopted includes:
  • all strips in the stripe set can be packaged as a whole according to the current stripe set parameter setting.
  • the stripe sets can be appropriately grouped according to the network bandwidth. , the strips in the strip set are separately packaged, that is, packed in units of strips in the strip set.
  • the network bandwidth can ensure that all the strips in the stripe set are packed together, if at least one stripe in the current stripe set has no codec independence from other strips (ie, no independent coding mode is used) Encoding, but encoding using data encoding between other strips between strips, can pack all the strips in the current stripe set as a whole. Otherwise, that is, there is coding independence between all the strips in the current stripe set, and each stripe in the stripe set can be separately packaged, that is, when a single packet is discarded, the decoding of other data packets in the stripe set is not affected, Guarantee the corresponding anti-error performance.
  • the packet processing method used in the prior art needs to be correspondingly based on the original strip packing mode. Operation to adapt to the needs of the new packaged form; for example, for code streams based on the start code prefix (such as AVS video stream, etc.), the start code between the strips can no longer be split, only the first one is removed.
  • start code prefix such as AVS video stream, etc.
  • Embodiment 1 When executed, includes all or part of the processing steps described in the embodiments of the present invention, wherein the storage medium may be, but not limited to, a ROM/RAM, a magnetic disk or an optical disk.
  • the storage medium may be, but not limited to, a ROM/RAM, a magnetic disk or an optical disk.
  • slice-set-index parameter the stripe set sequence number, used to identify different stripe sets in the image, and the stripe with the same slice-set-index value belongs to the same stripe set;
  • slice-independency parameter the stripe independence flag, which is used to identify whether each strip in the current stripe set has codec independence.
  • the slice-independency value of 1 can be used to represent the current intra-strip macro. Block codec can only use the data in this stripe.
  • the slice_independency value is 0, it means that the stripe data with the same s 1 i ce_set_index in the current image can be used in the encoding and decoding of the macroblock in the current stripe. , that is, the data corresponding to other strips in the same strip set.
  • the corresponding stripe set can be divided as shown in Figure 1, where A, BO, C, Bl, D, B2, E are strips; Row O ⁇ Row
  • A, C, and D belong to the same stripe set, B0, Bl, and B2 belong to another stripe set, and stripe E belongs to the third stripe set; then three strips A, C, and D can be sliced-set — index is 0, BO, Bl, B2 Three stripe-set—index is 1; E's slice—set—index is 2 ⁇
  • the slice-independency value corresponding to each stripe can be set to: Slice, independency values of the three strips of A, C, and D are set to slice_independency values of three strips of 1, 1, 1, B0, Bl, and B2, respectively. Set to: 0, 0, 0; Stripe E belongs to a stripe set, so its slice_independency value can be set to 1.
  • the codec processing of any of the three intra-band macroblocks A, C, and D cannot use the data of the other two strips; B0, Bl, B2 are in the three strips.
  • the codec processing of any intra-band macroblock can use the data of the other two stripe; the codec processing of the intra-tree macroblock cannot use the data of other stripe.
  • the stripping processing can be used to package each stripe:
  • the three strips A, C, and D in the strip set 1 are independent, the three strips A, C, and D can be packed in any combination; if a certain anti-error performance is guaranteed, A, C, D can be packaged separately, so that if any one of the packets is lost, it will not affect the decoding operation for other packets;
  • the strips B0, Bl, and B2 in the strip set 2 are not independent, the strips B0, Bl, and B2 can be packaged as a whole; for example, for the AVS stream, only The start code prefix before the B0 strip code stream is removed, and the data to the B2 strip is ended. So far, mapped into one NAL unit; for the H.264 standard in NAL, the data of the strips B0, Bl, B2 can be combined into one NAL unit;
  • the embodiment of the present invention further provides a packetizing apparatus for video data, and the specific implementation structure thereof is as shown in FIG. 2, and may include the following processing unit:
  • a stripe set obtaining unit 201 configured to acquire a stripe set to be sent, where the stripe set includes one or more strips, where the stripe may be a continuous macroblock according to a scanning order. , such as continuous macroblocks in raster scan order;
  • a packing operation unit 202 configured to perform a packing operation on one or more strips included in the strip set according to an encoding manner between strips in the stripe set acquired by the stripe set acquiring unit;
  • the packaging operation unit specific 202 may include at least one of the following units:
  • the first packet processing unit 2021 is configured to separately package each strip in the strip set into one data packet when the strips in the strip set are encoded by the independent coding mode;
  • a second packet processing unit 2022 configured to: when the stripe set includes at least one stripe coded by a non-independent coding method (that is, a stripe set includes a stripe that is not encoded by an independent coding manner), each strip of the stripe is concentrated The tape combination is packaged in a single packet.
  • a non-independent coding method that is, a stripe set includes a stripe that is not encoded by an independent coding manner
  • the corresponding second packet processing unit 2022 may specifically include the following units:
  • a stripe number determining unit 20221 configured to determine, according to a current network bandwidth, a number of stripes that can be encapsulated in one data packet, so as to determine a size of the data packet according to the number of the stripe;
  • the packet performing unit 20222 is configured to encapsulate the stripe in the stripe set into one or more data packets according to the number of strips that can be encapsulated in the data packet determined by the stripe data determining unit, that is, in the stripe A number of strips are used to encapsulate data packets.
  • the second packet processing unit 2022 may further include:
  • a code stream packing unit based on a start code prefix, configured to remove a start code prefix of a first one of the plurality of strips, and a start code prefix of the other strips is retained, and then map the plurality of strips into a NAL unit;
  • a stream unit based code stream packing unit is configured to combine a plurality of stripe data that need to be combined and packaged into one NAL unit.
  • the bit length of the stripe data written in the code stream has an unpredictable characteristic, so that the decoding end cannot accurately know the length of the stripe data in the code stream, so that The decoding process cannot reliably perform decoding operations
  • the embodiment of the present invention further provides a codec scheme for video data, so that in the process of encoding and decoding the corresponding data, it is possible to accurately determine whether the current stripe is encoded during the video data processing. Or the decoding ends.
  • the CABAC coded stripe it is necessary to write 1 bit at the end of the strip to end the current stripe encoding. If the bit is only written at the end of the stripe encoding, the decoding end can only be in the last strip. After the macroblock is decoded, the bit is read, but the decoder cannot know whether the currently decoded macroblock is the last macroblock of the stripe.
  • the entropy encoding padding symbol may be written after the macroblock data encoding ends, wherein the corresponding macroblock includes the last macroblock in the stripe and finally At least one macroblock before a macroblock, that is, at least one macroblock encoding before the last macroblock in the stripe, in addition to writing the entropy coded fill symbol after the end of the last macroblock encoding of the stripe After the end, the corresponding entropy coded fill symbol is written. Since the entropy coded padding is written in the CABAC encoding process, the symbol is written in binary arithmetic coding (both CABAC coding).
  • At least one macroblock preceding the last macroblock in the stripe may be specifically written after encoding a macroblock or a macroblock row or a specified number of macroblocks.
  • the specific number of the specified number of macroblocks may be preset according to the codec end.
  • the bit stuffing process may also be performed, and End encoding at the fill to byte alignment position. For example, after writing a bit ' , , it is judged whether the bytes are aligned. If the bytes are not aligned, the bit ' 0 ' is written until the byte alignment is completed, and if the bytes are aligned, the strip coding is ended.
  • the corresponding entropy coded fill symbol may be a one-bit fill symbol or a multi-bit fill symbol.
  • the value of the entropy coded fill symbol corresponding to the macroblock before the last macroblock in the stripe may be opposite to the value of the entropy coded fill symbol corresponding to the last macroblock in the stripe; for example, if the strip The value of the entropy coded fill symbol with the last coded macroblock (ie the last macroblock) is a pre-set value and is '0' or ' ⁇ ; then the strip is not the last coded macroblock (ie the last one)
  • the value of the entropy coded fill symbol of the macroblock before the macroblock is a value that is preset to be opposite to the value of the entropy coded fill symbol of the last coded macroblock of the stripe, and is ' or '0'.
  • the entropy encoding padding symbol may be read after the macroblock data decoding ends, and the corresponding macroblock includes the last in the stripe. a macroblock and at least one macroblock before the last macroblock; and after the read entropy coded fill symbol, detecting whether the stripe decoding ends, if the stripe decoding is not finished, continuing to decode the next one of the strips Macroblock, until the stripe decoding ends. Since the entropy coded fill symbol is read during CABAC decoding, the symbol is read in binary arithmetic (both CABAC decoding).
  • the operation process of detecting whether the strip decoding is completed may adopt any one of the following processing methods: (1) Treatment method 1
  • the bit stream pointer is judged Whether the next byte alignment is 0x80, and whether it is a start code after 0x80, if yes, the strip decoding ends; otherwise, the stripe decoding does not end;
  • the current bit stream pointer is located at the byte alignment, it is determined whether the content after the current bit stream pointer to the byte alignment is equal to the padding template, and the padding template is 1 ⁇ (7- ⁇ ), where n is the code stream pointer If the position of the current byte is offset, if it is equal to the padding template, the stripe decoding ends; otherwise, the stripe decoding is not ended;
  • the current bit stream pointer is located at the byte alignment, it is determined whether the content after the current bit stream pointer to the byte alignment is equal to the padding template, and the padding template is 1 ⁇ (7- ⁇ ), where n is the code stream pointer If the position of the current byte is offset, if it is equal to the padding template, it is judged whether the next byte alignment of the bit stream pointer is the start code, and if so, the strip decoding ends; otherwise, the strip decoding is not ended; or, judging Whether the next byte alignment of the bit stream pointer is 0x80, and whether it is a start code after 0x80. If yes, the stripe decoding ends. Otherwise, the stripe decoding does not end; if it is not equal to the padding template, the stripe decoding does not end. .
  • the specific implementation process of this embodiment will be described in detail below.
  • CABAC padding bit ie, an entropy coded padding
  • cabac_mb stuffing— bit
  • the operation of ending the stripe encoding is performed, and the operation of the end of the striping encoding is recorded as: is_end_of_si ice (); the is-end_of_slice
  • the specific process may include: writing 1 bit ' at the end of the stripe data, and determining whether the byte is aligned, and ending the current stripe encoding if the byte is aligned; otherwise, padding the bit '0' to byte alignment With the end of the code.
  • the value of the CABAC padding bit written by the encoding end after the last macroblock encoding in the stripe is a predetermined value, which may be '0' or ' ⁇ , when other macroblocks in the stripe are encoded.
  • the value of the CABAC padding bit to be written is not specified. If the coding efficiency is improved, the value written at the end of the encoding of the other macroblocks in the stripe may be the CABAC padding bit corresponding to the last macroblock in the stripe. The values are reversed. For example, if the value of the CABAC padding bit of the last macroblock in the stripe is ' ⁇ , then the value of the CABAC padding bit of the other macroblocks should be ' 0 ' .
  • the process may specifically include: if the current byte is aligned, determine whether the 32 bits after the current bit stream pointer is 0x80000001 (BP l bytes plus a starting code of 24 bits), if yes, Bay ij current The stripe decoding ends, otherwise, the next macroblock continues to be decoded; if the current byte is not aligned, it is judged whether the content after the current bitstream pointer to the byte alignment is equal to the padding template stuf fing pattern and starting from the byte alignment Whether the 24 bits are the start code Ox 000001, and if so, the current strip decoding ends, otherwise, the next macro block continues to be decoded, wherein the stuffing pattern is 1 « (7-n) ,
  • the decoding end since the encoding end writes the corresponding CABAC padding bit after encoding for one macroblock or one macroblock row or a specified number of macroblocks, the decoding end performs for one macroblock or A macroblock row or a specified number of macroblocks can be read after the corresponding CABAC padding bits are decoded, and thus, does not result in encoding and decoding specialization of the last macroblock in the stripe (i.e., strip end macroblock).
  • strip end macroblock i.e., strip end macroblock.
  • the embodiment of the present invention further provides a video encoding apparatus, and the specific implementation structure thereof is as shown in FIG. 3, and may include: a stripe encoding unit 301, configured to perform an encoding operation on a current stripe;
  • An entropy coded padding write unit 302 configured to write an entropy coded padding symbol after the end of the macroblock data encoding in the process of encoding the stripe by the slice encoding unit 501, the macroblock including the last one of the strips The macroblock and at least one macroblock before the last macroblock.
  • the corresponding entropy coded padding symbol can be, but is not limited to, one bit of information, and for at least one macroblock preceding the last macroblock in the stripe, a macroblock or a macroblock row or a specified number of macroblocks can be encoded. After that, the corresponding entropy coded fill symbol is written. .
  • the embodiment of the present invention further provides a video decoding apparatus.
  • the specific implementation structure is still shown in FIG. 3, and may include: an entropy coding padding symbol reading unit 303, configured to decode macroblock data in the process of decoding a stripe. Reading an entropy coded padding symbol after the end, the macroblock comprising a last macroblock in the stripe and at least one macroblock preceding the last macroblock;
  • the determining unit 304 is configured to detect, after the entropy coded padding symbol read by the entropy coded padding symbol reading unit 303, whether the stripe decoding ends;
  • the determining unit 304 may specifically include:
  • a first determining operation unit 3041 configured to determine, in a case where the current bit stream pointer is located at a byte alignment, whether the next byte alignment of the bit stream pointer is a start code, and if so, the strip decoding ends, otherwise, The band decoding is not finished; or, it is judged whether the bit alignment of the bit stream pointer is 0x80, and whether it is a start code after 0x80, if yes, the stripe decoding ends; otherwise, the stripe decoding is not ended;
  • the second determining operation unit 3042 is configured to determine, when the current bit stream pointer is located at the byte alignment, whether the content after the current bit stream pointer to the byte alignment is equal to the padding template, where the padding template is 1 ⁇ ( 7- ⁇ ) , where n is the bit offset of the current stream pointer at the current byte, and if equal to the padding template, the first decision operation unit or the stripe decoding is notified to end; otherwise, the stripe decoding is not ended.
  • the second determining operation unit 3042 can be replaced by a third determining operation unit.
  • the third determining operation unit is configured to determine, when the current bit stream pointer is located at the byte alignment, whether the content after the current bit stream pointer to the byte alignment is equal to the padding template, and the padding template is 1 ⁇ (7- ⁇ ), where n is the code stream pointer offset at the position of the current byte, and if equal to the padding template, the first decision operation unit is notified; if not equal to the padding template, the stripe decoding is not ended.
  • the embodiment of the present invention further provides a codec system, which is still composed of a corresponding video encoding device and a corresponding video decoding device, and the encoding and decoding processes specifically used by the corresponding video encoding device and video decoding device are still shown in FIG. It has been described in detail in the previous method embodiments, and therefore will not be described in detail herein.
  • the encoding end After the strip entropy encoding ends, the encoding end performs the filling operation of the stripe data stream according to the maximum number of bits that the entropy encoding may write to the code stream at the end of the strip entropy encoding.
  • the difference between the maximum number of bits of the possible write code stream and the number of bits in the strip code end operation written into the code stream may be calculated first, and then Filling the code stream with the number of bits corresponding to the difference; for example, the bit '0' or ' ⁇ can be used to perform the corresponding operation of filling the strip data.
  • the bitstream pointer is specified at the position of the bitstream pointer after the current position of the bitstream pointer to determine whether the stripe decoding ends (ie, whether the stripe end processing has been reached), wherein
  • the specified position is a number of specified bits after the current position of the bit stream pointer, and the corresponding number of designated bits is the maximum number of bits that the encoding end may entropy encode into the code stream at the end of the strip entropy encoding.
  • the number of designated bits may be a preset value.
  • the strip decoding operation can be further performed according to the corresponding detection judgment result.
  • CABAC coding the maximum number of bits that may be written into the code stream after writing the coded end symbol at the end of the strip coding is calculated according to the CABAC coding characteristic, and then the code end is for the stripe.
  • the code stream is filled according to the maximum number of bits of the possible write code stream, wherein the bit value of the write code stream is filled ( "0" or "1" can be determined by the encoding end, and then the is-end-of-slice () operation.
  • CABAC decoding after decoding the strip at the decoding end and decoding a macroblock, several bits start the is-end-of-slice () operation after the current position pointed by the bit stream pointer. To determine whether the stripe decoding ends, the corresponding number of bits is the maximum number of bits of the above-mentioned possible code stream.
  • the principle of using the above codec scheme is that the accuracy of the arithmetic engine of the CABAC codec is limited, so the number of bits that the arithmetic engine can write into the code stream after the end of the stripe encoding is written is limited.
  • additional padding bits can be written at the end of the stripe encoding, so that after decoding the macroblock, the decoder can know where the bitstream pointer needs to start the stripe decoding.
  • the maximum number of bits that may be written into the code stream is 34.
  • the embodiment of the present invention further provides a video encoding apparatus, and the specific implementation structure thereof is as shown in FIG. 4, and specifically includes: a stripe encoding unit 401, configured to perform an encoding operation on a current stripe;
  • a code stream filling unit 402 configured to perform, after the slice encoding unit 401 ends the entropy encoding for the stripe, perform a stripe data stream according to a maximum number of bits of the entropy encoding end code entropy encoding at the end of the strip entropy encoding Fill operation.
  • the embodiment of the present invention further provides a video decoding apparatus, and the specific implementation structure is still shown in FIG. a decoding unit 403, configured to perform a decoding operation on the current stripe;
  • a decoding determining unit 404 configured to: after the decoding unit 403 finishes decoding the macroblock data, determine whether the stripe decoding ends after the bitstream pointer is in the current position of the bitstream pointer, where the specified location is encoded according to the encoding The end number is determined by the maximum number of bits that the entropy code may write to the code stream at the end of the strip entropy coding.
  • the embodiment of the present invention further provides a codec system, which is still composed of a corresponding video encoding device and a corresponding video decoding device, and the encoding and decoding processes specifically used by the corresponding video encoding device and video decoding device are
  • a codec system which is still composed of a corresponding video encoding device and a corresponding video decoding device, and the encoding and decoding processes specifically used by the corresponding video encoding device and video decoding device are
  • the corresponding data may be packaged or unpacked according to the end judgment condition of the processed data.
  • the embodiment of the present invention further provides a judgment condition of a corresponding stripe set and a codec end corresponding to the independent stripe, and a corresponding data processing process, wherein the independent stripe generated in the encoding process is a strip of a traditional meaning. It does not contain stripe set parameters, and the strips in each stripe set generated during the encoding process have a common stripe set parameter.
  • the end parameter information of the stripe may be written into the encoded code stream during the encoding stripe process, so that the decoding end can judge whether the decoding for the current stripe ends according to the end parameter information.
  • the process of writing the end parameter information of the stripe may be any one of the following processes according to different end parameter information:
  • the process of writing the number of bits generated at the end of the strip to the code stream may include: writing a special identifier after the bit stream corresponding to the stripe data in the code stream (eg, 00000000000000000011 or 00000000000000000000, etc.)
  • the special identifier is used to indicate a parameter in the code stream that includes the number of bits generated at the end of the stripe; and then, after the special identifier, the parameter of the number of bits generated at the end of the stripe is written into the code stream, and
  • the number of bits generated at the end of the strip may be, but is not limited to, written into the code stream using a variable length code.
  • the encoding end may write the current stripe inclusion in the stripe header
  • the number of macroblocks correspondingly, at the decoding end, it can judge whether the decoding process for the current stripe ends according to the number of macroblocks included in the current stripe in the strip header, that is, if the number of decoded macroblocks is equal to the macro included in the current stripe
  • the number of blocks ends with the decoding process, otherwise the decoding operation for the macroblock of the current stripe continues.
  • the encoding end may write an end identifier of the stripe set in the code stream, for indicating that the current stripe set encoding ends, for example, in the bit One bit of information is written in the stream as the end identifier of the stripe set, etc.
  • the decoding end it can be determined according to the terminator whether the current stripe set has been decoded to achieve accurate decoding.
  • the strips included in the corresponding strip set have common strip set parameters; the corresponding strips do not contain strip set parameters, and the corresponding strips may be strips in the strip set, or For independent strips.
  • the embodiment of the present invention further provides an implementation scheme of corresponding video decoding, which parses and obtains the encoded code stream in the process of decoding a stripe.
  • the end parameter information of the strip in the medium and determining whether the decoding for the current strip is completed according to the end parameter information to implement a decoding operation for the stripe.
  • Corresponding end parameter information may include: the number of bits generated at the end of the stripe; or the number of macroblocks included in the stripe.
  • the process of obtaining the end parameter information of the stripe in the encoded code stream is first decoded to obtain the bit code corresponding to the stripe data in the code stream.
  • a special identifier after the stream which is used to indicate a parameter in the code stream that includes the number of bits generated at the end of the stripe; after the special identifier, the number of bits generated at the end of the stripe can be parsed.
  • the process of determining whether the decoding of the current stripe is completed according to the end parameter information may include:
  • the current bitstream pointer is forwarded, and the pre-shifted number is the number of bits generated when the stripe obtained by the corresponding decoding ends;
  • the process of determining whether the decoding of the current stripe is completed according to the end parameter information may include: parsing the number of macroblocks included in the stripe of the encoded stream, In the process of decoding the stripe, if the number of decoded macroblocks is equal to the number of macroblocks included in the corresponding stripe, the stripe decoding ends, otherwise, the next macroblock or macroblock row data is continued to be decoded until the current stripe decoding ends.
  • CABAC Adaptive Binary Arithmatic Coding
  • CABAC CABAC encoding
  • the CABAC decoding operation is decode-terminate()
  • the number of bits written in the encoding end due to the CABAC encoding property terminate-slice () cannot be prior. It is known that the decoding end cannot know the number of bits to be read by the decoding end decoding-terminate () process in advance.
  • the following processing manners may be adopted on the encoding end and the decoding end respectively to solve the corresponding problem.
  • the number of bits generated at the end of the stripe of the terminate-slice () process is recorded, and may be, but is not limited to, the variable length code mode (the number of bits generated at the end of the stripe) is written into the code stream. .
  • a special identifier may be first written in the code stream, and the special identifier currently exists only when the number of bits generated by the terminate-slice () process is written, ie
  • the special identifier indicates a parameter in the code stream that includes the number of bits generated at the end of the stripe.
  • the special identifier can be, but is not limited to, 00000000000000 0000000011, that is, 22 '0' plus '1 ⁇ .
  • the corresponding process of writing the parameter (that is, the number of bits generated at the end of the strip) into the code stream may include: after the stripe data is encoded, first writing a padding bit ', and then writing the padding bit '0 ' Until byte alignment; after byte alignment, write the special identifier to the code stream and write the number of bits generated at the end of the stripe of the terminate-slice() procedure; finally write a padding bit' , and then write the padding bit '0' in turn until byte alignment.
  • the preset special identifier is first found in the stripe data.
  • the special identifier is assumed to be: 00000000000000000011, that is, 22 '0' plus ' 11 ' ;
  • the number of bits to be read by the decoding end decode_terminate process is read by the variable length code after the identifier, that is, the encoding terminal terminate-slice () process The number of bits generated at the end of the stripe; after obtaining the parameters of the number of bits generated at the end of the corresponding stripe, the stream pointer is relocated to the beginning of the stripe data, and the stripe data is decoded.
  • the code stream pointer is advanced, and the bit number of the forward shift is the decode_terminate ()
  • the number of bits to be read by the process ie the number of bits generated at the end of the strip obtained by decoding); afterwards, the corresponding processing includes the following two cases:
  • the special identifier is assumed to be: 000000000000000000000011, that is, 22 '0' plus '1 ⁇
  • the bit stream is also After the pointer moves to the parameter in the code stream indicating the number of bits to be read by the decode_terminate() procedure, if not, the bitstream pointer is shifted back by the bit to be read by the decode_terminate() procedure The number, and continue to decode the next macroblock data until the stripe decoding ends.
  • the number of bits in the code stream (the number of bits of the coded stripe) is written by the t erminate_slice() process after the end of the current stripe encoding. That is, the number of bits generated at the end of the stripe is 5, and the specific way of writing the code stream may be to write 22 0's and '11's in the byte alignment after terminate_slice(), and then The Columbus code is written to 00110 (that is, the number of bits generated at the end of the strip is 5).
  • the decoding end first obtain 22 0 plus '1 positions between the two start codes, and then read the number of bits generated at the end of the strip 5, false Let the current macroblock decoding end bit stream pointer point to the position of 19, then shift the bit stream pointer forward by 5 bits to the position of 24, and continue to find the byte aligned position from the position where the bit stream pointer is 24, and The byte aligned position begins to determine if the special identifier is present, and if so, the stripe decoding ends, otherwise the next macroblock continues to be decoded and resumes until the stripe decoding ends.
  • the embodiment of the present invention further provides a video encoding apparatus, and the specific implementation structure thereof is as shown in FIG. 5, and may include: a stripe encoding unit 501, configured to perform an encoding operation on a current stripe;
  • the end parameter writing unit 502 is configured to write the end parameter information of the stripe in the encoded code stream during the encoding stripe process by the strip encoding unit 501; the end parameter information may include: a bit generated when the strip ends Number; or, the number of macroblocks the strip contains.
  • the end parameter writing unit 502 may specifically include:
  • the special identifier writing unit 5021 is configured to write a special identifier after the bit code stream corresponding to the stripe data in the code stream obtained by the strip encoding unit 501, where the special identifier is used to indicate that the code stream includes a parameter for the number of bits generated at the end of the stripe; a bit number writing unit 5022 for writing the parameter of the number of bits generated when the strip ends at the special identifier written by the special identifier writing unit 5021. In the code stream.
  • the embodiment of the present invention further provides a video decoding apparatus, and the specific implementation structure is as shown in FIG. 6, which may include: an end parameter obtaining unit 601, configured to parse and obtain a stripe in the encoded code stream in the process of decoding a stripe.
  • the end parameter information may include, but is not limited to, the number of bits generated at the end of the stripe; or the number of macroblocks included in the stripe.
  • the stripe decoding unit 602 is configured to determine, according to the end parameter information acquired by the end parameter obtaining unit 601, whether the decoding for the current stripe is completed, to implement a decoding operation for the stripe.
  • the end parameter obtaining unit 601 may specifically include:
  • the special identifier obtaining unit 6011 is configured to decode a special identifier after obtaining a bit code stream corresponding to the stripe data in the code stream, where the special identifier is used to indicate that the bit stream generated in the code stream is included at the end of the stripe Number of parameters;
  • the bit number obtaining unit 6012 is configured to parse and obtain the number of bits generated at the end of the stripe after the special identifier acquired by the special identifier acquiring unit 6011.
  • the strip decoding unit 402 may specifically include:
  • the pointer shift processing unit 6021 is configured to: before a macroblock or a macroblock row data decoding ends, advance the current bitstream pointer, where the pre-shift number is a number of bits generated when the strip ends;
  • the first determining unit 6022 is configured to determine whether the current position of the bit stream is a byte aligned position
  • the second determining unit 6023 is configured to determine, when the corresponding first determining unit 6022 determines that the current location is not a byte aligned position, determine whether the location of the next byte of the current location is the special identifier; if the current location is determined Byte aligned position, then Determining whether the special identifier is after the current location;
  • the judgment result processing unit 6024 is configured to determine, at the second determining unit 6023, that the corresponding position is the special identifier, and then determine that the strip decoding ends. Otherwise, after the number of bits generated after the end of the bit stream pointer is shifted, continue The next macroblock or macroblock row data is decoded until the current stripe decoding ends.
  • the decoding process specifically used by the video decoding apparatus described above has been described in the foregoing method embodiments, and therefore will not be described in detail herein.
  • the embodiment of the present invention further provides a codec system, which is composed of the video encoding device and the corresponding video decoding device provided by the foregoing embodiments.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
  • ROM read-only memory
  • RAM random access memory
  • the strips in the stripe set can be separately packaged into different data packets, thereby improving the video transmission process.
  • it in the process of packing multiple strips into one data packet, it can also be packaged according to network bandwidth, so that the packaged data packet can be well adapted to the network transmission environment.
  • the present invention can be implemented by hardware, or can be implemented by means of software plus necessary general hardware platform, and the technical solution of the present invention. It may be embodied in the form of a software product, which may be stored in a computer readable storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for making a computer device (may be A personal computer, server, or network device, etc., performs the methods described in various embodiments of the present invention.
  • a computer readable storage medium which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.
  • a computer device may be A personal computer, server, or network device, etc., performs the methods described in various embodiments of the present invention.

Landscapes

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

Description

视频数据的打包、 编解码方法及装置及***
本申请要求了 2008年 06月 13日提交的、 申请号为 200810110177. 1、 发明名称为 "视频数据的打 包方法及装置", 以及 2008年 06月 19日提交的、 申请号为 200810129023. 7、 发明名称为 "视频数据 的打包、 编解码方法及装置及***"的中国申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及视频通信技术领域, 尤其涉及一种视频数据的打包、 编解码方法及装置及***。 发明背景
在视频编解码***中, 可以将图像划分成若干图像块或者宏块, 并以块或宏块为单位进行运动 估计, 将运动估计后的残差进行变换、 量化, 最后对量化系数进行熵编码, 将熵编码后得到的信息 写入码流中。
在码流中包含了连续图像编码信息, 该连续图像编码信息可称为视频流。 为将所述视频流发送 给解码端, 在编码端还需要对所述视频流进行数据分组、 归类等打包处理将其分成若干含有编码数 据的数据包, 以便通过数据包经特定网络将相应的视频流传输至解码端。 上述打包处理的目的在于 将视频流进行分割以便其可以适合在相应网络中传输。
在视频编解码***中, 解码端在接收到编码端发来的视频流对应的数据包之后会以一定规则将 数据包中的内容以一定方式组合起来, 并经反量化、 反变换、 运动补偿处理后得到重建图像。
在视频编码过程中, 在将图像分割成宏块后还可以将宏块以一定组织方式组合在一起称之为 slice ( 条带) , 且相应的条带可以组合为相应的条带集。 此时, 若可以针对相应的条带或条带集 采用合理的打包处理方式, 则将有效处理网络丢包及误差扩散的现象。
目前, 针对条带及条带集采用的打包方法包括: 将根据编码条带数据得到的码流封装在一个 NAL ( Network Abstraction Layer, 网络提取层) 单元中, 并将单个 NAL单元打成一个数据包。 采用的打 包方式包括: 首先将码流中每两个相邻的起始码前缀 (0x000001 ) 之间的数据转换为一个 NAL单元, 然后, 再将单个 NAL单元打成一个数据包。
在实现本发明过程中, 发明人发现现有技术中至少存在如下问题:
在上述针对视频流的打包方法中, 由于受到图像中条带的组合关系等因素的影响, 使得相应的 打包方式处理网络丢包及抗误差的能力及解码性能降低, 进而导致视频传输性能下降。
发明内容 本发明的实施例提供了一种视频数据的打包、 编解码方法及装置及***, 以有效提高抗网络丢 包及抗误差的能力, 及解码性能, 改善视频传输效果。 一种视频数据的打包方法, 包括:
获取待发送的条带集, 所述条带集包括一个或多个条带; 根据所述条带集中的各条带之间的编码方式, 对所述条带集中包含的一个或多个条带进行打包 操作。
一种视频数据的打包装置, 包括:
条带集获取单元, 用于获取待发送的条带集, 所述的条带集包括一个或多个条带; 打包操作单元, 用于根据所述条带集获取单元获取的条带集中的各条带之间的编码方式, 对所 述条带集中包含的一个或多个条带进行打包操作。
一种视频编码的方法, 包括:
在编码条带过程中, 在所述条带中的特定宏块数据编码结束后写入熵编码填充符号, 所述特定 宏块为条带中的最后一个宏块及最后一个宏块之前的至少一个宏块。
一种视频编码装置, 包括:
条带编码单元, 用于对当前条带进行编码操作;
熵编码填充符号写入单元, 用于在所述条带编码单元编码条带过程中, 在所述条带中的特定宏 块数据编码结束后写入熵编码填充符号, 所述特定宏块为条带中的最后一个宏块及最后一个宏块之 前的至少一个宏块。
一种视频解码的方法, 包括:
在解码条带过程中, 在所述条带中的宏块数据解码结束后读取熵编码填充符号, 所述宏块包含 条带中的最后一个宏块及最后一个宏块之前的至少一个宏块;
在读取到所述熵编码填充符号后, 检测条带解码是否结束。
一种视频解码装置, 包括:
熵编码填充符号读取单元, 用于在解码条带过程中, 在所述条带中的宏块数据解码结束后读取 熵编码填充符号, 所述宏块包含条带中的最后一个宏块及最后一个宏块之前的至少一个宏块; 判断单元, 用于在所述熵编码填充符号读取单元读取到熵编码填充符号后, 检测条带解码是否 结束。
一种视频编码的方法, 包括:
在条带熵编码结束后, 根据条带熵编码结束时熵编码能够写入码流的最大比特数目进行条带数 据码流的填充操作。
一种视频编码装置, 包括:
条带编码单元, 用于对当前条带进行编码操作;
码流填充单元, 用于在所述条带编码单元结束针对条带的熵编码后, 根据条带熵编码结束时熵 编码能够写入码流的最大比特数目进行条带数据码流的填充操作。
一种视频解码的方法, 包括:
在解码条带过程中, 在所述条带中的宏块解码结束后, 在比特流指针当前位置后指定位置检测 条带解码是否结束, 所述指定位置根据编码端在条带熵编码结束时熵编码能够写入码流的最大比特 数目确定。
一种视频解码装置, 包括: 解码单元, 用于对当前条带进行解码操作;
解码判断单元, 用于在所述解码单元在完成所述条带中的宏块解码结束后, 在比特流指针当前 位置后指定位置检测条带解码是否结束, 其中, 所述指定位置根据编码端在条带熵编码结束时熵编 码能够写入码流的最大比特数目确定。
一种视频编码的方法, 包括:
在编码条带过程中, 获取条带结束时产生的条带的结束参数信息, 在编码码流中写入条带的结 束参数信息, 所述结束参数信息包括: 条带结束时产生的比特数目或者条带包含的宏块数目。
一种视频编码装置, 包括:
条带编码单元, 用于对当前条带进行编码操作;
结束参数写入单元, 用于在所述条带编码单元进行编码条带过程中, 在编码码流中写入条带的 结束参数信息, 所述结束参数信息包括: 条带结束时产生的比特数目或者条带包含的宏块数目。
一种视频解码的方法, 包括:
在解码条带过程中, 解析获得码流中的条带的结束参数信息, 所述的结束参数信息包括: 条带 结束时产生的比特数目, 或者, 条带包含的宏块数目;
根据所述结束参数信息确定条带的解码是否完成。
一种视频解码装置, 包括:
结束参数获取单元, 用于在解码条带过程中, 解析获得编码码流中的条带的结束参数信息, 所 述的结束参数信息包括: 条带结束时产生的比特数目, 或者, 条带包含的宏块数目;
条带解码单元, 用于根据所述结束参数获取单元获取的结束参数信息确定针对当前条带的解码 是否完成, 以实现针对条带的解码操作。
由上述本发明的实施例提供的技术方案可以看出, 本发明实施例由于采用了根据条带之间的编 码方式对视频流进行打包处理的实现方案, 从而可以保证在通过对打包后的数据包进行视频流传输 的过程中, 可以有效处理网络丢包及误差扩散的现象, 提高视频编解码***的性能。 本发明实施例 中, 由于在编码条带过程中, 向码流中写入了相应的结束参数信息, 从而使得在解码端可以快速、 准确识别出条带结束点, 从而提高解码的准确性, 进一步提高了视频编解码***的性能。 附图简要说明
图 1为本发明实施例 •提供的条带集划分示意图;
图 2为本发明实施例 提供的装置的结构示意图;
图 3为本发明实施例 .提供的一种编解码装置及***的结构示意图;
图 4为本发明实施例 .提供的另一种编解码装置及***的结构示意图;
图 5为本发明实施例 .提供的一种编解码装置及***的结构示意图;
图 6为本发明实施例 .提供的另一种编解码装置及***的结构示意图。 实施本发明的方式 下面将参考附图详细说明本发明实施例。
本发明实施例中, 在获取待发送的包含一个或多个条带的条带集后, 可以根据条带集中的各条 带之间的编码方式, 对条带集中包含的一个或多个条带进行打包操作。 其中, 所述的编码方式可以 包括但不限于独立编码方式或非独立编号方式等。
本发明实施例中, 具体可以根据条带集参数的设置情况以及网络传输条件等, 以条带集或者条 带集中的若干条带为单位进行打包, 所述的条带集中包含一个或多个条带, 所述的条带可以包括按 照扫描顺序连续的宏块, 例如, 按照光栅扫描顺序连续的宏块。 其中, 相应的条带集参数可以包括 但不仅限于: 用于标识当前条带是否属于当前条带集的参数, 或者, 用于标识当前条带集中条带是 否具有编解码独立性的参数 (即对条带编码过程中是否采用了独立编码方式进行编码的参数) , 以 及其它与当前条带集打包相关的参数, 等等。
本发明实施例中, 根据条带集参数对条带集进行打包操作的过程具体可以包括: 若条带集中均 为采用独立编码方式编码的条带, 则将条带集中的各条带分别各自独立封装于一个数据包中; 若条 带集中包含至少一个采用非独立编码方式编码的条带, 即条带集中包含未采用独立编码方式编码的 条带, 则将条带集中的各条带组合封装于一个数据包中。
在上述打包处理过程中, 当需要在一个数据包中封装一个条带集中的多个条带时, 则还可以根 据当前网络带宽情况进行打包处理, 具体可以为: 首先, 可以根据当前网络带宽确定一个数据包中 可以封装的条带数目, 之后, 根据所述可以封装的条带数目, 将条带集中的条带封装于一个或多个 符合当前网络带宽传输要求的数据包中。
进一步地, 本发明实施例中, 可以采用的打包方式包括:
当网络带宽可保证将条带集中所有条带一起打包传输时, 则根据当前条带集参数的设置, 可以 将条带集中的所有条带作为一个整体进行打包。 当网络带宽不能保证将条带集中所有条带一起打包 时, 或者, 根据当前条带集参数确定不适合将整个条带集一起打包时, 则可以根据网络带宽的情况 对条带集进行适当分组, 将条带集中的若干条带分开进行打包, 即以条带集中的若干个条带为单位 进行打包。
其中, 在当网络带宽可保证条带集中所有条带一起打包的情况下, 若当前条带集中的至少一个 条带与其他条带之间不具有编解码独立性 (即未采用独立编码方式进行编码, 而是采用条带之间依 赖其他条带的数据的编码方式进行编码) , 则可以将当前条带集中的所有条带作为一个整体进行打 包。 否则, 即当前条带集中所有条带之间具有编码独立性, 可以将条带集中的各个条带单独进行打 包, 即在丢掉单个包时也不影响针对条带集中其它数据包的解码, 以保证相应的抗误码性能。
本发明实施例中, 若需要对条带集中多于一个数目的条带一起打包, 则相对于现有技术中采用 的打包处理方式, 需要在原有基于单个条带打包模式的基础上进行相应的操作, 以适应新的打包形 式的需求; 例如, 对于基于起始码前缀的码流(如 AVS视频流等) , 可以不再将条带之间的起始码分 割去掉, 只去掉第一个条带前的起始码, 对于需要封装于同一数据包中的该条带集中的其他条带, 则保留相应的条带起始码, 之后, 将多个条带映射成一个 NAL单元; 或者, 对于基于 NAL单元的码流, 不再将单个条带映射成一个 NAL单元, 而是将需要的多个条带一起组合成一个 NAL单元。 需要说明的是, 本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以 通过程序来指令相关的硬件来完成, 所述的程序可以存储于一计算机可读取存储介质中, 该程序在 执行时, 包括本发明实施例中描述的全部或部分处理步骤, 其中, 所述的存储介质可以但不限于为: ROM/RAM, 磁碟或光盘等。 为便于对本发明实施例的理解,下在将结合附图对本发明实施例的具体实施方式进行详细说明。 实施例一
假设, 采用以下两个相关参数标识条带集:
( 1 ) slice— set— index参数: 即条带集序号, 用于标识图像内的不同条带集, 具有相同 slice— set— index值的条带属于同一条带集;
(2) slice— independency参数: 即条带独立性标志, 用于标识当前条带集内各条带是否具有编 解码独立性, 例如, 可以采用 slice— independency值为 1时表示当前条带内宏块编解码时只能使用本 条带内的数据, slice— independency值为 0时表示当前条带内宏块编解码时可以使用本幅图像内具有 相同 s 1 i ce— set— index的条带数据, 即同一条带集中的其他条带对应的数据。
相应的条带集划分的方式可以参照图 1所示,其中, A, BO, C, Bl, D, B2, E为各个条带; Row O^Row
7为图像中的 8个宏块行, 0〜7为宏块行在图像中的垂直位置; Col (TClo 7为图像中 8个宏块列, 0〜 7为宏块列在图像中的水平位置。
假设 A, C, D同属一个条带集, B0, Bl, B2属于另一个条带集, 条带 E属于第三个条带集; 则可 以令 A, C, D三个条带 slice— set— index为 0, BO , Bl , B2 三条带 slice— set— index为 1 ; E 的 slice— set— index为 2Ϊ
各条带对应的 slice— independency值可以设置为: A, C, D三个条带的 slice— independency值分 别设置为 1, 1, 1, B0, Bl , B2三个条带的 slice— independency值分别设置为: 0, 0, 0; 条带 E 独自属于一个条带集, 故其 slice— independency值可以设置为 1。
根据上述 slice— independency值的设置可知: A, C, D三个条带中任一条带内宏块的编解码处理 不能使用其他两个条带的数据; B0, Bl, B2三个条带中任一条带内宏块的编解码处理可以使用其他 两个条带的数据; E条带内宏块的编解码处理不能使用其它条带的数据。
针对图 1所示的图像, 当网络带宽可保证条带集中所有条带一起打包时, 具体可以采用以下打包 处理方式对各条带进行打包:
( 1 )针对条带 A, C, D的打包方式
由于条带集 1中的三个条带 A, C, D编解码具有独立性, 因此可以将 A, C, D三个条带任意组合进 行打包; 若为了保证一定的抗误码性能, 则可以将 A, C, D分开进行打包, 这样, 若其中任意一个包 丢失将不会影响针对其它包的解码操作;
(2)针对条带 B0, Bl, B2的打包方式
由于条带集 2中的三个条带 B0, Bl, B2编解码不具有独立性, 因此可以将 B0, Bl, B2三个条带整 体进行打包; 例如, 对于 AVS的码流, 只需将 B0条带码流前的起始码前缀去掉, 到 B2条带的数据结束 为止, 映射成一个 NAL单元; 对于以 NAL为单元的 H. 264标准中, 则可以将条带 B0, Bl , B2的数据组合 成一个 NAL单元;
( 3 )针对条带 E的打包方式
由于条带 E独自成为一个条带集, 且其编解码具有独立性, 故可以对其单独进行打包。 本发明实施例还提供了一种视频数据的打包装置, 其具体实现结构如图 2所示, 可以包括以下处 理单元:
( 1 ) 条带集获取单元 201, 用于获取待发送的条带集, 所述的条带集包括一个或多个条带, 其 中, 所述的条带可以为按照扫描顺序连续的宏块, 如按照光栅扫描顺序连续的宏块等;
( 2 ) 打包操作单元 202, 用于根据所述条带集获取单元获取的条带集中的各条带之间的编码方 式, 对条带集中包含的一个或多个条带进行打包操作;
该打包操作单元具体 202可以包括以下至少一个单元:
第一打包处理单元 2021, 用于在条带集中均为采用独立编码方式编码的条带时, 将条带集中的 各条带分别各自独立封装于一个数据包中;
第二打包处理单元 2022, 用于在条带集中包含至少一个采用非独立编码方式编码的条带 (即条 带集中包含未采用独立编码方式编码的条带) 时, 将条带集中的各条带组合封装于一个数据包中。
可选地, 为灵活适应网络带宽对数据传输的要求, 相应的第二打包处理单元 2022具体可以包括 以下单元:
条带数目确定单元 20221, 用于根据当前网络带宽确定一个数据包中可以封装的条带数目, 以便 于根据该条带数目确定数据包的大小;
打包执行单元 20222, 用于根据所述条带数据确定单元确定的数据包中可以封装的条带数目, 将 条带集中的条带封装于一个或多个数据包中, 即以所述条带数目个条带为单位进行数据包的封装操 作。
可选地, 针对不同的码流, 该第二打包处理单元 2022还可以包括:
基于起始码前缀的码流打包单元, 用于将多个条带中的第一个条带的起始码前缀去掉, 其他条 带的起始码前缀保留, 再将多个条带映射成为一个 NAL单元;
或者,
基于 NAL单元的码流打包单元, 用于将需要组合打包的若干个条带数据组合成一个 NAL单元。 实施例二
另外, 在一些视频编解码技术中, 在编码过程中, 写入码流中的条带数据的比特长度具有不可 预测的特性, 从而使得解码端无法准确获知码流中条带数据的长度, 使得解码过程无法可靠地进行 解码操作
为此, 本发明实施例还提供了一种视频数据的编解码方案, 以使得在视频数据处理过程中, 可 以在对相应的数据进行编码或解码处理过程中, 能够准确确定当前条带是否编码或解码结束。 现有技术中, 在 CABAC编码条带结束时, 需要在条带结尾写入 1比特结束当前条带编码, 若只在 条带编码结束时写入该比特, 解码端只能在条带最后一个宏块解码结束后读取该比特, 但解码端无 法获知当前解码宏块是否是当条带的最后一个宏块, 故只能在每个宏块解码结束后读取一比特, 然 后进行条带解码结束判断。根据 CABAC编解码特性, 若在错误的位置读取该比特则可能导致比特流指 针偏移错误,从而可能导致条带解码提前(即仍存在未被解码的宏块的情况)结束。这里所述的 CABAC 为 (Context-based Adaptive Binary Arithmatic Coding, 基于上下文的自适应二元算术编码) 的缩写。 根据二元算数码原理, 在二元算数编码过程中所有数据都以二元算数码方式写入码流中, 期间不能 ***以非二元算数码编码的数据; 同理, 在解码端二元算数码解码时, 所有数据都以二元算数码解 码的方式读取, 期间不能以非二元算数码方式读取数据。 上述在条带结尾写入的用于结束当前条带 编码 1比特数据由于是在二元算数编码过程中写入, 其编码方式为二元算数编码。 同理, 解码端解码 该笔特时以二元算数码方式读取。
为此, 本发明实施例中, 在编码端编码条带过程中, 可以在宏块数据编码结束后写入熵编码填 充符号, 其中, 相应的宏块包含条带中的最后一个宏块及最后一个宏块之前的至少一个宏块, 即除 了需要在条带的最后一个宏块编码结束后写入熵编码填充符号外, 还需要在条带中的最后一个宏块 之前的至少一个宏块编码结束后写入相应的熵编码填充符号。 由于所述的熵编码填充符号在 CABAC 编码过程中写入, 故该符号以二元算数编码 (既 CABAC编码) 方式写入。
在上述写入熵编码填充符号的操作过程中, 对于条带中的最后一个宏块之前的至少一个宏块, 具体可以在编码一宏块或一宏块行或指定数目宏块后, 写入熵编码填充符号。 其中, 若采用指定数 目宏块后写入相应的熵编码填充符号,则可以根据在编解码端预先设置该指定数目宏块的具体数目。
在写入熵编码填充符号的操作过程中, 对于条带中的最后一个宏块, 在码流中写入的熵编码填 充符号后, 若字节不对齐, 则还可以进行比特填充处理, 并在填充至字节对齐位置处结束编码。 例 如, 在写入一比特' Γ 后, 判断字节是否对齐, 若字节不对齐则写入比特' 0' 至字节对齐为止结 束编码, 若字节对齐, 则结束条带编码。
相应的熵编码填充符号可以为一比特填充符号, 也可以为多比特填充符号。 可选地, 还可以将 条带中的最后一个宏块之前的宏块对应的熵编码填充符号的值与条带中的最后一个宏块对应的熵编 码填充符号的值相反; 例如, 若条带最后一编码宏块 (即最后一个宏块) 的熵编码填充符号的值为 预先设定好的数值, 且为' 0' 或 ' Γ ; 则条带非最后一编码宏块 (即最后一个宏块之前的宏块) 的所述熵编码填充符号的值为预先设定好的数值与条带最后一编码宏块的所述熵编码填充符号的值 相反, 为' 或' 0' 。
与上述编码端处理过程对应, 本发明实施例中, 在解码端解码条带过程中, 可以在宏块数据解 码结束后读取熵编码填充符号, 同样, 相应的宏块包含条带中的最后一个宏块及最后一个宏块之前 的至少一个宏块; 并在读取到的熵编码填充符号后, 检测条带解码是否结束, 若条带解码未结束, 则继续解码条带中的下一个宏块, 直到条带解码结束。 由于所述的熵编码填充符号在 CABAC解码过程 中读取, 故该符号以二元算数码 (既 CABAC解码) 方式读取。
其中, 检测条带解码是否结束的操作过程可以采用以下任一处理方式: ( 1 ) 处理方式一
若当前比特流指针位于字节对齐处, 则判断比特流指针下一字节对齐处是否为起始码, 若是, 则条带解码结束, 否则, 条带解码未结束; 或者, 判断比特流指针下一字节对齐处是否为 0x80, 并 且 0x80后是否为起始码, 若是, 则条带解码结束, 否则, 条带解码未结束;
( 2 ) 处理方式二
若当前比特流指针位于字节对齐处, 则判断当前比特流指针后至字节对齐处的内容是否等于填 充模板, 所述填充模板为1〈〈 (7-η) , 其中 n为码流指针在当前字节的位置偏移, 若等于填充模板, 则条带解码结束, 否则, 条带解码未结束;
( 3 ) 处理方式三
若当前比特流指针位于字节对齐处, 则判断当前比特流指针后至字节对齐处的内容是否等于填 充模板, 所述填充模板为1〈〈 (7-η) , 其中 n为码流指针在当前字节的位置偏移, 若等于填充模板, 则判断比特流指针下一字节对齐处是否为起始码, 若是, 则条带解码结束, 否则, 条带解码未结束; 或者, 判断比特流指针下一字节对齐处是否为 0x80, 并且 0x80后是否为起始码, 若是, 则条带解码 结束, 否则, 条带解码未结束; 若不等于填充模板, 则条带解码未结束。 下面将对该实施例的具体实现过程进行详细地说明。
( 1 ) 编码端
在编码端, 针对一宏块或一宏块行或指定数目宏块后编码结束之后写入一比特信息作为 CABAC 填充比特 (即熵编码填充符号) , 该 CABAC填充比特可以记为: cabac—mb— stuffing— bit。
在编码端, 若条带编码结束, 则执行条带编码结束的操作, 该条带编码结束的操作过程记为: i s— end— of— si ice () ; 该 is— end— of— slice ()的具体过程可以包括: 在条带数据结尾写入 1比特' , 并判断字节是否对齐, 若字节已对齐则结束当前条带编码, 否则, 填充比特' 0' 至字节对齐为止条 带编码结束。
其中,编码端在条带中的最后一个宏块编码结束后写入的 CABAC填充比特的值为预先约定好的数 值, 可以为' 0' 或 ' Γ , 条带中的其它宏块编码结束时所写入的 CABAC填充比特数值则不做规定, 若为提高编码效率, 则条带中的其它宏块编码结束时所写入的数值可以与条带中的最后一个宏块对 应的 CABAC填充比特数值相反。例如, 条带中最后一个宏块的 CABAC填充比特数值为' Γ , 则条带其 它宏块的 CABAC填充比特的值应为' 0' 。
( 2 )解码端
在解码端, 解码完一宏块或一宏块行或指定数目宏块后读取所述 CABAC填充比特 cabac—mb— stuf f ing— bit, 并执行解码端条带判断操作 is— end— of— slice (), 该过程具体可以包括: 若当前字节已对 齐则判断当前比特流指针后 32位是否为 0x80000001 ( BP l个字节加了 24比特的起始码) , 若是, 贝 ij当 前条带解码结束, 否则, 继续解码下一宏块; 若当前字节未对齐, 则判断当前比特流指针后至字节 对齐处的内容是否等于填充模板 stuf f ing pattern并且从字节对齐处开始的 24比特是否为起始码 Ox 000001 , 若是, 则当前条带解码结束, 否则, 继续解码下一宏块, 其中, 所述 stuffing pattern为 1« (7-n) , 其中 n为码流指针在当前字节的位置偏移, 数值范围为 0〜7。
通过上述处理过程可以看出, 由于编码端在针对一个宏块或一个宏块行或指定数目的宏块编码 结束后写入了相应的 CABAC填充比特,使得在解码端执行的针对一个宏块或一个宏块行或指定数目的 宏块解码结束后可以读取相应的 CABAC填充比特, 因而, 不会导致条带中的最后一个宏块(即条带结 束宏块) 的编码及解码特殊化。 这样, 当解码端解码完一个宏块或一个宏块行或指定数目的宏块且 读取完相应的 CABAC填充比特后, 比特流指针位置与编码端的一致, 故可以使用采用上述 is— end— of— slice ()操作进行条带解码结束判断, 并可以保证判断结果的准确性。
本发明实施例还提供了一种视频编码装置, 其具体实现结构如图 3所示, 可以包括: 条带编码单元 301, 用于对当前条带进行编码操作;
熵编码填充符号写入单元 302, 用于在所述条带编码单元 501编码条带过程中, 在宏块数据编码 结束后写入熵编码填充符号, 所述宏块包含条带中的最后一个宏块及最后一个宏块之前的至少一个 宏块。 其中, 相应的熵编码填充符号可以但不限于为一比特信息, 且对于条带中的最后一个宏块之 前的至少一个宏块,可以在编码一宏块或一宏块行或指定数目宏块后,写入相应的熵编码填充符号。。
本发明实施例还提供了一种视频解码装置, 其具体实现结构仍参照图 3所示, 可以包括: 熵编码填充符号读取单元 303, 用于在解码条带过程中, 在宏块数据解码结束后读取熵编码填充 符号, 所述宏块包含条带中的最后一个宏块及最后一个宏块之前的至少一个宏块;
判断单元 304, 用于在所述熵编码填充符号读取单元 303读取到的熵编码填充符号后, 检测条带 解码是否结束;
进一步地, 该判断单元 304具体可以包括:
第一判断操作单元 3041, 用于在当前比特流指针位于字节对齐处的情况下, 判断比特流指针下 一字节对齐处是否为起始码, 若是, 则条带解码结束, 否则, 条带解码未结束; 或者, 判断比特流 指针下一字节对齐处是否为 0x80, 并且 0x80后是否为起始码, 若是, 则条带解码结束, 否则, 条带 解码未结束;
第二判断操作单元 3042, 用于在当前比特流指针位于字节对齐处的情况下, 判断当前比特流指 针后至字节对齐处的内容是否等于填充模板, 所述填充模板为1〈〈 (7-η) , 其中 n为码流指针在当前 字节的位置偏移, 若等于填充模板, 则通知所述第一判断操作单元或者条带解码结束; 否则, 条带 解码未结束。 在一种实现方式中, 本领域技术人员可以理解, 所述第二判断操作单元 3042可以由一 个第三判断操作单元代替。 所述第三判断操作单元, 用于在当前比特流指针位于字节对齐处的情况 下, 判断当前比特流指针后至字节对齐处的内容是否等于填充模板, 所述填充模板为1〈〈 (7-η) , 其 中 n为码流指针在当前字节的位置偏移, 若等于填充模板, 则通知所述第一判断操作单元; 若不等 于填充模板, 则条带解码未结束。
本发明实施例还提供了编解码***, 仍参照图 3所示, 由相应的的视频编码装置及相应的视频解 码装置组成, 且相应的视频编码装置及视频解码装置具体采用的编码及解码过程在之前的方法实施 例中已经详细描述, 故在此不再一一详述。
本发明实施例中, 为使得解码端能够正确解码, 还提供了一种视频编解码处理方案。 在该方案 中:
( 1 ) 编码端
编码端在条带熵编码结束后, 根据条带熵编码结束时熵编码可能写入码流的最大比特数目进行 条带数据码流的填充操作。
进一步地, 在条带数据码流的填充操作过程中, 可以先计算上述可能写入码流的最大比特数目 减去条带编码结束操作写入码流中的比特数目后获得的差值, 之后, 在码流中填充该差值对应的比 特数目; 例如, 可以使用比特' 0' 或' Γ 进行相应的填充条带数据的操作。
(2)解码端
解码端在解码条带过程中, 在宏块数据解码结束后, 在比特流指针在比特流指针当前位置后指 定位置检测条带解码是否结束 (即是否已经到达条带结尾处理) , 其中, 相应的指定位置为比特流 指针当前位置之后的若干指定比特位, 且相应的若干指定比特位即为编码端在条带熵编码结束时熵 编码可能写入码流的最大比特数目。 可选地, 在解码端, 该若干指定比特位可以为预先设定好的数 值。
在完成条带解码是否结束的判断后,便可以根据相应的检测判断结果做进一步地条带解码操作。 以 CABAC编码为例, 本发明实施例在编码端具体可以根据 CABAC编码特性计算出条带编码结束时 写入编码结束符号后可能写入码流的最大比特数目, 之后, 编码端在针对条带的各个宏块进行编码 过程中, 若当前编码宏块为条带的最后一个宏块, 则根据上述可能写入码流的最大比特数目填充码 流,其中,填充写入码流的比特数值("0"或 " 1 " )可由编码端自行决定,然后进行 is— end— of— slice () 操作。
对应的, 仍以 CABAC解码为例, 在解码端解码条带, 并解码完一宏块后, 在比特流指针所指当前 位置之后若干比特位开始进行 is— end— of— slice ()操作, 以判断条带解码是否结束, 相应的若干比特 位为上述可能写入码流的最大比特数目。
采用上述编解码方案的原理在于: CABAC编解码的算术引擎精度是有限的, 因此条带编码结束写 入编码结束符号后算术引擎所能写入码流中的比特数目是有限的。 根据这一特性在该实施例中便可 以在条带编码结束时写入额外的填充比特, 这样, 解码端解码完一个宏块后便可以获知比特流指针 需从何处开始进行条带解码结束判断。 例如, 可能写入码流的最大比特数目为 34, 编码端条带编码 结束写入结束符号后, 算术引擎向码流中写入了 3比特信息, 为此, 编码端再此之后再额外写入 34-3=31比特信息; 这样, 解码端每解码完一个宏块后, 相应的比特流指针便可以从当前位置 34个比 特为之后进行条带解码结束判断, 从而可以准确判断当前条带解码是否结束。
本发明实施例还提供了一种视频编码装置, 其具体实现结构如图 4所示, 具体可以包括: 条带编码单元 401, 用于对当前条带进行编码操作;
码流填充单元 402, 用于在所述条带编码单元 401结束针对条带的熵编码后, 根据条带熵编码结 束时熵编码可能写入码流的最大比特数目进行条带数据码流的填充操作。
对应的, 本发明实施例还提供了一种视频解码装置, 其具体实现结构仍参照图 4所示, 具体可以 包括: 解码单元 403, 用于对当前条带进行解码操作;
解码判断单元 404, 用于在所述解码单元 403在完成宏块数据解码结束后, 在比特流指针在比特 流指针当前位置后指定位置检测条带解码是否结束, 其中, 所述指定位置根据编码端在条带熵编码 结束时熵编码可能写入码流的最大比特数目确定。
本发明实施例还提供了编解码***, 仍参照图 4所示, 由相应的视频编码装置及相应的视频解码 装置组成, 且相应的视频编码装置及视频解码装置具体采用的编码及解码过程在之前的方法实施例 中已经详细描述, 故在此不再一一详述。 实施例三
为使得在视频数据处理过程中, 可以依据所处理数据的结束判断条件对相应的数据进行打包或 解包处理。 本发明实施例还提供了相应的条带集及独立条带对应的编解码结束的判断条件及对应的 数据处理过程, 其中, 在编码过程中产生的独立条带即为传统意义的条带, 其不含有条带集参数, 在编码过程中产生的每个条带集中的条带则拥有共同的条带集参数。
相应的在编码端, 可以在编码条带过程中, 向编码码流中写入条带的结束参数信息, 以便于解 码端可以根据该结束参数信息判断针对当前条带的解码是否结束。
其中, 根据不同的结束参数信息, 相应的写入条带的结束参数信息的过程具体可以为以下任一 过程:
( 1 )获取编码条带过程中条带结束时产生的比特数目(即条带结束时, 写入码流的比特数目), 并将所述条带结束时产生的比特数目写入码流中作为所述结束参数信息;
可选地, 将条带结束时产生的比特数目写入码流中的过程具体可以包括: 在码流中的条带数据 对应的比特码流后写入特殊标识符 (如 000000000000000000000011或 000000000000000000000000 等) , 该特殊标识符用于指示码流中包含条带结束时产生的比特数目的参数; 之后, 再在特殊标识 符后将条带结束时产生的比特数目的参数写入码流中, 且该条带结束时产生的比特数目可以但不限 于采用变长码方式写入码流中。
( 2 ) 获取编码条带包含的宏块数目, 并将所述宏块数目写入码流中作为所述结束参数信息; 对于条带编码过程, 编码端可以在条带头写入当前条带包含的宏块数目; 对应的, 在解码端, 便可以根据条带头中当前条带包含的宏块数目判断针对当前条带的解码过程是否结束, 即若解码宏 块数目等于当前条带包含的宏块数目则解码过程结束, 否则继续针对当前条带的宏块的解码操作。
本发明实施例中, 对于条带集, 编码端在条带集编码结束后, 可以在码流中写入条带集的结束 标识符, 用于指示当前条带集编码结束, 例如, 在比特流中写入一比特信息作为条带集的结束标识 符等; 对应的, 在解码端, 便可根据该结束符判断当前条带集是否已经解码结束, 以实现准确解码。
本发明实施例中, 相应的条带集中包含的条带存在共同的条带集参数; 相应的条带则不含有条 带集参数, 相应的条带可以为条带集中的条带, 也可以为独立条带。
本发明实施例还提供了相应的视频解码的实现方案, 其在解码条带过程中, 解析获得编码码流 中的条带的结束参数信息; 并根据结束参数信息确定针对当前条带的解码是否完成, 以实现针对条 带的解码操作。
与编码端对应, 相应的结束参数信息可以包括: 条带结束时产生的比特数目; 或者, 条带包含 的宏块数目。
进一步地, 若结束参数信息为条带结束时产生的比特数目, 则解析获得编码码流中的条带的结 束参数信息的过程中, 首先解码获得码流中的条带数据对应的比特码流后的特殊标识符, 该特殊标 识符用于指示码流中包含条带结束时产生的比特数目的参数; 在特殊标识符后, 可解析获得条带结 束时产生的比特数目。
在解码端, 若结束参数信息为条带结束时产生的比特数目, 则根据结束参数信息确定针对当前 条带的解码是否完成的过程可以包括:
( 1 )在一宏块或一宏块行数据解码结束后, 将当前比特流指针前移, 前移位数为相应的解码获 得的条带结束时产生的比特数目;
( 2 )判断比特流当前位置是否为字节对齐位置, 若不是, 则判断当前位置的下一个字节开始的 位置是否为特殊标识符; 否则, 判断当前位置之后是否为特殊标识符; 所述判断当前位置之后是否 为特殊标识符也就是判断当前位置之后的任一位置是否为特殊标识符;
( 3 ) 若在上述过程 (2 ) 中, 判断确定相应位置为特殊标识符, 则条带解码结束, 否则, 在比 特流指针后移相应的条带结束时产生的比特数目后, 继续解码下一宏块或宏块行数据, 直至当前条 带解码结束。
在解码端, 若结束参数信息为条带包含的宏块数目, 则根据结束参数信息确定针对当前条带的 解码是否完成的过程可以包括: 解析获码流的条带包含的宏块数目, 在解码条带过程中, 若解码宏 块数目等于相应的条带包含的宏块数目, 则条带解码结束, 否则, 继续解码下一宏块或宏块行数据, 直至当前条带解码结束。 下面将结合条带集及独立条带的编解码结束条件, 以基于上下文的自适应二元算术编码 ( Context-based Adaptive Binary Arithmatic Coding, CABAC) 方式为例, 对编码端针对视频数 据的打包处理过程及解码端针对视频数据的解包处理过程进行说明。
在 CABAC技术中, 比特数据的读写具有不可预测性, 通常编码一个语法元素所需写入的比特数目 需要取决于上下文的语法元素, 使得解码端无法获知从比特流中读取多少比特的数据作为一个条带 的数据, 从而给条带结束的判断带来了困难。 也就是说, 若假设 CABAC编码操作过程为 terminate— s lice O, CABAC解码操作过程为 decode— terminate (), 则由于 CABAC的编码特性 terminate— slice () 在编码端所写如的比特数不可事先获知, 因而使得解码端亦无法提前获知条带解码结束 decode— ter minate ()过程所需读取的比特数。
基于相应的 CABAC技术的上述特征, 本发明实施例中, 可以在编码端和解码端分别采用以下处理 方式, 以解决相应的问题。
(一) 编码端 在编码端, 记录 terminate— slice ()过程所条带结束时产生的比特数目, 并可以但不限于采用变 长码方式将该参数 (即条带结束时产生的比特数目) 写入码流中。
进一步地, 为使解码端能够快速定位获得该参数, 可以在码流中首先写入一特殊标识符, 该特 殊标识符当前仅当写入 terminate— slice ()过程所产生比特数时存在,即通过该特殊标识符指示码流 中包含条带结束时产生的比特数目的参数, 例如, 该特殊标识符可以但不限于为: 00000000000000 0000000011 , 即 22个' 0' 再加' 1 Γ 。 相应的将该参数(即条带结束时产生的比特数目) 写入码流 中的过程可以包括: 当条带数据编码完成后, 先写入一填充比特' , 之后再写入填充比特' 0' 直至字节对齐; 字节对齐后, 再向码流中写入该特殊标识符, 并写入 terminate— slice ()过程所条带 结束时产生的比特数目; 最后再写入一填充比特' , 并依次再写入填充比特' 0' 直至字节对齐。
(二)解码端
在解码端, 解析该条带数据前, 首先在条带数据中找到预设好的所述特殊标识符, 在该实施例 中假设该特殊标识符为: 000000000000000000000011 , 即 22个' 0' 再加' 11 ' ; 找到所述特殊标识 符后, 则在该标识符后以变长码方式读取解码端 decode— terminate ()过程所需读取的比特数目, 即 编码端 terminate— slice ()过程所条带结束时产生的比特数目;获得相应的条带结束时产生的比特数 目的参数后, 将码流指针重定位至条带数据开始处, 并解码条带数据。
在解码条带数据过程中, 当解码完毕一宏块或一宏块行或若干指定数目的宏块数据后, 将码流 指针前移, 前移的比特位数为所述 decode— terminate ()过程所需读取的比特数目 (即解码获得的条 带结束时产生的比特数目) ; 之后, 相应的处理过程包括以下两种情况:
( 1 )若比特流当前位置(即码流指针所指向的位置)不是字节对齐的位置, 则判断比特流当前 位置的下一个字节 (即字节对齐位置) 开始的 24个比特是否为所述的特殊标识符 (在该实施例中假 设该特殊标识符为: 000000000000000000000011 , 即 22个' 0' 再加' 11 ' ) , 若是, 则解码过程结 束,还将比特流指针移至码流中表示所述 decode— terminate ()过程所需读取的比特数目的参数之后, 若不是, 则将比特流指针后移所述 decode— terminate ()过程所需读取的比特数目, 并继续解码下一 宏块数据, 直至条带解码结束;
( 2 )若比特流当前位置(即码流指针所指向的位置)为字节对齐的位置, 则判断当前指针所指 向的位置开始或当前指针所指向的位置的再下一字节对齐处的 24个比特是否为所述的特殊标识符 (在该实施例中假设该特殊标识符为: 000000000000000000000011 , 即 22个' 0' 再加' 1Γ ) , 若 是, 则条带解码结束, 还将比特流指针移至码流中表示所述 decode— terminate ()过程所需读取的比 特数目的参数之后, 若不是, 则将比特流指针后移所述 decode— terminate ()过程所需读取的比特数 目, 并继续解码下一宏块数据, 直至条带解码结束。
下面再以一个具体的例子, 对上述过程进行说明: 假设, 在编码端, 当前条带编码结束后执行 t erminate— slice ()过程写入码流中的比特数目 (编码条带的比特数目, 即所述条带结束时产生的比 特数目) 为 5, 则具体的写入码流的方式可以为在 terminate— slice ()后字节对齐处写入 22个 0加' 11 ', 再以一阶哥伦布码方式写入 00110 (即表示条带结束时产生的比特数目为 5 )。对应的, 在解码端, 首先在两条带起始码间获得 22个 0加 ' 1 的位置, 然后在其后读取条带结束时产生的比特数目 5, 假 设当前宏块解码结束比特流指针指向 19的位置, 则将比特流指针向前移 5个比特至 24的位置, 再从该 比特流指针为 24的位置继续寻找字节对齐的位置, 并从该字节对齐的位置开始判断是否为所述特殊 标识符, 若是, 则条带解码结束, 否则继续解码下一个宏块, 周而复始, 直到条带解码结束。
本发明实施例还提供了一种视频编码装置, 其具体实现结构如图 5所示, 可以包括: 条带编码单元 501, 用于对当前条带进行编码操作;
结束参数写入单元 502, 用于在条带编码单元 501进行编码条带过程中, 在编码码流中写入条带 的结束参数信息; 该结束参数信息可以包括: 条带结束时产生的比特数目; 或者, 条带包含的宏块 数目。
在该装置中, 若相应结束参数信息为写入码流的比特数据, 则结束参数写入单元 502具体可以包 括:
特殊标识符写入单元 5021,用于在条带编码单元 501获得的码流中的条带数据对应的比特码流后 写入特殊标识符, 该特殊标识符用于指示码流中包含所述条带结束时产生的比特数目的参数; 比特数目写入单元 5022, 用于在特殊标识符写入单元 5021写入的特殊标识符后将所述条带结束 时产生的比特数目的参数写入码流中。
上述视频编码装置具体采用的编码过程在前面方法实施例中已经描述, 故在此不再一一详述。 本发明实施例还提供了一种视频解码装置, 其具体实现结构如图 6所示, 可以包括: 结束参数获取单元 601, 用于在解码条带过程中, 解析获得编码码流中的条带的结束参数信息; 同样, 该结束参数信息可以但不限于包括: 条带结束时产生的比特数目; 或者, 条带包含的宏块数 目。
条带解码单元 602, 用于根据结束参数获取单元 601获取的结束参数信息确定针对当前条带的解 码是否完成, 以实现针对条带的解码操作。
在该装置中, 若结束参数信息为条带结束时产生的比特数目, 则上述结束参数获取单元 601具体 可以包括:
特殊标识符获取单元 6011, 用于解码获得码流中的条带数据对应的比特码流后的特殊标识符, 该特殊标识符用于指示码流中包含所述条带结束时产生的比特数目的参数;
比特数目获取单元 6012, 用于在特殊标识符获取单元 6011获取的特殊标识符后, 解析获得所述 条带结束时产生的比特数目。
在该装置中, 若结束参数信息为条带结束时产生的比特数目, 则上述条带解码单元 402具体可以 包括:
指针移位处理单元 6021, 用于在一宏块或一宏块行数据解码结束后, 将当前比特流指针前移, 前移位数为所述条带结束时产生的比特数目;
第一判断单元 6022, 用于判断比特流当前位置是否为字节对齐位置;
第二判断单元 6023, 用于在相应的第一判断单元 6022确定当前位置不是字节对齐位置时, 则判 断当前位置的下一个字节开始的位置是否为所述特殊标识符; 若确定当前位置为字节对齐位置, 则 判断当前位置之后是否为所述特殊标识符;
判断结果处理单元 6024, 用于在第二判断单元 6023确定相应位置为所述特殊标识符, 则判定条 带解码结束, 否则, 在比特流指针后移条带结束时产生的比特数目后, 继续解码下一宏块或宏块行 数据, 直至当前条带解码结束。
上述视频解码装置具体采用的解码过程在前面方法实施例中已经描述, 故在此不再一一详述。 本发明实施例还提供了编解码***, 由上述各实施例提供的视频编码装置及相应的视频解码装 置组成。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可以通过计算机程 序来指令相关的硬件来完成, 所述的程序可存储于一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施例的流程。 其中, 所述的存储介质可为磁碟、 光盘、 只读存储记忆体 (Read- Only Memory, ROM) 或随机存储记忆体 (Random Access Memory, RAM) 等。 综上所述, 由于采用了根据条带集参数 (即条带集编码方式) 对包含一个或多个条带的条带 集进行打包处理, 从而可以提高抗网络丢包及抗误差的能力, 改善视频传输效果; 例如, 当条带集 中的各个条带之间采用独立编码方式进行编码时, 则可以将条带集中的各条带分别打包到不同的数 据包中, 从而可以提高视频传输过程中的抗丢包的能力。 进一步地, 在将多个条带打包到一个数据 包的过程中还可以根据网络带宽进行打包,从而使得打包后的数据包可以很好地适应网络传输环境。
通过以上的实施方式的描述, 本领域的技术人员可以清楚地了解到本发明可以通过硬件实现, 也可以可借助软件加必要的通用硬件平台的方式来实现基于这样的理解, 本发明的技术方案可以以 软件产品的形式体现出来, 该软件产品可以存储在一个计算机可读存储介质(可以是 CD-ROM, U盘, 移动硬盘等) 中, 包括若干指令用以使得一台计算机设备 (可以是个人计算机, 服务器, 或者网络 设备等)执行本发明各个实施例所述的方法。
以上所述, 仅为本发明较佳的具体实施方式, 但本发明的保护范围并不局限于此, 任何熟悉本 技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到的变化或替换, 都应涵盖在本发明的 保护范围之内。 因此, 本发明的保护范围应该以权利要求的保护范围为准。

Claims

权利要求
1、 一种视频数据的打包方法, 其特征在于, 包括:
获取待发送的条带集, 所述条带集包括一个或多个条带; 根据所述条带集中的各条带之间的编码方式, 对所述条带集中包含的一个或多个条带进行打包 操作。
2、 根据权利要求 1所述的方法, 其特征在于, 所述的条带包括按照扫描顺序连续的宏块。
3、 根据权利要求 2所述的方法, 其特征在于, 所述的扫描顺序包括光栅扫描顺序。
4、 根据权利要求 1、 2或 3所述的方法, 其特征在于, 所述的打包操作具体包括以下至少一种处 理方式:
若所述条带集中均为采用独立编码方式编码的条带, 则将所述条带集中的各条带分别各自独立 封装于一个数据包中; 若所述条带集中包含至少一个采用非独立编码方式编码的条带, 则将所述条带集中的包括所述 采用非独立编码方式编码的条带在内的多个条带组合封装于一个数据包中。
5、 根据权利要求 4所述的方法, 其特征在于, 当需要在一个数据包中封装一个条带集中的多个 条带时, 所述方法还包括: 根据当前网络带宽确定一个数据包中能够封装的条带数目; 根据所述能够封装的条带数目, 将所述条带集中的多个条带封装于一个或多个数据包中。
6、 根据权利要求 4所述的方法, 其特征在于, 当需要在一个数据包中封装一个条带集中的多个 条带时, 该方法还包括:
对于基于起始码前缀的码流, 将所述多个条带中的第一个条带的起始码前缀去掉, 将所述多个 条带中的其他条带的起始码前缀保留, 再将所述多个条带映射成为一个网络提取层 NAL单元; 或者,
对于基于 NAL单元的码流, 将需要组合打包的若干个条带数据组合成一个 NAL单元。
7、 一种视频数据的打包装置, 其特征在于, 包括:
条带集获取单元, 用于获取待发送的条带集, 所述的条带集包括一个或多个条带; 打包操作单元, 用于根据所述条带集获取单元获取的条带集中的各条带之间的编码方式, 对所 述条带集中包含的一个或多个条带进行打包操作。
8、 根据权利要求 7所述的装置, 其特征在于, 所述的打包操作单元具体包括: 第一打包处理单元, 用于在条带集中均为采用独立编码方式编码的条带时, 将所述条带集中的 各条带分别各自独立封装于一个数据包中;
或者,
第二打包处理单元, 用于在条带集中包含至少一个采用非独立编码方式编码的条带时, 将所述 条带集中的包括所述采用非独立编码方式编码的条带在内的多个条带组合封装于一个数据包中。
9、 根据权利要求 8所述的装置, 其特征在于, 所述的第二打包处理单元具体包括: 条带数目确定单元, 用于根据当前网络带宽确定一个数据包中能够封装的条带数目; 打包执行单元, 用于根据所述条带数据确定单元确定的数据包中能够封装的条带数目, 将条带 集中的条带封装于一个或多个数据包中。
10、 根据权利要求 8所述的装置, 其特征在于, 所述的第二打包处理单元包括: 基于起始码前缀的码流打包单元, 用于将多个条带中的第一个条带的起始码前缀去掉, 将多个 条带中的其他条带的起始码前缀保留, 再将所述多个条带映射成为一个 NAL单元; 或者,
基于 NAL单元的码流打包单元, 用于将需要组合打包的若干个条带数据组合成一个 NAL单元。
11、 一种视频编码的方法, 其特征在于, 包括:
在编码条带过程中, 在所述条带中的特定宏块数据编码结束后写入熵编码填充符号, 所述特定 宏块为条带中的最后一个宏块及最后一个宏块之前的至少一个宏块。
12、 根据权利要求 11所述方法, 其特征在于, 所述写入熵编码填充符号的操作包括: 对于条带中的最后一个宏块之前的至少一个宏块,在编码一宏块或一宏块行或指定数目宏块后, 写入所述熵编码填充符号。
13、 根据权利要求 11所述方法, 其特征在于, 所述写入熵编码填充符号的操作包括: 对于条带 中的最后一个宏块, 在码流中写入熵编码填充符号后, 若字节不对齐, 则进行比特填充至字节对齐 为止。
14、 根据权利要求 11、 12或 13所述方法, 其特征在于, 所述熵编码填充符号为一比特填充符号。
15、 根据权利要求 11、 12或 13所述方法, 其特征在于, 所述写入熵编码填充符号的操作包括: 将条带中的最后一个宏块之前的宏块对应的熵编码填充符号的值与条带中的最后一个宏块对应 的熵编码填充符号的值设定为相反。
16、 一种视频编码装置, 其特征在于, 包括:
条带编码单元, 用于对当前条带进行编码操作;
熵编码填充符号写入单元, 用于在所述条带编码单元编码条带过程中, 在所述条带中的特定宏 块数据编码结束后写入熵编码填充符号, 所述特定宏块为条带中的最后一个宏块及最后一个宏块之 前的至少一个宏块。
17、 一种视频解码的方法, 其特征在于, 包括: 在解码条带过程中, 在所述条带中的宏块数据解码结束后读取熵编码填充符号, 所述宏块包含 条带中的最后一个宏块及最后一个宏块之前的至少一个宏块;
在读取到所述熵编码填充符号后, 检测条带解码是否结束。
18、 根据权利要求 17所述方法, 其特征在于, 所述读取熵编码填充符号的操作包括: 在解码完 一宏块或一宏块行或指定数目宏块后, 读取所述熵编码填充符号。
19、 根据权利要求 17所述方法, 其特征在于, 所述熵编码填充符号为一比特填充符号。
20、 根据权利要求 17、 18或 19所述方法, 其特征在于, 所述检测条带解码是否结束的操作包括: 若当前比特流指针位于字节对齐处, 则判断比特流指针后是否为起始码, 若是, 则条带解码结 束, 否则, 条带解码未结束; 或者, 判断比特流指针后是否为 0x80, 并且 0x80后是否为起始码, 若 是, 则条带解码结束, 否则, 条带解码未结束;
或者,
若当前比特流指针不位于字节对齐处, 则判断当前比特流指针后至字节对齐处的内容是否等于 填充模板, 所述填充模板为1〈〈 (7-η) , 其中 n为码流指针在当前字节的位置偏移, 〈〈为左移符号, 若等于填充模板, 则条带解码结束, 否则, 条带解码未结束;
或者,
若当前比特流指针不位于字节对齐处, 则判断当前比特流指针后至字节对齐处的内容是否等于 填充模板, 所述填充模板为1〈〈 (7-η) , 其中 n为码流指针在当前字节的位置偏移, 并且判断比特流 指针下一字节对齐处是否为起始码, 若是, 则条带解码结束, 否则, 条带解码未结束; 或者, 判断 比特流指针下一字节对齐处是否为 0x80, 并且 0x80后是否为起始码, 若是, 则条带解码结束, 否则, 条带解码未结束; 若不等于填充模板, 则条带解码未结束。
21、 一种视频解码装置, 其特征在于, 包括:
熵编码填充符号读取单元, 用于在解码条带过程中, 在所述条带中的宏块数据解码结束后读取 熵编码填充符号, 所述宏块包含条带中的最后一个宏块及最后一个宏块之前的至少一个宏块; 判断单元, 用于在所述熵编码填充符号读取单元读取到熵编码填充符号后, 检测条带解码是否 结束。
22、 根据权利要求 21所述装置, 其特征在于, 所述判断单元包括:
第一判断操作单元, 用于在当前比特流指针位于字节对齐处的情况下, 判断比特流指针下一字 节对齐处是否为起始码, 若是, 则条带解码结束, 否则, 条带解码未结束; 或者, 判断比特流指针 下一字节对齐处是否为 0x80, 并且 0x80后是否为起始码, 若是, 则条带解码结束, 否则, 条带解码 未结束;
第二判断操作单元, 用于在当前比特流指针位于字节对齐处的情况下, 判断当前比特流指针后 至字节对齐处的内容是否等于填充模板, 所述填充模板为1〈〈 (7-η) , 其中 n为码流指针在当前字节 的位置偏移, 若等于填充模板, 则条带解码结束, 否则, 条带解码未结束; 或者, 第三判断操作单 元, 用于在当前比特流指针位于字节对齐处的情况下, 判断当前比特流指针后至字节对齐处的内容 是否等于填充模板, 所述填充模板为1〈〈 (7-η) , 其中 n为码流指针在当前字节的位置偏移, 若等于 填充模板, 则通知所述第一判断操作单元; 若不等于填充模板, 则条带解码未结束。
23、 一种视频编码的方法, 其特征在于, 包括:
在条带熵编码结束后, 根据条带熵编码结束时熵编码能够写入码流的最大比特数目进行条带数 据码流的填充操作。
24、 根据权利要求 23所述方法, 其特征在于, 所述条带数据码流的填充操作包括:
计算所述能够写入码流的最大比特数目减去条带编码结束操作写入码流中的比特数目后获得的 差值, 并在码流中填充该差值对应的比特数目。
25、 一种视频编码装置, 其特征在于, 包括:
条带编码单元, 用于对当前条带进行编码操作;
码流填充单元, 用于在所述条带编码单元结束针对条带的熵编码后, 根据条带熵编码结束时熵 编码能够写入码流的最大比特数目进行条带数据码流的填充操作。
26、 一种视频解码的方法, 其特征在于, 包括:
在解码条带过程中, 在所述条带中的宏块解码结束后, 在比特流指针当前位置后指定位置检测 条带解码是否结束, 所述指定位置根据编码端在条带熵编码结束时熵编码能够写入码流的最大比特 数目确定。
27、 一种视频解码装置, 其特征在于, 包括:
解码单元, 用于对当前条带进行解码操作;
解码判断单元, 用于在所述解码单元在完成所述条带中的宏块解码结束后, 在比特流指针当前 位置后指定位置检测条带解码是否结束, 其中, 所述指定位置根据编码端在条带熵编码结束时熵编 码能够写入码流的最大比特数目确定。
28、 一种视频编码的方法, 其特征在于, 包括:
在编码条带过程中, 获取条带结束时产生的条带的结束参数信息, 在编码码流中写入条带的结 束参数信息, 所述结束参数信息包括: 条带结束时产生的比特数目或者条带包含的宏块数目。
29、 根据权利要求 28所述的方法, 其特征在于, 所述结束参数信息为条带结束时产生的比特数; 将所述条带结束时产生的比特数目写入码流中的过程包括:
在码流中的条带数据对应的比特码流后写入特殊标识符, 该特殊标识符用于指示码流中包含所 述条带结束时产生的比特数目的参数;
在所述特殊标识符后将所述条带结束时产生的比特数目的参数写入码流中。
30、 根据权利要求 29所述的方法, 其特征在于, 所述的特殊标识符包括: 000000000000000000000011或 000000000000000000000000。
31、 根据权利要求 29所述的方法, 其特征在于, 所述条带结束时产生的比特数目采用变长码方 式写入码流中。
32、 根据权利要求 28至 31任一项所述的方法, 其特征在于, 在针对条带集的编码过程中, 该方 法还包括:
在码流中写入条带集的结束标识符, 用于指示当前条带集编码结束, 所述的条带集包括一个或 多个条带。
33、 一种视频编码装置, 其特征在于, 包括: 条带编码单元, 用于对当前条带进行编码操作;
结束参数写入单元, 用于在所述条带编码单元进行编码条带过程中, 在编码码流中写入条带的 结束参数信息, 所述结束参数信息包括: 条带结束时产生的比特数目或者条带包含的宏块数目。
34、 根据权利要求 33所述的装置, 其特征在于, 当所述结束参数信息为写入码流的比特数据时, 所述结束参数写入单元包括:
特殊标识符写入单元, 用于在所述条带编码单元获得的码流中的条带数据对应的比特码流后写 入特殊标识符, 该特殊标识符用于指示码流中包含所述条带结束时产生的比特数目的参数;
比特数目写入单元, 用于在所述特殊标识符写入单元写入的特殊标识符后将所述条带结束时产 生的比特数目的参数写入码流中。
35、 一种视频解码的方法, 其特征在于, 包括:
在解码条带过程中, 解析获得码流中的条带的结束参数信息, 所述的结束参数信息包括: 条带 结束时产生的比特数目, 或者, 条带包含的宏块数目;
根据所述结束参数信息确定条带的解码是否完成。
36、 根据权利要求 35所述的方法, 其特征在于, 所述解析获得编码码流中的条带的结束参数信 息的过程包括:
解码获得码流中的条带数据对应的比特码流后的特殊标识符, 该特殊标识符用于指示码流中包 含所述条带结束时产生的比特数目的参数的位置;
在所述特殊标识符后, 解析获得所述条带结束时产生的比特数目。
37、 根据权利要求 36所述的方法, 其特征在于, 所述的特殊标识符包括: 000000000000000000000011或 000000000000000000000000。
38、 根据权利要求 35、 36或 37所述的方法, 其特征在于, 所述根据所述结束参数信息确定针对 当前条带的解码是否完成的过程包括:
在一宏块或一宏块行数据解码结束后, 将当前比特流指针前移, 前移位数为所述条带结束时产 生的比特数目;
判断比特流当前位置是否为字节对齐位置, 若不是, 则判断比特流指针指向比特流位置的下一 个字节开始处是否为所述特殊标识符; 若是, 判断比特流指针指向比特流位置之后是否为所述特殊 标识符。
若判断确定为所述特殊标识符, 则条带解码结束, 比特流指针移至所述读取码流的比特数目的 参数之后; 否则, 在比特流指针后移所述读取码流的比特数目后, 继续解码下一宏块或宏块行数据。
39、 根据权利要求 35所述的方法, 其特征在于, 所述根据所述结束参数信息确定针对当前条带 的解码是否完成的过程包括:
获得码流的条带包含的宏块数目, 若解码宏块数目等于所述条带包含的宏块数目, 则条带解码 结束。
40、 一种视频解码装置, 其特征在于, 包括:
结束参数获取单元, 用于在解码条带过程中, 解析获得编码码流中的条带的结束参数信息, 所 述的结束参数信息包括: 条带结束时产生的比特数目, 或者, 条带包含的宏块数目; 条带解码单元, 用于根据所述结束参数获取单元获取的结束参数信息确定针对当前条带的解码 是否完成, 以实现针对条带的解码操作。
41、 根据权利要求 40所述的装置, 其特征在于, 若所述结束参数信息为条带结束时产生的比特 数目, 则所述结束参数获取单元包括:
特殊标识符获取单元, 用于解码获得码流中的条带数据对应的比特码流后的特殊标识符, 该特 殊标识符用于指示码流中包含所述条带结束时产生的比特数目的参数;
比特数目获取单元, 用于在所述特殊标识符获取单元获取的特殊标识符后, 解析获得所述条带 结束时产生的比特数目。
42、 根据权利要求 40或 41所述的装置, 其特征在于, 所述条带解码单元包括:
指针移位处理单元, 用于在一宏块或一宏块行数据解码结束后, 将当前比特流指针前移, 前移 位数为所述条带结束时产生的比特数目;
第一判断单元, 用于判断比特流当前位置是否为字节对齐位置;
第二判断单元, 用于在所述第一判断单元确定当前位置不是字节对齐位置, 则判断当前位置的 下一个字节开始的位置是否为所述特殊标识符; 若确定当前位置为字节对齐位置, 则判断当前位置 之后是否为所述特殊标识符;
判断结果处理单元, 用于在所述第二判断单元确定相应位置为所述特殊标识符, 则判定条带解 码结束, 否则, 在比特流指针后移所述条带结束时产生的比特数目后, 继续解码下一宏块或宏块行 数据。
PCT/CN2009/072250 2008-06-13 2009-06-12 视频数据的打包、编解码方法及装置及*** WO2009149671A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN200810110177.1 2008-06-13
CN 200810110177 CN101394550B (zh) 2007-09-17 2008-06-13 视频数据的打包方法及装置
CN200810129023.7 2008-06-19
CN 200810129023 CN101394551A (zh) 2007-09-17 2008-06-19 视频数据的打包、编解码方法及装置及***

Publications (1)

Publication Number Publication Date
WO2009149671A1 true WO2009149671A1 (zh) 2009-12-17

Family

ID=41418735

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/072250 WO2009149671A1 (zh) 2008-06-13 2009-06-12 视频数据的打包、编解码方法及装置及***

Country Status (1)

Country Link
WO (1) WO2009149671A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989800A (zh) * 2017-06-03 2018-12-11 上海天荷电子信息有限公司 以字节为单元产生压缩数据字节流的数据压缩方法和装置
CN111736771A (zh) * 2020-06-12 2020-10-02 广东浪潮大数据研究有限公司 一种数据迁移方法、装置、设备及计算机可读存储介质
CN115150387A (zh) * 2022-06-14 2022-10-04 炫彩互动网络科技有限公司 一种云游戏中数据传输方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040196906A1 (en) * 1999-04-15 2004-10-07 Gordon Donald F. Temporal slice persistence method and apparatus for delivery of interactive program guide
CN101137060A (zh) * 2007-09-30 2008-03-05 腾讯科技(深圳)有限公司 一种视频传输方法、***及设备
CN101150719A (zh) * 2006-09-20 2008-03-26 华为技术有限公司 并行视频编码的方法及装置
CN101394551A (zh) * 2007-09-17 2009-03-25 华为技术有限公司 视频数据的打包、编解码方法及装置及***

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040196906A1 (en) * 1999-04-15 2004-10-07 Gordon Donald F. Temporal slice persistence method and apparatus for delivery of interactive program guide
CN101150719A (zh) * 2006-09-20 2008-03-26 华为技术有限公司 并行视频编码的方法及装置
CN101394551A (zh) * 2007-09-17 2009-03-25 华为技术有限公司 视频数据的打包、编解码方法及装置及***
CN101394550A (zh) * 2007-09-17 2009-03-25 华为技术有限公司 视频数据的打包方法及装置
CN101137060A (zh) * 2007-09-30 2008-03-05 腾讯科技(深圳)有限公司 一种视频传输方法、***及设备

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108989800A (zh) * 2017-06-03 2018-12-11 上海天荷电子信息有限公司 以字节为单元产生压缩数据字节流的数据压缩方法和装置
CN108989800B (zh) * 2017-06-03 2024-01-09 上海天荷电子信息有限公司 以字节为单元产生压缩数据字节流的数据压缩方法和装置
CN111736771A (zh) * 2020-06-12 2020-10-02 广东浪潮大数据研究有限公司 一种数据迁移方法、装置、设备及计算机可读存储介质
CN111736771B (zh) * 2020-06-12 2024-02-23 广东浪潮大数据研究有限公司 一种数据迁移方法、装置、设备及计算机可读存储介质
CN115150387A (zh) * 2022-06-14 2022-10-04 炫彩互动网络科技有限公司 一种云游戏中数据传输方法

Similar Documents

Publication Publication Date Title
JP5374768B2 (ja) 追加的なネットワーク抽象化層(nal)を用いるマルチメディア・データの保護方法
US8249110B2 (en) Apparatus and method for coding an information signal into a data stream, converting the data stream and decoding the data stream
US6768775B1 (en) Video CODEC method in error resilient mode and apparatus therefor
KR100939951B1 (ko) 인 밴드 에러 패턴을 사용한 에러 복원
CN101394550B (zh) 视频数据的打包方法及装置
CN109167645B (zh) 用于物理层封装的数据结构、数据结构产生设备及其方法
KR100992002B1 (ko) 계층화된 미디어 비트스트림의 패킷화
US20100017686A1 (en) Fast channel zapping and high quality streaming protection over a broadcast channel
WO2013063962A1 (zh) 一种分片层参数集解码及编码方法和装置
JP2008527896A (ja) 改良型ipデータグラムの逆カプセル化
KR100357266B1 (ko) 데이터 분할 기법을 이용한 영상 부호화 전송방법
MX2014013560A (es) Aparato y metodo de transmision y recepcion de paquete en sistema de radiofusion y comunicacion.
JP2023015265A5 (zh)
WO2009149671A1 (zh) 视频数据的打包、编解码方法及装置及***
WO2012095032A1 (zh) 指示和获取用户流数的方法及通信装置
JP4907039B2 (ja) 信号符号化方法
CN115604481B (zh) 提升编解码与传输并行的方法、装置及***
CN109600616B (zh) 一种基于h.264视频压缩标准的码流封装方法
CN1301012C (zh) 一种基于ldpc的成帧方法
CN112822514B (zh) 基于依赖关系的视频流分组传输方法、***、终端及介质
CN116893987B (zh) 硬件加速方法、硬件加速器及硬件加速***
CN104092690B (zh) 流媒体的回看媒体流带宽控制***及方法
CN116033113B (zh) 一种视频会议辅助信息传输方法和***
KR101268757B1 (ko) 단방향 전송환경에서 멀티미디어 전자파일의 다운로드와 재생을 병렬적으로 처리하기 위한 송수신 방법 및 장치
CN115379230A (zh) H264视频流处理方法、***、控制装置及可读存储介质

Legal Events

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

Ref document number: 09761296

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09761296

Country of ref document: EP

Kind code of ref document: A1