CN115866258A - Method and device for generating and processing transport stream and program stream - Google Patents
Method and device for generating and processing transport stream and program stream Download PDFInfo
- Publication number
- CN115866258A CN115866258A CN202111125693.3A CN202111125693A CN115866258A CN 115866258 A CN115866258 A CN 115866258A CN 202111125693 A CN202111125693 A CN 202111125693A CN 115866258 A CN115866258 A CN 115866258A
- Authority
- CN
- China
- Prior art keywords
- stream
- program
- knowledge
- bit stream
- packet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000012545 processing Methods 0.000 title claims abstract description 24
- 230000005540 biological transmission Effects 0.000 claims description 7
- 238000004458 analytical method Methods 0.000 claims description 2
- 238000004806 packaging method and process Methods 0.000 claims description 2
- 238000003672 processing method Methods 0.000 abstract description 6
- 239000002699 waste material Substances 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 15
- 239000010410 layer Substances 0.000 description 15
- 238000013507 mapping Methods 0.000 description 11
- 230000001419 dependent effect Effects 0.000 description 9
- 230000006978 adaptation Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000006835 compression Effects 0.000 description 5
- 238000007906 compression Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 230000003139 buffering effect Effects 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 238000010561 standard procedure Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000002131 composite material Substances 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 239000011229 interlayer Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
技术领域technical field
本发明属于图像或视频压缩、存储和传输技术领域,具体涉及传输流和节目流的生成和处理方法。The invention belongs to the technical field of image or video compression, storage and transmission, and specifically relates to methods for generating and processing transport streams and program streams.
背景技术Background technique
1、传统视频编码方案1. Traditional video coding scheme
在现有视频序列处理中,为了使编码后的视频序列支持随机访问功能,视频序列被分割成多个具有随机访问功能的片段(简称为随机访问片段),如图1所示,一个视频序列包括至少一个随机访问片段,每个随机访问片段对应一个显示时段并包括一幅随机访问图像以及多幅非随机访问图像,每个图像拥有各自的显示时间以描述该图像被显示或播放的时间。一个随机访问片段中的图像可以进行帧内编码,或者,参考该随机访问片段中的其他图像利用帧间预测进行编码,其中,被参考的图像可以是要显示的图像、或者不能显示的合成图像等。然而在现有技术中,一个显示顺序在随机访问图像之后的图像(不包括leadingpictures)只能参考该图像所属的随机访问片段中的其他图像,而不能参考该图像所属随机访问片段之前或之后的随机访问片段中的图像,如图1所示。具体的,有如下几种方式描述当前图像和候选参考图像之间的依赖关系:In the existing video sequence processing, in order to make the encoded video sequence support the random access function, the video sequence is divided into multiple segments with random access function (referred to as random access segments), as shown in Figure 1, a video sequence It includes at least one random access segment, each random access segment corresponds to a display period and includes a random access image and multiple non-random access images, each image has its own display time to describe the time when the image is displayed or played. Pictures in a random access segment can be intra-coded or coded using inter-frame prediction with reference to other pictures in the random access segment, where the referenced picture can be a picture to be displayed, or a composite picture that cannot be displayed wait. However, in the prior art, a picture (not including leading pictures) whose display order is after the random access picture can only refer to other pictures in the random access segment to which the picture belongs, but cannot refer to the pictures before or after the random access segment to which the picture belongs Randomly access images in fragments, as shown in Figure 1. Specifically, there are several ways to describe the dependency between the current image and candidate reference images:
在现有的视频编码方案(如H.264\AVC或H.265\HEVC)中,当前图像和候选参考图像之间的依赖关系由视频压缩层的参考图像配置集描述,其中参考图像配置集描述了参考图像与当前图像之间的编号差值。之所以在参考图像配置集中仅描述编号差值,是因为现有的视频编码方案中,候选参考图像与当前图像从属于同一个独立可解码的随机访问片段,且候选参考图像与当前图像只能使用同一种编号规则,例如按照时间顺序编号,因此根据当前图像编号和候选参考图像编号差值可以准确定位候选参考图像。如果参考图像和当前图像使用不同的编号规则,由于现有视频编码方案没有提供在码流中描述不同编号规则的方法,同样的编号差值会指向不同的候选参考图像,导致编解码器不能使用正确的候选参考图像。In existing video coding schemes (such as H.264\AVC or H.265\HEVC), the dependency relationship between the current picture and candidate reference pictures is described by the reference picture configuration set of the video compression layer, where the reference picture configuration set Describes the numbered difference between the reference image and the current image. The reason why only the number difference is described in the reference picture configuration set is because in the existing video coding schemes, the candidate reference picture and the current picture belong to the same independently decodable random access segment, and the candidate reference picture and the current picture can only be The same numbering rule is used, such as numbering in time order, so the candidate reference image can be accurately located according to the difference between the current image number and the candidate reference image number. If the reference image and the current image use different numbering rules, since the existing video coding scheme does not provide a method for describing different numbering rules in the code stream, the same numbering difference will point to different candidate reference images, resulting in codecs that cannot be used The correct candidate reference image.
在可伸缩视频编码方案(Scalable Video Coding,SVC)和多视点视频编码方案(Multiview Video Coding,MVC)中,如图2所示,在已有帧间预测(仅使用同层/同视点内的候选参考图像)的基础上,SVC/MVC使用层间/视点间预测为当前图像扩展了候选参考图像的范围,其中扩展的候选参考图像与当前图像拥有相同的编号(例如,相同时间戳)且不属于独立可解码片段的同一层级。SVC/MVC在视频压缩层使用层级标识描述不同层/视点的码流的依赖关系,并联合使用图像的同一编号描述层间/视点间图像的依赖关系。In the scalable video coding scheme (Scalable Video Coding, SVC) and the multiview video coding scheme (Multiview Video Coding, MVC), as shown in Figure 2, in the existing inter-frame prediction (only using the Candidate reference picture), SVC/MVC uses inter-layer/inter-view prediction to extend the range of candidate reference pictures for the current picture, where the extended candidate reference picture has the same number as the current picture (for example, the same time stamp) and Not belonging to the same hierarchy as an independently decodable segment. In the video compression layer, SVC/MVC uses layer identification to describe the dependency relationship of code streams of different layers/viewpoints, and jointly uses the same number of images to describe the dependency relationship of images between layers/viewpoints.
在AVS2的背景帧技术中,如图3所示,编码图像和场景图像的依赖关系由视频压缩层中参考图像类型的标识来描述。具体的,AVS2使用标识描述特别的场景图像类型(即,G图像和GB图像),并使用特定的参考缓存(即场景图像缓存)管理G/GB图像,同时,使用标识描述当前图像是否参考G/GB图像,并使用特定的参考图像队列构建方法(即,默认将G/GB图像放入参考图像队列的最后一个参考图像位),最终,使得按照规则编号的当前图像能够参考不按照规则编号的候选参考图像(即GB图像)、或与当前图像使用同一规则编号但编号差值超出约束范围的候选参考图像(即G图像)。但该技术限制任意时刻场景图像缓存中只能存在一个候选参考图像,且该候选参考图像仍然与当前图像属于同一独立可解码片段。In the background frame technology of AVS2, as shown in FIG. 3 , the dependency relationship between the coded image and the scene image is described by the identifier of the reference image type in the video compression layer. Specifically, AVS2 uses the logo to describe the special scene image type (ie, G image and GB image), and uses a specific reference cache (ie scene image cache) to manage G/GB images, and at the same time, uses the logo to describe whether the current image refers to G /GB image, and use a specific reference image queue construction method (that is, put the G/GB image into the last reference image bit of the reference image queue by default), and finally, enable the current image numbered according to the rule to refer to the image that is not numbered according to the rule Candidate reference image (i.e. GB image), or a candidate reference image (i.e. G image) that uses the same rule number as the current image but the number difference exceeds the constraint range. However, this technology limits that only one candidate reference image can exist in the scene image buffer at any time, and the candidate reference image still belongs to the same independently decodable segment as the current image.
2、基于知识库的视频编码方案2. Video coding scheme based on knowledge base
现有技术的上述机制会限制待编码图像的可用参考图像数量,不能有效提升图像编码和图像解码的效率。The above-mentioned mechanism in the prior art will limit the number of available reference images of the image to be encoded, and cannot effectively improve the efficiency of image encoding and image decoding.
为了挖掘和利用多个随机访问片段之间的图像在编码时相互参考的信息,在编码(或解码)一幅图像时,编码器(或解码器)可以从数据库中选择与当前编码图像(或解码图像)纹理内容相近的图像作为参考图像,这种参考图像称为知识库图像,存储上述参考图像的集合的数据库称为知识库,这种视频中至少一幅图像参考至少一幅知识库图像进行编解码的方法称为基于知识库的视频编码(英文:library-based video coding),又称为基于大时间跨度相关信息的视频编码(简称大跨度编码)。采用基于知识库的视频编码对一个视频序列进行编码会产生一个包含知识库图像编码码流的知识码流和一个包含视频序列各帧图像参考知识库图像编码得到的码流的主码流。这两种码流分别类似于可伸缩视频编码(英文:scalable video coding,SVC)产生的基本层码流和增强层码流,即主码流依赖于知识码流,且知识码流可以穿插入主码流以组成拼接码流。然而,基于知识库的视频编码的双码流组织方式与SVC的分级码流组织方式的层级码流之间的依赖关系不同,不同之处在于,SVC的双码流层级之间是按照一定的对齐时间段依赖的,而基于知识库的视频编码的双码流中视频层依赖知识层是按照非对齐时间段依赖的。In order to mine and utilize the mutual reference information of images between multiple random access segments during encoding, when encoding (or decoding) an image, the encoder (or decoder) can select from the database that is compatible with the current encoding image (or Decoded image) An image with similar texture content is used as a reference image. This reference image is called a knowledge base image, and the database storing the collection of the above reference images is called a knowledge base. At least one image in this video refers to at least one knowledge base image. The method of encoding and decoding is called knowledge base-based video coding (English: library-based video coding), also known as video coding based on information related to a large time span (referred to as long-span coding). Encoding a video sequence by using the video coding based on the knowledge base will generate a knowledge code stream including the coded code stream of the knowledge base image and a main code stream including the code stream obtained by encoding each frame image of the video sequence with reference to the knowledge base image. These two code streams are similar to the basic layer code stream and enhancement layer code stream generated by scalable video coding (English: scalable video coding, SVC), that is, the main code stream depends on the knowledge code stream, and the knowledge code stream can be interspersed The main code stream is used to form a spliced code stream. However, the dependency relationship between the dual-stream organization method of knowledge base-based video coding and the hierarchical code-stream organization method of SVC is different. The alignment time segment is dependent, while the video layer in the knowledge base-based video coding dual-code stream depends on the knowledge layer according to the non-alignment time segment.
在利用知识图像的编解码技术中,知识图像被获取并用于为图像的编解码提供额外的候选参考图像,图4展示了利用知识图像的编解码技术中,序列图像与知识图像之间的依赖关系。知识图像使得序列图像能够利用大跨度的相关信息,提升了编解码效率。但是,现有的技术方案并不能有效地支持序列图像和知识图像依赖关系的描述及对知识图像进行高效的管理。In the codec technology using knowledge image, the knowledge image is acquired and used to provide additional candidate reference images for the codec of the image. Figure 4 shows the dependency between the sequence image and the knowledge image in the codec technology using knowledge image relation. The knowledge image enables sequence images to utilize large-span related information and improves the efficiency of encoding and decoding. However, the existing technical solutions cannot effectively support the description of the dependency relationship between the sequence image and the knowledge image and efficiently manage the knowledge image.
3、现有传输流和节目流的生成和处理方法3. Generation and processing methods of existing transport streams and program streams
传输流和节目流的生成与处理方法将一路或多路音频、视频位流或其他基本数据流合成单路或多路复用流,用于存储和传输,其数据流中的语法信息用于同步解码及展现音频、视频信息,同时保证解码器中数据缓冲区不发生上溢和下溢。The generation and processing method of transport stream and program stream synthesizes one or more audio, video bit streams or other basic data streams into a single or multiplexed stream for storage and transmission, and the syntax information in the data stream is used for Synchronously decode and display audio and video information, while ensuring that the data buffer in the decoder does not overflow or underflow.
传输流是主要针对那些可能会出现显著错误(往往表现为位差错或分组包丢失)的环境中进行节目传送和存储而定义的一种流,由一个或多个节目组成的单一流,且这些节目可包含一个或多个不同时钟基准。同一个节目中的多个基本流所组成的多个PES(Packetized Elementary Stream)分组包共享一个时钟基准,传输流分组包长度为184字节。传输流分组包的包头制定了从信道中送来的每一字节进入节目流解码器的预定时间,作为时钟校正和缓冲区管理的参考,其数据结构如图5所示。A transport stream is a stream defined mainly for program transmission and storage in environments where significant errors may occur (often manifested as bit errors or packet loss), a single stream consisting of one or more programs, and these A program can contain one or more different clock references. Multiple PES (Packetized Elementary Stream) packets composed of multiple elementary streams in the same program share a clock reference, and the length of the transport stream packet is 184 bytes. The packet header of the transport stream packet defines the predetermined time for each byte sent from the channel to enter the program stream decoder, as a reference for clock correction and buffer management. Its data structure is shown in Figure 5.
节目流是针对那些出错率很低,且系统编码的处理过程作为主要考虑因素的环境进行一个节目的传送和存储而定义的一种流,由具有共同时间基准的一个或过个PES分组包合并而成的单一流,只包含一个节目,节目流分组包长度可变。节目流分组包的包头制定了从信道中送来的每一字节进入节目流解码器的预定时间,作为时钟校正和缓冲区管理的参考,其数据结构如图6所示。A program stream is a stream defined for the transmission and storage of a program in an environment where the error rate is very low and the system encoding process is the main consideration. It is composed of one or more PES packets with a common time reference. The resulting single stream contains only one program, and the length of the program stream packet is variable. The packet header of the program stream packet specifies the predetermined time for each byte sent from the channel to enter the program stream decoder, as a reference for clock correction and buffer management, and its data structure is shown in Figure 6.
每个传输流和节目流都包含一些信息,以标识组成一个节目的各基本流的相关特征以及基本流之间的相互关系。这些信息可包括声道中所使用的语言,以及在实现多层视频编码时各层之间的关系。例如,传输流分组包可以承载节目特定信息(PSI,Program-Specific Information)表指定包含在传输流分组包中的数据内容。PSI表携带于传输流中,包括以下四个:a)节目关联表(PAT,Program Association Table);b)节目映射表(PMT,Program Map Table);c)条件接收表(CAT,Conditional Access Table;d)网络信息表(NIT,Network Information Table)。节目流分组包可以承载节目流映射(PSM,ProgramStream Map)和节目流目录(PSD,Program Stream Directory)。这些包含描述信息的表中可以记录每个传输流/节目流、或每个节目、或每个基本流的属性,这可以通过使用不同的节目元素描述子(descriptor)来实现。例如hierarchy_descriptor可以描述节目中拥有层次关系的基本流的属性,标识基本流之间的依赖关系。Each transport stream and program stream contains some information to identify the relevant characteristics of the elementary streams that make up a program and the relationship between elementary streams. This information can include the language used in the soundtrack, and the relationship between layers when implementing multi-layer video coding. For example, the transport stream packet may carry a Program-Specific Information (PSI, Program-Specific Information) table specifying data content included in the transport stream packet. The PSI table is carried in the transport stream, including the following four: a) Program Association Table (PAT, Program Association Table); b) Program Mapping Table (PMT, Program Map Table); c) Conditional Access Table (CAT, Conditional Access Table ; d) Network Information Table (NIT, Network Information Table). The program stream packet can carry a program stream map (PSM, Program Stream Map) and a program stream directory (PSD, Program Stream Directory). These tables containing description information can record the attributes of each transport stream/program stream, or each program, or each elementary stream, which can be realized by using different program element descriptors (descriptors). For example, hierarchy_descriptor can describe the attributes of elementary streams with hierarchical relationship in the program, and identify the dependency relationship between elementary streams.
基本流是泛指PES分组包中编码视频位流、编码音频位流或其它某一个编码位流。一个基本流有且仅有一个stream_id的PES分组包序列来传输。An elementary stream generally refers to a coded video bit stream, a coded audio bit stream, or some other coded bit stream in a PES packet. An elementary stream has one and only one sequence of PES packets with stream_id to transmit.
PES分组包头以一个32位起始码开始,该起始码也标识该分组包数据所属的流或流类型,其数据结构如图7所示。PES分组包头可以包含解码和展现时间戳(DTS和PTS)。PES分组包头也包含其它可选字段。PES分组包数据字段包含来一个基本流的可变数目的连续字节。The PES packet header starts with a 32-bit start code, which also identifies the flow or flow type to which the packet data belongs, and its data structure is shown in FIG. 7 . The PES packet header may contain decoding and presentation time stamps (DTS and PTS). The PES packet header also contains other optional fields. The PES packet data field contains a variable number of consecutive bytes from an elementary stream.
对于仅包含单一视频基本流的节目,传输流的数据结构如图8所示。其中第一行是按照数据流式排列的一连串的TS分组包,第二行方块中的内容是对应的TS分组包包头或负载中包含的部分数据,在本例中,第一个TS分组包包含PAT,第二个TS分组包包含PMT,后续的TS分组包包含PES分组包。For a program containing only a single video elementary stream, the data structure of the transport stream is shown in Figure 8. Among them, the first row is a series of TS packets arranged according to the data stream, and the content in the second row of squares is part of the data contained in the corresponding TS packet header or payload. In this example, the first TS packet contains PAT, the second TS packet contains PMT, and subsequent TS packets contain PES packets.
对于仅包含单一位流的视频,节目流的数据结构如图9所示。其中第一行是按照数据流式排列的一连串的PS分组包,第二行方块中的内容是对应的PS分组包包头或负载中包含的部分数据,在本例中,第一个PS分组包包含PSM,后续的PS分组包包含PES分组包。For a video containing only a single bit stream, the data structure of the program stream is shown in Figure 9. Among them, the first row is a series of PS packets arranged according to the data stream, and the content in the second row of squares is part of the data contained in the corresponding PS packet header or payload. In this example, the first PS packet PSM is included, and subsequent PS packets include PES packets.
发明内容Contents of the invention
现有的生成和处理传输流和节目流的方法虽然能够支持层次编码(例如SVC和MVC,或者HEVC和VVC的时域分层编码)的视频流的处理,但是由于不同层次编码方法生成的多层视频流之间的依赖关系并不一致,需要对每一个种层次编码进行特殊的设计才能够在传输流和节目流中准确地描述多层视频流之间的依赖关系,从而方便接收端快速地处理数据以正确解码。因此,本发明针对使用大跨度编码的主位流和知识位流的依赖关系特点进行了创新设计以解决上述问题。同时,由于使用大跨度编码的主位流和知识位流之间的依赖关系描述并不是通过时间戳同步来实现的,而是通过依赖关系标识实现的(这是因为知识位流中的一幅知识图像可以被主位流中多个随机访问片段内的图像共享参考,因此无法使用单一的时间戳来同步),现有的传输流和节目流只能使用时间戳来实现同步,因此本发明也针对该问题进行了创新设计以便捷兼容地实现主位流和知识位流之间的依赖关系描述。Although the existing methods for generating and processing transport streams and program streams can support the processing of video streams with hierarchical coding (such as SVC and MVC, or time-domain layered coding of HEVC and VVC), due to the multiple The dependencies between the multi-layer video streams are not consistent, and it is necessary to carry out a special design for each layer coding to accurately describe the dependencies between the multi-layer video streams in the transport stream and the program stream, so that the receiving end can quickly Process the data to decode correctly. Therefore, the present invention makes an innovative design aiming at the characteristics of the dependency relationship between the main bit stream and the knowledge bit stream using long-span coding to solve the above problems. At the same time, due to the use of long-span coding, the dependency description between the main bit stream and the knowledge bit stream is not realized through time stamp synchronization, but through dependency identification (this is because a part of the knowledge bit stream Knowledge images can be shared reference by images in multiple random access segments in the main bit stream, so they cannot be synchronized using a single time stamp), existing transport streams and program streams can only be synchronized using time stamps, so the present invention An innovative design is also made to realize the dependency description between the main bit stream and the knowledge bit stream conveniently and compatiblely.
为此,本发明第一目的提供一种传输流/节目流的处理方法,包括:For this reason, the first object of the present invention provides a method for processing transport streams/program streams, including:
解析所述传输流/节目流中目标节目的依赖关系标识信息,以获取所述目标节目中主位流和知识位流之间的依赖关系;Analyzing the dependency identification information of the target program in the transport stream/program stream to obtain the dependency between the main bit stream and the knowledge bit stream in the target program;
获取所述目标节目中的主位流和知识位流,其中所述知识位流中至少一幅知识图像被主位流中至少两幅在时间上不相邻的图像所参考;acquiring a main bit stream and a knowledge bit stream in the target program, wherein at least one knowledge image in the knowledge bit stream is referenced by at least two temporally non-adjacent images in the main bit stream;
使用知识位流中的知识图像作为参考图像对主位流中的图像进行解码。The pictures in the primary bitstream are decoded using the knowledge pictures in the knowledge bitstream as reference pictures.
作为优选,所述依赖关系标识信息记录在传输流的节目映射表或节目流的节目流映射中,所述节目映射表位于传输流分组包中,所述节目流映射位于节目流分组包中,记录节目中包含的基本流的编号信息和属性信息。Preferably, the dependency identification information is recorded in the program mapping table of the transport stream or the program stream mapping of the program stream, the program mapping table is located in the transport stream packet, and the program stream mapping is located in the program stream packet, The number information and attribute information of the elementary streams contained in the program are recorded.
作为优选,所述依赖关系标识信息记录在传输流的节目映射表或节目流的节目流映射中的节目元素描述子中,该描述子用于标识其所对应的基本流是否为参考知识位流的主位流,如果是,则该描述子还标识了所述主位流参考的所有知识位流的索引号。Preferably, the dependency identification information is recorded in the program element descriptor in the program mapping table of the transport stream or the program stream mapping of the program stream, and the descriptor is used to identify whether the corresponding elementary stream is a reference knowledge bit stream If yes, this descriptor also identifies the index numbers of all knowledge bitstreams referenced by the main bitstream.
作为优选,所述知识位流中知识图像和主位流中主位流图像所属的基本流分组包中记录解码时刻,所述知识位流中知识图像所属的基本流分组包中记录的解码时刻应比所述主位流中主位流图像所属的基本流分组包中记录的解码时刻更早,其中所述主位流图像是所述主位流中首个参考所述知识图像进行解码的图像。Preferably, the decoding time is recorded in the elementary stream packet to which the knowledge image in the knowledge bitstream and the main bitstream image belong to in the main bitstream, and the decoding time recorded in the elementary stream packet to which the knowledge image in the knowledge bitstream belongs It should be earlier than the decoding time recorded in the elementary stream packet to which the primary bitstream image belongs in the primary bitstream, wherein the primary bitstream image is the first one in the primary bitstream that is decoded with reference to the knowledge image image.
本发明第二目的提供一种传输流/节目流的生成方法,包括:The second object of the present invention is to provide a method for generating a transport stream/program stream, including:
获取节目的知识位流和主位流,其中所述知识位流中至少一幅知识图像被主位流中至少两幅在时间上不相邻的图像所参考;obtaining a knowledge bitstream and a main bitstream of a program, wherein at least one knowledge picture in the knowledge bitstream is referenced by at least two temporally non-adjacent pictures in the main bitstream;
将所述知识位流和主位流作为基本流进行分包得到基本流分组包,并将其放入传输流分组包或节目流分组包;subpacketizing the knowledge bit stream and main bit stream as elementary streams to obtain elementary stream packets, and put them into transport stream packets or program stream packets;
在所述传输流分组包或节目流分组包中放入依赖关系标识信息,该信息描述所述主位流所属的基本流和所述知识位流所属的基本流之间的依赖关系;Putting dependency identification information in the transport stream packet or program stream packet, the information describes the dependency between the elementary stream to which the primary bitstream belongs and the elementary stream to which the knowledge bitstream belongs;
输出生成得到的传输流或节目流。Output the resulting Transport Stream or Program Stream.
作为优选,所述的在所述传输流分组包或节目流分组包中放入依赖关系标识信息包括如下操作:将所述依赖关系标识信息放入传输流的节目映射表或节目流的节目流映射中,所述节目映射表位于传输流分组包中,所述节目流映射位于节目流分组包中,两者均记录了节目中包含的基本流的编号信息和属性信息。Preferably, said putting dependency identification information in said transport stream packet or program stream packet includes the following operations: putting said dependency identification information into a program mapping table of a transport stream or a program stream of a program stream In the mapping, the program mapping table is located in the transport stream packet, and the program stream mapping is located in the program stream packet, both of which record the number information and attribute information of the elementary stream contained in the program.
作为优选,所述的在所述传输流分组包或节目流分组包中放入依赖关系标识信息包括如下操作:将所述依赖关系标识信息放入传输流的节目映射表或节目流的节目流映射中的节目元素描述子中,该描述子用于标识其所对应的基本流是否为参考知识位流的主位流,如果是,则该描述子还标识了所述主位流参考的所有知识位流的索引号。Preferably, putting the dependency identification information into the transport stream packet or the program stream packet includes the following operations: putting the dependency identification information into the program mapping table of the transport stream or the program stream of the program stream In the program element descriptor in the mapping, this descriptor is used to identify whether the corresponding elementary stream is the main bit stream that refers to the knowledge bit stream, and if so, this descriptor also identifies all The index number of the knowledge bitstream.
作为优选,所述的将所述知识位流和主位流作为基本流进行分包得到基本流分组包还包括如下操作:根据所述基本流分组包所包含的知识图像被使用的时刻,设定该基本流分组包中记录的解码时刻,该解码时刻应比所述主位流中主位流图像所属的基本流分组包中记录的解码时刻更早,其中所述主位流图像是所述主位流中首个参考所述被包含的知识图像进行解码的图像。Preferably, the sub-packaging of the knowledge bit stream and the main bit stream as elementary streams to obtain elementary stream packets further includes the following operation: according to the time when the knowledge image contained in the elementary stream packet is used, set Determine the decoding time recorded in the elementary stream packet, and the decoding time should be earlier than the decoding time recorded in the elementary stream packet to which the main bit stream image belongs in the main bit stream, wherein the main bit stream image is the The first picture in the primary bitstream to be decoded with reference to the included knowledge picture.
本发明第三目的提供一种传输流/节目流的处理装置,包括:The third object of the present invention is to provide a transport stream/program stream processing device, including:
解析模块:解析所述传输流/节目流中目标节目的依赖关系标识信息,以获取所述目标节目中主位流和知识位流之间的依赖关系;Parsing module: parsing the dependency identification information of the target program in the transport stream/program stream to obtain the dependency between the main bit stream and the knowledge bit stream in the target program;
获取模块:获取所述目标节目中的知识位流和主位流,其中所述知识位流中至少一幅知识图像被主位流中至少两幅在时间上不相邻的图像所参考;Acquisition module: acquire the knowledge bit stream and main bit stream in the target program, wherein at least one knowledge image in the knowledge bit stream is referenced by at least two images in the main bit stream that are not adjacent in time;
解码模块:使用知识位流中的知识图像作为参考图像对主位流中的图像进行解码。Decoding module: use the knowledge image in the knowledge bit stream as a reference image to decode the image in the main bit stream.
本发明第四目的提供一种传输流/节目流的生成装置,包括:The fourth object of the present invention is to provide a transport stream/program stream generation device, comprising:
获取模块:获取目标节目的知识位流和主位流,其中所述知识位流中至少一幅知识图像被主位流中至少两幅在时间上不相邻的图像所参考;Acquisition module: acquire the knowledge bit stream and main bit stream of the target program, wherein at least one knowledge image in the knowledge bit stream is referenced by at least two temporally non-adjacent images in the main bit stream;
分包模块:将所述知识位流和主位流作为基本流进行分包得到基本流分组包,并将其放入传输流分组包或节目流分组包;Subpackaging module: Subpackage the knowledge bit stream and main bit stream as elementary streams to obtain elementary stream packets, and put them into transport stream packets or program stream packets;
放入模块:在所述传输流分组包或节目流分组包中放入依赖关系标识信息,该信息描述所述主位流所属的基本流和所述知识位流所属的基本流之间的依赖关系;Putting module: Putting dependency identification information into the transport stream packet or program stream packet, the information describes the dependency between the elementary stream to which the primary bit stream belongs and the elementary stream to which the knowledge bit stream belongs relation;
输出模块:输出生成得到的传输流或节目流。Output module: output the generated transport stream or program stream.
本发明的有益效果在于:首先,通过增加基本流之间的依赖关系标识信息,实现了包含主位流和知识位流的视频节目通过传输流或节目流进行存储和传输的功能,使得主位流和知识位流获得的更好压缩效果能够有效用于数据的存储传输,降低实际应用中带宽的消耗;另外,本发明设计的依赖关系标识信息能够与现有标准技术完全兼容,不会对已有设备的更新带来额外开销,同时由于采用了灵活的节目元素描述子,能够实现依赖关系的灵活使用,避免了现有方法在处理主位流和知识位流时可能带来的语法元素浪费。The beneficial effects of the present invention are as follows: firstly, by increasing the dependency identification information between elementary streams, the function of storing and transmitting video programs including main bit streams and knowledge bit streams through transport streams or program streams is realized, so that the main bit streams The better compression effect obtained by stream and knowledge bit stream can be effectively used for data storage and transmission, reducing bandwidth consumption in practical applications; in addition, the dependency identification information designed by the present invention can be fully compatible with existing standard technologies and will not affect The update of existing equipment brings additional overhead. At the same time, due to the use of flexible program element descriptors, the flexible use of dependencies can be realized, and the syntax elements that may be brought about by the existing methods when processing the main bit stream and the knowledge bit stream are avoided. waste.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1被分割为随机访问片段的视频序列使用现有技术一的图像依赖关系示意图;Fig. 1 is a schematic diagram of the image dependency relationship of a video sequence divided into random access segments using
图2被分割为随机访问片段的视频序列使用现有技术二的图像依赖关系示意图;Fig. 2 is a schematic diagram of the image dependency relationship of the video sequence divided into random access segments using the second prior art;
图3被分割为随机访问片段的视频序列使用现有技术三的图像依赖关系示意图;Fig. 3 is a schematic diagram of the image dependency relationship of the video sequence divided into random access segments using the prior art 3;
图4被分割为随机访问片段的视频序列使用现有技术四的图像依赖关系示意图;Fig. 4 is a schematic diagram of the image dependency of the video sequence divided into random access segments using prior art 4;
图5现有技术中传输流分组包的一种数据结构示意图;FIG. 5 is a schematic diagram of a data structure of a transport stream packet in the prior art;
图6现有技术中节目流分组包的一种数据结构示意图;FIG. 6 is a schematic diagram of a data structure of a program stream packet in the prior art;
图7现有技术中PES分组包的一种数据结构示意图;Fig. 7 is a schematic diagram of a data structure of a PES packet in the prior art;
图8现有技术中传输流的一种数据结构示意图;FIG. 8 is a schematic diagram of a data structure of a transport stream in the prior art;
图9现有技术中节目流的一种数据结构示意图;FIG. 9 is a schematic diagram of a data structure of a program stream in the prior art;
图10本发明公开的一种传输流/节目流的处理方法的示意图;FIG. 10 is a schematic diagram of a transport stream/program stream processing method disclosed in the present invention;
图11本发明公开的一种传输流/节目流的生成方法的示意图;FIG. 11 is a schematic diagram of a method for generating a transport stream/program stream disclosed in the present invention;
图12本发明公开的一种实施例中的传输流的一种数据结构示意图;FIG. 12 is a schematic diagram of a data structure of a transport stream in an embodiment disclosed in the present invention;
图13本发明公开的一种实施例中的节目流的一种数据结构示意图;Fig. 13 is a schematic diagram of a data structure of a program stream in an embodiment disclosed by the present invention;
图14本发明公开的一种传输流/节目流的处理装置的示意图;FIG. 14 is a schematic diagram of a transport stream/program stream processing device disclosed in the present invention;
图15本发明公开的一种传输流/节目流的生成装置的示意图。FIG. 15 is a schematic diagram of an apparatus for generating a transport stream/program stream disclosed in the present invention.
具体实施方式Detailed ways
以下结合附图和具体实施例对本发明作详细描述。注意,以下结合附图和具体实施例描述的诸方面仅是示例性的,而不应被理解为对本发明的保护范围进行任何限制。术语定义:The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the aspects described below in conjunction with the drawings and specific embodiments are only exemplary, and should not be construed as limiting the protection scope of the present invention. Definition of Terms:
在说明实施例之前,先声明必要的名词定义:Before describing the embodiment, declare the necessary noun definitions earlier:
知识图像:又叫知识库图像,知识图像为当前图像所属的随机访问片段及其之前最邻近的一个随机访问片段中的需要显示的图像集之外的图像,知识图像是一种参考图像,用于为待编码图像或待解码图像提供参考。Knowledge image: also known as knowledge base image, knowledge image is an image outside the image set that needs to be displayed in the random access segment to which the current image belongs and the nearest random access segment before it, knowledge image is a kind of reference image, used It is used to provide a reference for an image to be encoded or an image to be decoded.
RL(Reference to Library)图像:仅参考知识图像进行编码或解码的图像。在一种实现方式中,RL图像紧跟在序列头数据之后,通过先解码外部的知识图像再解码RL图像以实现随机访问功能;在一种实现方式中,RL图像紧跟在序列头数据、知识图像数据之后,通过先解码知识图像再解码RL图像以实现随机访问功能;在一种实现方式中,RL图像跟在序列头数据之后,其间存在辅助增强信息或扩展信息或用户信息等数据,通过先解码知识图像再解码RL图像以实现随机访问功能。RL (Reference to Library) image: An image that is encoded or decoded only with reference to the knowledge image. In one implementation, the RL image immediately follows the sequence header data, and the random access function is realized by first decoding the external knowledge image and then decoding the RL image; in one implementation, the RL image immediately follows the sequence header data, After the knowledge image data, the random access function is realized by first decoding the knowledge image and then decoding the RL image; in one implementation, the RL image follows the sequence header data, and there is data such as auxiliary enhancement information or extended information or user information in between. The random access function is realized by first decoding the knowledge image and then decoding the RL image.
知识位流:又叫知识码流,指仅包含知识图像的位流。知识位流中至少一幅知识图像被主位流中至少两幅在时间上不相邻的图像所参考。Knowledge bit stream: also known as knowledge code stream, refers to a bit stream that only contains knowledge images. At least one knowledge picture in the knowledge bitstream is referenced by at least two temporally non-adjacent pictures in the main bitstream.
主位流:又叫主码流,指参考知识图像的图像所属的位流,该位流不包含知识图像的数据。在一种实现方式中,知识流和主流穿插拼接为一个码流。Main bit stream: also called main code stream, refers to the bit stream to which the image referring to the knowledge image belongs, and the bit stream does not contain the data of the knowledge image. In an implementation manner, the knowledge stream and the mainstream are interspersed and spliced into one code stream.
实施例Example
在本实施例中,提供一种传输流/节目流的处理方法,如图10所示,该方法通过解析传输流/节目流中包含的知识位流依赖关系标识信息来识别节目中是否存在知识位流和以及参考知识位流的主位流,如果参考知识位流的主位流存在的话,则为该主位流定位其所依赖的知识位流以用于解码处理。具体的,处理操作如下:In this embodiment, a transport stream/program stream processing method is provided. As shown in FIG. The bitstream and the master bitstream that references the knowledge bitstream, if present, locates the knowledge bitstream it depends on for the master bitstream for the decoding process. Specifically, the processing operations are as follows:
1.获取传输流或节目流;1. Obtain transport stream or program stream;
2.解析所述传输流或节目流中的依赖关系标识信息,以获得主位流与知识位流之间的依赖关系;2. Analyzing the dependency identification information in the transport stream or program stream to obtain the dependency between the main bit stream and the knowledge bit stream;
3.根据所述依赖关系,处理传输流或节目流以得到主位流及其参考的知识位流;3. According to the dependency relationship, process the transport stream or the program stream to obtain the main bit stream and its referenced knowledge bit stream;
4.以知识位流中的知识图像作为参考图像对主位流中的图像进行解码。4. Using the knowledge picture in the knowledge bit stream as a reference picture to decode the picture in the main bit stream.
与该实施例相对应的另一种实施例,在发送端提供一种传输流/节目流的生成方法,如图11所示,该方法用于生成上述处理方法所处理的流。具体的,生成操作如下:Another embodiment corresponding to this embodiment provides a transport stream/program stream generation method at the sending end, as shown in FIG. 11 , the method is used to generate the stream processed by the above processing method. Specifically, the generation operation is as follows:
1.获取主位流及其依赖的知识位流;1. Obtain the main bit stream and its dependent knowledge bit stream;
2.分别将所述主位流和所述知识位流作为基本流进行分包得到基本流分组包,并将其放入传输流分组包或节目流分组包;2. subpacket the main bit stream and the knowledge bit stream respectively as elementary streams to obtain elementary stream packets, and put them into transport stream packets or program stream packets;
3.在所述传输流分组包或节目流分组包中放入依赖关系标识信息,该信息描述所述主位流所属的基本流和所述知识位流所属的基本流之间的依赖关系;3. Putting dependency identification information in the transport stream packet or program stream packet, the information describes the dependency between the elementary stream to which the main bitstream belongs and the elementary stream to which the knowledge bitstream belongs;
4.输出生成得到的传输流或节目流。4. Output the generated Transport Stream or Program Stream.
上述实施例所公开的方法提供了传输流和节目流的生成和处理的关键操作,在不同的实现方式和应用场景中,上述操作会进一步扩展。The methods disclosed in the above embodiments provide key operations for generating and processing transport streams and program streams. In different implementations and application scenarios, the above operations will be further expanded.
在一种实现方式中,上述“根据所述依赖关系,处理传输流或节目流以得到主位流及其参考的知识位流”的操作进一步包括:解析传输流或节目流中分组包的包头信息,根据包头信息获取传输流或节目流中包含的节目的信息以及节目中基本流的信息。In an implementation manner, the above operation of "processing the transport stream or program stream to obtain the main bit stream and its reference knowledge bit stream according to the dependency relationship" further includes: parsing the header of the packet in the transport stream or program stream Information, according to the packet header information to obtain the information of the program contained in the transport stream or program stream and the information of the elementary stream in the program.
具体的,对于传输流,根据传输流分组包的包头信息解析得到传输流分组包中承载的节目关联表PAT和节目映射表PMT以及可能存在的条件接受表CAT和网络信息表NIT等,从这些表中解析得到节目的编号信息、节目中包含的基本流的信息、基本流的属性信息等。Specifically, for the transport stream, according to the header information of the transport stream packet, the program association table PAT and program mapping table PMT carried in the transport stream packet, as well as the conditional acceptance table CAT and network information table NIT that may exist, are obtained from these The serial number information of the program, the information of the elementary stream contained in the program, the attribute information of the elementary stream, etc. are obtained by parsing the table.
具体的,对于节目流,根据节目流分组包的包头信息解析得到节目流分组包中承载的节目流映射段PSM和节目流地址段PSD,从这些表中解析得到节目的编号信息、节目中包含的基本流的信息、基本流的属性信息等。Specifically, for the program stream, the program stream mapping segment PSM and the program stream address segment PSD carried in the program stream packet are obtained by parsing the header information of the program stream packet, and the number information of the program, the Basic stream information, basic stream attribute information, etc.
从传输流的PAT或PMT或节目流的PSM中,获取得到依赖关系标识信息,以识别节目中的基本流是知识位流还是主位流,并获得主位流和知识位流之间的依赖关系。Obtain the dependency identification information from the PAT or PMT of the transport stream or the PSM of the program stream to identify whether the elementary stream in the program is a knowledge bit stream or a main bit stream, and obtain the dependency between the main bit stream and the knowledge bit stream relation.
在另一种实现方式中,上述“根据所述依赖关系,处理传输流或节目流以得到主位流及其参考的知识位流”的操作进一步包括:根据上述解析得到的信息,从节目流分组包中获取目标节目所属的PES分组包,并从PES分组包中提取得到目标节目中的基本流的数据。然后根据上述解析得到的依赖关系标识信息,识别并获取包含主位流的基本流和包含知识位流的基本流。In another implementation, the above operation of "processing the transport stream or program stream according to the dependency relationship to obtain the main bit stream and its referenced knowledge bit stream" further includes: The PES packet to which the target program belongs is obtained from the packet, and the data of the elementary stream in the target program is extracted from the PES packet. Then, according to the dependency identification information obtained through the above analysis, the elementary stream including the main bitstream and the elementary stream including the knowledge bitstream are identified and acquired.
在又一种实现方式中,上述“以知识位流中的知识图像作为参考图像对主位流中的图像进行解码”的操作,还包括:当主位流中待解码的图像是RL图像时,仅使用知识位流中的知识图像作为参考图像进行解码;当主位流中待解码的图像是P/B图像时,使用其原有的短期参考图像和(如果该图像参考知识图像的话)知识图像组成的参考图像集进行解码。In yet another implementation, the above-mentioned operation of "using the knowledge image in the knowledge bitstream as a reference image to decode the image in the main bitstream" further includes: when the image to be decoded in the main bitstream is an RL image, Only use the knowledge picture in the knowledge bitstream as a reference picture for decoding; when the picture to be decoded in the main bitstream is a P/B picture, use its original short-term reference picture and (if the picture refers to the knowledge picture) the knowledge picture The composed reference image set is decoded.
在一种实现方式中,上述传输流和节目流的生成方法还包括:主位流和知识位流分别被作为不同的基本流被分包为PES分组包。这些PES分组包的排序可以是先生成包含知识位流的PES分组包,再生成包含主位流的PES分组包;也可以是先生成包含主位流的PES分组包,再生成包含知识位流的PES分组包;也可以是两者交替穿插生成。再另一种实现方式中,上述传输流和节目流的生成方法还包括:主位流和知识位流合为一个基本流被分包为PES分组包,此时知识位流的数据和主位流的数据不能同时存在于同一个PES分组包中。In an implementation manner, the method for generating the transport stream and the program stream further includes: the main bit stream and the knowledge bit stream are respectively divided into PES packets as different elementary streams. The ordering of these PES packets can be to first generate PES packets containing the knowledge bit stream, and then generate PES packets containing the main bit stream; or first generate PES packets containing the main bit stream, and then generate PES packets containing the knowledge bit stream The PES packet; it can also be alternately interspersed with the two. In yet another implementation, the method for generating the above-mentioned transport stream and program stream further includes: the main bit stream and the knowledge bit stream are combined into one elementary stream and subpackaged into PES packets. At this time, the data of the knowledge bit stream and the main bit Stream data cannot exist simultaneously in the same PES packet.
在又一种实现方式中,上述“在所述传输流分组包或节目流分组包中放入依赖关系标识信息”的操作还包括:In yet another implementation manner, the above-mentioned operation of "putting dependency identification information into the transport stream packet or program stream packet" further includes:
对于传输流,将所述依赖关系标识信息放入传输流分组包中承载的节目关联表PAT或节目映射表PMT以及可能存在的条件接受表CAT和网络信息表NIT等表中。For the transport stream, put the dependency identification information into the program association table PAT or program mapping table PMT carried in the transport stream packet, as well as the conditional acceptance table CAT and network information table NIT that may exist.
对于节目流,将所述依赖关系标识信息放入节目流分组包承载的节目流映射段PSM或节目流地址段PSD。For the program stream, the dependency identification information is put into the program stream mapping segment PSM or the program stream address segment PSD carried in the program stream packet.
上述实施例及其实现方式中,依赖关系标识信息的生成和处理的具体实现方法有多种,具体阐述如下。In the foregoing embodiments and implementations thereof, there are many specific implementation methods for generating and processing the dependency identification information, which are described in detail as follows.
在一种实现方式中,考虑到与现有标准方法的兼容性,尝试利用已有语法元素并增加新语义来区分主位流和知识位流并描述其之间的依赖关系。In one implementation, considering the compatibility with the existing standard methods, an attempt is made to use existing syntax elements and add new semantics to distinguish the main bit stream and the knowledge bit stream and describe the dependencies between them.
具体的,在传输流的适应字段(adaptation field)中,存在语法元素elementary_stream_priority_indicator以描述该适应字段所属的传输流分组包中所包含的接奔流的重要性,可以复用该语法元素,并增加新的语义以区分主位流和知识位流并描述其间的依赖关系。例如,在适应字段中语法元素基本流优先级指示符字段elementary_stream_priority_indicator增加以下斜体字部分的语义(其他语义为该字段/语法元素的原有语义):Specifically, in the adaptation field (adaptation field) of the transport stream, there is a syntax element elementary_stream_priority_indicator to describe the importance of the connection stream contained in the transport stream packet to which the adaptation field belongs. This syntax element can be reused and a new semantics to distinguish master bitstream and knowledge bitstream and describe the dependencies between them. For example, in the adaptation field, the syntax element elementary stream priority indicator field elementary_stream_priority_indicator adds the following semantics in italics (other semantics are the original semantics of this field/grammatical element):
“该字段为1位,指出在有相同PEID的传输流分组包中有效负载数据中携带的基本流数据的优先级。值为‘1’表示有效负载数据比其它传输流分组包中的优先级高。对于视频,只有当有效负载数据包含来自于帧内编码图像的一个或多个字节时,该字段才可能为‘1’。值为‘0’表示有效负载数据与其它该字段值不为‘1’的传输流分组包有相同的优先级。对于AVS3编码的视频,当存在知识位流和主位流时,值为‘0’表示有效负载数据属于主位流,值为‘1’表示有效负载数据属于知识位流,在解码主位流的数据时需要先解码知识位流的数据。”"This field is 1 bit and indicates the priority of the elementary stream data carried in the payload data of the transport stream packet with the same PEID. A value of '1' indicates that the payload data has priority over other transport stream packets High. For video, this field may only be '1' if the payload data contains one or more bytes from an intra-coded picture. A value of '0' indicates that the payload data is different from other values of this field. Transport stream packets with '1' have the same priority. For AVS3 encoded video, when there are knowledge bit streams and main bit streams, the value '0' indicates that the payload data belongs to the main bit stream, and the value is '1' 'Indicates that the payload data belongs to the knowledge bit stream, and the data of the knowledge bit stream needs to be decoded first when decoding the data of the main bit stream."
这种实现方式的好处是并不需要新增语法元素,但是由于适应字段只存在于传输流分组包中,且适应字段主要包含一些不重要的信息,是可选的字段,因此,该方案可能会引入别的冗余语法元素,且并不能解决节目流中依赖关系的描述问题。The advantage of this implementation is that there is no need to add new syntax elements, but since the adaptation field only exists in the transport stream packet, and the adaptation field mainly contains some unimportant information, it is an optional field, so this scheme may It will introduce other redundant grammatical elements, and cannot solve the problem of describing dependencies in program streams.
在又一种实现方式中,考虑到在传输流的节目映射表PMT和节目流的节目流映射PSM中记录了每个节目所包含的基本流,因此可以在传输流的节目映射表和节目流的节目流映射中增加额外标识,以描述主位流和知识位流之间的依赖关系。如下表所示,其中斜体部分的语法元素为新增的用于标识主位流和知识位流之间依赖关系的语法元素。In yet another implementation, considering that the elementary streams contained in each program are recorded in the program mapping table PMT of the transport stream and the program stream mapping PSM of the program stream, the program mapping table of the transport stream and the program stream Additional flags are added to the program stream map of the program to describe the dependency relationship between the main bit stream and the knowledge bit stream. As shown in the following table, the syntax elements in italics are newly added syntax elements used to identify the dependency relationship between the main bit stream and the knowledge bit stream.
表1传输流节目映射表的语法元素Table 1 Syntax elements of the transport stream program mapping table
其中,节目映射表中已有的语法元素及其定义在现有传输流的方法中可以找到准确的描述,此处不在赘述。新增的语法元素标识的语义如下:Among them, the existing syntax elements and their definitions in the program mapping table can be accurately described in the existing method of transport stream, and will not be repeated here. The semantics of the newly added syntax element identifier are as follows:
知识位流标识is_library_streamKnowledge bit stream identifier is_library_stream
该字段为1位。定义了该标识对应的基本流是否为节目中的知识位流。值为‘1’表示该标识对应的基本流是知识位流,被同一节目中的主位流所依赖;值为‘0’表示该标识对应的基本流是主位流,其依赖同一节目中的知识位流,在解码该主位流之前应方法其依赖的知识位流。This field is 1 bit. It defines whether the elementary stream corresponding to this identifier is a knowledge bit stream in the program. A value of '1' indicates that the elementary stream corresponding to this flag is a knowledge bit stream, which is dependent on the main bit stream in the same program; a value of '0' indicates that the elementary stream corresponding to this flag is a main bit stream, which is dependent on The knowledge bitstream of the main bitstream should be processed before decoding the main bitstream.
在节目映射表中增加条件判断“if(stream_type==0xD4)”的目的是为了减少语法元素is_library_stream在处理非大跨度编码的视频位流时的数据浪费,因为只有当被处理的视频流使用了AVS3编码方法(stream_type定义为0xD)并且产生了主位流和知识位流时,才有必要使用语法元素is_library_stream。The purpose of adding the conditional judgment "if(stream_type==0xD4)" in the program mapping table is to reduce the data waste of the syntax element is_library_stream when processing non-long-span coded video bit streams, because only when the processed video stream uses The syntax element is_library_stream is only necessary when the AVS3 encoding method (stream_type is defined as 0xD) and the main bit stream and knowledge bit stream are generated.
这种实现方式的好处是在解析PMT或PSM的时候就可以快速获得主位流和知识位流之间的依赖关系,但是该标识在仅使用AVS3编码方法而只产生主位流时,会浪费数据量,同时也不能兼容原有标准方法。The advantage of this implementation is that the dependency relationship between the main bit stream and the knowledge bit stream can be quickly obtained when parsing PMT or PSM, but this flag will be wasted when only using the AVS3 encoding method to generate only the main bit stream At the same time, it is not compatible with the original standard method.
在另一种实现方式中,针对节目流的生成和处理,在节目流的节目流映射中新增语法元素,如下表所示。In another implementation manner, for the generation and processing of the program stream, a new syntax element is added in the program stream mapping of the program stream, as shown in the following table.
表2节目流的节目流映射的语法Table 2 Syntax of Program Stream Mapping of Program Stream
其中,节目映射表中已有的语法元素及其定义在现有传输流的方法中可以找到准确的描述,此处不在赘述。新增的语法元素标识的语义如下:Among them, the existing syntax elements and their definitions in the program mapping table can be accurately described in the existing method of transport stream, and will not be repeated here. The semantics of the newly added syntax element identifier are as follows:
知识位流标识is_library_streamKnowledge bit stream identifier is_library_stream
该字段为1位。定义了该标识对应的基本流是否为节目中的知识位流。值为‘1’表示该标识对应的基本流是知识位流,被同一节目中的主位流所依赖;值为‘0’表示该标识对应的基本流是主位流,其依赖同一节目中的知识位流,在解码该主位流之前应方法其依赖的知识位流。This field is 1 bit. It defines whether the elementary stream corresponding to this identifier is a knowledge bit stream in the program. A value of '1' indicates that the elementary stream corresponding to this flag is a knowledge bit stream, which is dependent on the main bit stream in the same program; a value of '0' indicates that the elementary stream corresponding to this flag is a main bit stream, which is dependent on The knowledge bitstream of the main bitstream should be processed before decoding the main bitstream.
该实现方式和前一种实现方式的优劣相当。This implementation has the same advantages and disadvantages as the previous implementation.
在另一种实现方式中,考虑到传输流和节目流中存在节目元素描述子能够描述基本流的属性,因此可以新增描述子以描述主位流和知识位流之间的依赖关系。本实施例设计AVS3大跨度编码视频流描述子,以表示包含使用AVS3中基于大时间跨度相关信息的编码方法编码得到的包含主位流和知识位流的视频的节目元素。这些节目元素被复用在多个流中。In another implementation, considering that there are program element descriptors in the transport stream and the program stream that can describe the attributes of the elementary stream, a new descriptor can be added to describe the dependency between the primary bit stream and the knowledge bit stream. In this embodiment, the AVS3 long-span coded video stream descriptor is designed to represent the program elements including the video coded by using the coding method based on the large time-span related information in AVS3, including the main bit stream and the knowledge bit stream. These program elements are multiplexed in multiple streams.
表3 AVS3大跨度编码视频流描述子Table 3 AVS3 long-span coded video stream descriptor
其中,语法元素的语义如下,其中所定义的位数和取值仅用于举例,其可以是任意可用的位数和取值:Among them, the semantics of the syntax elements are as follows, and the defined number of digits and values are for example only, which can be any available number of digits and values:
描述子标签字段descriptor_tagDescription sub-tag field descriptor_tag
该字段长度为8位,用于标识每一描述子。This field has a length of 8 bits and is used to identify each descriptor.
描述子长度字段descriptor_lengthDescriptor length field descriptor_length
该字段长度为8位。规定了紧跟在该字段之后的描述子的字节数。This field is 8 bits long. Specifies the number of bytes of the descriptor immediately following this field.
知识位流标识is_library_streamKnowledge bit stream identifier is_library_stream
该字段为1位。定义了与该描述子对应的基本流是否为节目中的知识位流。值为‘1’表示该描述子对应的基本流是知识位流,被同一节目中的主位流所依赖;值为‘0’表示该描述子对应的基本流是主位流,其依赖同一节目中的知识位流,在解码该主位流之前应方法其依赖的知识位流。This field is 1 bit. It defines whether the elementary stream corresponding to the descriptor is a knowledge bit stream in the program. A value of '1' indicates that the elementary stream corresponding to this descriptor is a knowledge bit stream, which is dependent on the main bit stream in the same program; a value of '0' indicates that the elementary stream corresponding to this descriptor is a main bit stream, which depends on the same For the knowledge bitstream in the program, the knowledge bitstream it depends on should be processed before decoding the main bitstream.
上述方法使用节目元素描述子,对原有标准又兼容性,且描述子可以由生成端自由选择,因此也避免了数据的浪费,这是一种即兼容又能够节省数据量的实现方式。但是上述实现方式仅使用1bit标识来判断节目中的基本流是知识位流还是主位流,默认主位流一定参考知识位流,这样并不能应对各种应用情况。The above method uses program element descriptors, which are compatible with the original standards, and the descriptors can be freely selected by the generating end, thus avoiding data waste. This is a compatible and data-saving implementation. However, the above implementation method only uses 1 bit identifier to judge whether the basic stream in the program is a knowledge bit stream or a main bit stream. By default, the main bit stream must refer to the knowledge bit stream, which cannot cope with various application situations.
因此,在又一种实现方式中,对节目元素描述子中的语法元素进行扩充,在标识主位流和知识位流的基础上,进一步标识主流参考的知识位流的索引号,同时支持了一个主位流可以参考多个知识位流的场景。该扩充的描述子的语法和语义如下表。Therefore, in another implementation, the syntax elements in the program element descriptor are extended, and on the basis of identifying the main bit stream and the knowledge bit stream, the index number of the knowledge bit stream referenced by the main stream is further identified, and at the same time it supports Scenarios where one master bitstream can refer to multiple knowledge bitstreams. The syntax and semantics of this extended descriptor are as follows.
表4 AVS3大跨度编码视频流描述子Table 4 AVS3 long-span coded video stream descriptor
其中,语法元素的语义如下,其中所定义的位数和取值仅用于举例,其可以是任意可用的位数和取值:Among them, the semantics of the syntax elements are as follows, and the defined number of digits and values are for example only, which can be any available number of digits and values:
描述子标签字段descriptor_tagDescription sub-tag field descriptor_tag
该字段长度为8位,用于标识每一描述子。This field has a length of 8 bits and is used to identify each descriptor.
描述子长度字段descriptor_lengthDescriptor length field descriptor_length
该字段长度为8位。规定了紧跟在该字段之后的描述子的字节数。This field is 8 bits long. Specifies the number of bytes of the descriptor immediately following this field.
知识位流标识is_library_streamKnowledge bit stream identifier is_library_stream
该字段为1位。定义了与该描述子对应的基本流是否为节目中的知识位流。值为‘1’表示该描述子对应的基本流是知识位流;值为‘0’表示该描述子对应的基本流是主位流,其依赖同一节目中的知识位流,在解码该主位流之前应方法其依赖的知识位流。This field is 1 bit. It defines whether the elementary stream corresponding to the descriptor is a knowledge bit stream in the program. A value of '1' indicates that the elementary stream corresponding to this descriptor is a knowledge bit stream; a value of '0' indicates that the elementary stream corresponding to this descriptor is a main bit stream, which depends on the knowledge bit stream in the same program and is decoded when decoding the main bit stream. Bitstreams should be preceded by methods of the knowledge bitstreams on which they depend.
被参考的知识位流数量字段num_ref_library_streamReferenced knowledge bit stream number field num_ref_library_stream
该字段长度为8位。定义了该描述子对应的基本流是主位流时,其参考的包含知识位流的基本位流的数量。num_ref_library_stream的值可以为0,此时主位流不参考知识位流。This field is 8 bits long. When the elementary stream corresponding to the descriptor is defined as the main bit stream, the number of elementary bit streams including the knowledge bit stream that it refers to. The value of num_ref_library_stream can be 0, at this time, the main bit stream does not refer to the knowledge bit stream.
被参考的知识位流索引号library_stream_idReferenced knowledge bit stream index number library_stream_id
该字段长度为8位。定义了该描述子对应的基本流是主位流时,其参考的包含知识位流的基本位流的索引号。This field is 8 bits long. When the elementary stream corresponding to this descriptor is defined as the main bit stream, it refers to the index number of the elementary bit stream including the knowledge bit stream.
在一种实施例中,上述所有实施例及其实现方式还应该满足约束条件:在将知识位流和主位流分包为PES分组包时,被参考的知识位流中知识图像所属的PES分组包中记录的解码时刻DTS应比参考所述知识位流的主位流中主位流图像所属的基本流分组包中记录的解码时刻更早,其中所述主位流图像是所述主位流中首个参考所述知识图像进行解码的图像。In one embodiment, all the above-mentioned embodiments and their implementations should also meet the constraints: when the knowledge bit stream and the main bit stream are subpackaged into PES packets, the PES to which the knowledge image belongs in the referenced knowledge bit stream The decoding moment DTS recorded in the packet shall be earlier than the decoding moment recorded in the packet of the elementary stream to which the primary bitstream picture belongs in the primary bitstream referencing the knowledge bitstream, wherein the primary bitstream image is the primary bitstream image of the primary bitstream The first image in the bitstream to be decoded with reference to the knowledge image.
在一种实施例中,上述约束可以通过其他方法来满足。一种实现方法是知识位流中知识图像所属的PES分组包的解码时刻DTS被扩充为多个DTS,这些DTS与主位流中参考该知识图像的所有主位流图像所属的PES分组包的解码时刻一一对应,即包含知识图像的PES分组包在多个时刻被解码用于参考。在另一种实现方法中,知识图像所属的PES分组包不使用DTS与主位流图像建立依赖关系,而是可以在主位流所属的PES分组包中增加新的图像级依赖关系标识信息,该标识信息能够索引到该PES分组包中的主位流图像所参考的所有知识图像所在PES分组包,与前一种实现方式相比,这是一种明示的依赖关系表达方法。In one embodiment, the above constraints can be satisfied by other methods. One method of realization is that the decoding moment DTS of the PES packet to which the knowledge image belongs in the knowledge bitstream is expanded into multiple DTSs, and these DTS are related to the PES packets to which all the main bitstream images that refer to the knowledge image in the main bitstream belong. One-to-one correspondence between decoding moments, that is, PES packets containing knowledge images are decoded at multiple moments for reference. In another implementation method, the PES packet to which the knowledge image belongs does not use DTS to establish a dependency relationship with the main bitstream image, but can add new image-level dependency identification information to the PES packet to which the main bitstream belongs. The identification information can be indexed to the PES packet where all the knowledge images referenced by the main bitstream image in the PES packet are located. Compared with the previous implementation, this is an explicit expression method of dependency relationship.
在又一个实施例中,当使用节目中存在主位流及其依赖的知识位流时,使用前述方法生成传输流时,其数据结构应当如图12所示。其中,该TS流中的一个视频节目包含两个基本流,分别是知识位流(其所属的TS分组包的PID=0x11)和主位流(其所属的TS分组包的PID=0x12)。在PMT中,为该节目的两个基本流分别增加了avs3crr_descriptor(),其中包含知识位流的基本流对应的描述子中is_library_stream标识的值为1,包含主位流的基本流对应的描述子中is_library_stream标识的值为0。In yet another embodiment, when the main bitstream and its dependent knowledge bitstream exist in the program, and the transport stream is generated using the aforementioned method, its data structure should be as shown in FIG. 12 . Wherein, a video program in the TS stream includes two elementary streams, namely the knowledge bit stream (the PID of the TS packet to which it belongs=0x11) and the main bit stream (the PID of the TS packet to which it belongs=0x12). In PMT, avs3crr_descriptor() is added for the two elementary streams of the program, the value of is_library_stream in the descriptor corresponding to the elementary stream containing the knowledge bit stream is 1, and the descriptor corresponding to the elementary stream containing the main bit stream The value of the is_library_stream flag in is 0.
同样的,在另一种实施例中,使用上述方法来生成节目流时,其数据结构应当如图13所示。其中,该PS流中的一个视频节目包含两个基本流,分别是知识位流(其所属的PS分组包的PID=0x11)和主位流(其所属的PS分组包的PID=0x12)。在PSM中,为该节目的两个基本流分别增加了avs3crr_descriptor(),其中包含知识位流的基本流对应的描述子中is_library_stream标识的值为1,包含主位流的基本流对应的描述子中is_library_stream标识的值为0。Similarly, in another embodiment, when the above method is used to generate the program stream, its data structure should be as shown in FIG. 13 . Wherein, a video program in the PS stream includes two elementary streams, which are the knowledge bit stream (the PID of the PS packet to which it belongs=0x11) and the primary bit stream (the PID of the PS packet to which it belongs=0x12). In PSM, avs3crr_descriptor() is added for the two elementary streams of the program, the value of is_library_stream in the descriptor corresponding to the elementary stream containing the knowledge bit stream is 1, and the descriptor corresponding to the elementary stream containing the main bit stream The value of the is_library_stream flag in is 0.
在又一种实施例中,接收端在处理接收到的传输流或节目流时,需要经过一系列的缓冲和解复用的操作,然后可以获取传输流或节目流中的基本流数据以用于解码。本实施例描述接收端应当实现的操作,以此实现基本流数据的正确缓冲和解码,避免基本流数据在数据缓存中出现上溢或下溢的情况。In yet another embodiment, when processing the received transport stream or program stream, the receiving end needs to go through a series of buffering and demultiplexing operations, and then obtain the elementary stream data in the transport stream or program stream for use in decoding. This embodiment describes the operations that the receiving end should implement, so as to realize correct buffering and decoding of elementary stream data, and avoid overflow or underflow of elementary stream data in the data cache.
上述提供了传输流和节目流的生成和处理方法,相应的,上述实施例和实现方式的操作都可以实现为相应的装置和模块。The methods for generating and processing transport streams and program streams are provided above. Correspondingly, the operations in the above embodiments and implementations can be implemented as corresponding devices and modules.
在一种实施例中,提供一种传输流/节目流的处理装置,如图14所示,该装置包括处理器和存储以及一组能够实现一下操作的模块,包括:In one embodiment, a transport stream/program stream processing device is provided. As shown in FIG. 14 , the device includes a processor, storage and a set of modules capable of implementing the following operations, including:
1.获取模块:用于获取传输流或节目流;1. Obtaining module: used to obtain transport stream or program stream;
2.解析模块:解析所述传输流或节目流中的依赖关系标识信息,以获得主位流与知识位流之间的依赖关系;2. Parsing module: parsing the dependency identification information in the transport stream or program stream to obtain the dependency between the main bit stream and the knowledge bit stream;
3.处理模块:根据所述依赖关系,处理传输流或节目流以得到主位流及其参考的知识位流;3. Processing module: according to the dependency relationship, process the transport stream or the program stream to obtain the main bit stream and its referenced knowledge bit stream;
4.解码模块:以知识位流中的知识图像作为参考图像对主位流中的图像进行解码。所述模块的程序都存在与存储中并由处理器执行。4. Decoding module: use the knowledge image in the knowledge bit stream as a reference image to decode the image in the main bit stream. The programs of the modules are all stored and executed by the processor.
与该实施例相对应的另一种实施例,在发送端提供一种传输流/节目流的生成装置,如图15所示,该装置包括处理器和存储以及一组能够实现一下操作的模块,包括:Another embodiment corresponding to this embodiment provides a transport stream/program stream generation device at the sending end, as shown in Figure 15, the device includes a processor, storage and a set of modules capable of implementing the following operations ,include:
1.获取模块:获取主位流及其依赖的知识位流;1. Acquisition module: acquire the main bit stream and its dependent knowledge bit stream;
2.分包模块:分别将所述主位流和所述知识位流作为基本流分包放入传输流分组包或节目流分组包;2. Packetization module: respectively put the main bit stream and the knowledge bit stream into transport stream packets or program stream packets as elementary stream packets;
3.放入模块:在所述传输流分组包或节目流分组包中放入依赖关系标识信息,该信息描述所述主位流所属的基本流和所述知识位流所属的基本流之间的依赖关系;3. Inserting module: put dependency identification information in the transport stream packet or program stream packet, this information describes the relationship between the elementary stream to which the main bit stream belongs and the elementary stream to which the knowledge bit stream belongs dependencies;
4.输出模块:输出生成得到的传输流或节目流。4. Output module: output the generated transport stream or program stream.
所述模块的程序都存在与存储中并由处理器执行。The programs of the modules are all stored and executed by the processor.
以上实施方式仅用以说明本发明的技术方案而非限制,尽管参照以上较佳实施方式对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换都不应脱离本发明技术方案的精神和范围。The above embodiments are only used to illustrate the technical solutions of the present invention without limitation. Although the present invention has been described in detail with reference to the above preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced All should not deviate from the spirit and scope of the technical solution of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111125693.3A CN115866258A (en) | 2021-09-24 | 2021-09-24 | Method and device for generating and processing transport stream and program stream |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111125693.3A CN115866258A (en) | 2021-09-24 | 2021-09-24 | Method and device for generating and processing transport stream and program stream |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115866258A true CN115866258A (en) | 2023-03-28 |
Family
ID=85652676
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111125693.3A Pending CN115866258A (en) | 2021-09-24 | 2021-09-24 | Method and device for generating and processing transport stream and program stream |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115866258A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024255592A1 (en) * | 2023-06-13 | 2024-12-19 | 华为技术有限公司 | Coding method and apparatus, and decoding method and apparatus |
-
2021
- 2021-09-24 CN CN202111125693.3A patent/CN115866258A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024255592A1 (en) * | 2023-06-13 | 2024-12-19 | 华为技术有限公司 | Coding method and apparatus, and decoding method and apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11581022B2 (en) | Method and apparatus for storage and signaling of compressed point clouds | |
US11595670B2 (en) | Method and apparatus for storage and signaling of sub-sample entry descriptions | |
JP5450810B2 (en) | Assembling a multi-view video encoding sub-bitstream in the MPEG-2 system | |
US8351514B2 (en) | Method, protocol, and apparatus for transporting advanced video coding content | |
CN110876083B (en) | Method and device for specifying reference image and method and device for processing reference image request | |
JP5378599B2 (en) | Multi-view video coding in MPEG-2 system | |
US9456209B2 (en) | Method of multiplexing H.264 elementary streams without timing information coded | |
JP5462259B2 (en) | Method and apparatus for track and track subset grouping | |
US11638066B2 (en) | Method, device and computer program for encapsulating media data into a media file | |
JP5591932B2 (en) | Media extractor track for file format track selection | |
US20140007172A1 (en) | Method and apparatus for transmitting/receiving adaptive media in a multimedia system | |
WO2012173389A2 (en) | Method and apparatus for transmitting/receiving media contents in multimedia system | |
CN102017624A (en) | Flexible sub-stream referencing within a transport data stream | |
WO2018054193A1 (en) | Data transmission method and apparatus, and electronic device | |
US12052464B2 (en) | Methods and apparatus for media data processing and transmitting and reference picture specifying | |
EP3306945B1 (en) | Bitstream alignment and synchronous processing method and system, receiving terminal and communication system | |
ES2648970T3 (en) | Multilayer video stream encoding and decoding | |
CN115866258A (en) | Method and device for generating and processing transport stream and program stream | |
JP2019220974A (en) | Decoder | |
US20220360831A1 (en) | Method, device, and computer program for encapsulating media data into a media file | |
Binh et al. | Design and implementation of an embedded multimedia live streaming decoder system | |
STANDARD | Stereoscopic 3D Full Resolution Contribution Link Based on MPEG-2 TS | |
STANDARD | Mapping of AES3 Data into an MPEG-2 Transport Stream |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |