CN102572521A - Method and system for automatically distributing code rate of basic video code stream of transmission stream - Google Patents

Method and system for automatically distributing code rate of basic video code stream of transmission stream Download PDF

Info

Publication number
CN102572521A
CN102572521A CN2012100168836A CN201210016883A CN102572521A CN 102572521 A CN102572521 A CN 102572521A CN 2012100168836 A CN2012100168836 A CN 2012100168836A CN 201210016883 A CN201210016883 A CN 201210016883A CN 102572521 A CN102572521 A CN 102572521A
Authority
CN
China
Prior art keywords
video
code check
program
code
audio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012100168836A
Other languages
Chinese (zh)
Other versions
CN102572521B (en
Inventor
魏伟
徐昕
邵冬英
呼大明
郑海鸥
何畅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING BASTRIVER CO LTD
Original Assignee
BEIJING BASTRIVER CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING BASTRIVER CO LTD filed Critical BEIJING BASTRIVER CO LTD
Priority to CN201210016883.6A priority Critical patent/CN102572521B/en
Publication of CN102572521A publication Critical patent/CN102572521A/en
Application granted granted Critical
Publication of CN102572521B publication Critical patent/CN102572521B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for automatically distributing a code rate of a basic video code stream of a transmission stream (TS). According to the method, the video code rate is automatically distributed according to configuration information of a sending end, so that use and configuration processes of the sending end are simplified; and therefore, on the premise of guaranteeing the normal work of a digital television system, the waste of bandwidth is reduced, and the image quality is improved. The method is applied to the sending end of a digital television, so that a receiving end of the digital television can normally receive and decode video streams without other configurations. The invention also discloses a system for automatically distributing the code rate of the basic video code stream of the transmission stream, an encoding method and an encoder. The video code rate can be distributed precisely according to a channel bandwidth and a multiplexing parameter; and under the condition of guaranteeing the normal work of the whole system, the channel bandwidth can be used to the maximum extent, the TS empty package rate is reduced, and the video image quality is improved. The method and system, encoding method and encoder disclosed by the invention can be suitable for various multiplexing, audio and video encoding standards.

Description

A kind of method and system of automatic distribution MPTS video elementary code stream code check
Technical field
The present invention relates to video coding, the multiplexing and encoding technology of DTV, is a kind of method and system of automatic distribution MPTS video elementary code stream code check specifically.
Background technology
At digital TV field, a programs should comprise one road video and one road audio frequency at least, and video, voice data are produced by separate video encoder, audio coder, and they all can not directly transfer to decoding end.Multiplexer is packaged into single data flow with separate video, voice data according to specified format, and in this data flow, inserts necessary descriptor, guarantee decoding end can zero defect ground, labial synchronously decodes and obtains video, voice data.Generally speaking; The broadcast end of DTV is accomplished the coding of one road program by 3 formants such as video encoder, audio coder and multiplexer; Receiving terminal is accomplished coding by 3 formants with the coding contrary such as demodulation multiplexer, Video Decoder, audio decoder, thereby realizes the complete reliable digital tv encoder of a cover, transmission, decode procedure.
For the most frequently used MPEG DTV coding/decoding system; Multiplexing and demultiplexing is stipulated by standard GB/T17975.1-2000 " the universal coding part 1 of information technology moving image and sound information thereof: system "; Coding and decoding video is by standard GB/T 17975.2-2000 " the universal coding part 2 of information technology moving image and sound information thereof: video " regulation, and audio coding decoding is stipulated by standard GB/T 17975.3-2002 " universal coding the 3rd part of information technology moving image and sound information thereof: audio frequency ".
Fig. 1 is existing typical operation flow graph; With common single-definition digital television is example; Audio input signal is the pulse code modulation (pcm) data of dual track, sample rate 48kHz; Behind the audio coder compressed encoding, obtaining bit rate output is the audio frequency elementary stream (ES) of 256Kbps, adopts the MP2 form to encode usually; Video input signals is 4:2:0 component vide (YUV) data of resolution 720x576, frame per second 25fps, behind the video encoder compressed encoding, obtains the video elementary code stream that bit rate output is 5Mbps (ES), adopts the MPEG-2 form to encode usually.Video ES, audio ES are encoded to unified MPTS (TS) by multiplexer; The TS code check should be greater than video, audio code rate sum and to stablize code check output; Usually be encoded to the TS of 6Mbps or higher code check for the video ES of 5Mbps, the audio ES of 256Kbps, residue 744Kbps or the more descriptor empty bag of filling stable that is used to transmit TS with keeping the TS code check more.
Multiplexer receiver, video ES and audio ES, it is fixing to look the inequality and every frame length of audio ES form.For the separate audio ES of looking is transmitted in unification; At first need to change it into identical packetized elementary stream of relative multiplexer (PES); And adding corresponding PES header packet information and time mark, multiplexer further will be looked audio frequency PES again and be decomposed into the short and fixing TS bag of length.The TS bag is the elementary cell of TS, and length is fixed as K (K is 188 bytes or 204 bytes), when the PES packet length is not the integral multiple of TS packet length, need fill hash to satisfy the integral multiple of K byte.Each TS bag all carries synchronous head and program identification code descriptors such as (PID), and all TS bags of same ES all have identical PID, thereby the assurance receiving terminal selects required ES to repel other ES simultaneously according to PID.
In order to guarantee the operate as normal of whole video/audio encoding and decoding system; Except that audio, video data, also must comprise Program Association Table (PAT), Program Map Table (PMT) among the TS; Also comprise one or more program specific informations that GB/T 17975.1-2000 " the universal coding part 1 of information technology moving image and sound information thereof: system " is supported alternatively, for example CAT Conditional Access Table (CAT), program description list program specific informations (PSI) such as (SDT).When the total valid data code check that comprises video/audio and PSI during, insert that to fill empty bag stable to keep the TS code check less than the TS code check.
At receiving terminal, the process of execution and transmitting terminal contrary, demodulation multiplexer flows parsing according to PID identification TS bag and completion TS.At first remove and fill empty bag; Resolving descriptors such as PAT, PMT, CAT and SDT again obtains the logical construction of TS and looks audio frequency PID; Resolve video/audio according to looking audio frequency PID again, export video-audio decoder to by frame, decoder is accomplished the TV programme that the ES decoding obtains zero defect.
In the digital television broadcasting system of reality; Transmitting terminal is commonly referred to encoder; It comprises audio coder, video encoder and multiplexer, and an encoder device should can be accomplished the coding of 1 programs at least, wherein should comprise 1 road video, 1 road audio frequency at least and export legal TS; Receiving terminal is called decoder, and it comprises demodulation multiplexer, audio decoder, Video Decoder.
The channel width of actual digital TV broadcasting network is fixed; Realize that the stabilization signal transmission just requires the TS code check stable; At first require the stable and code check sum of the bit rate output of video encoding device of transmitting terminal less than the TS total bitrate, so that there are enough bandwidth to send PSI information; The code check of audio ES is lower and stable, and major part and code check that video ES accounts for TS possibly fluctuate, and the setting of video ES code check is that can decision TS to stablize the key of code check output.Video ES code check is provided with too high meeting and causes sending buffering area and overflow and cause frame losing, receive abnormal conditions such as mistake; Can guarantee that whole system was in proper working order through filling empty bag though video ES code check is provided with low multiplexer, can not make full use of bandwidth resources, reduce video image quality.
In the existing techniques scheme, select lower video code rate usually for guaranteeing that system works is normal, allow certain bandwidth waste, the analysis of real figure TV signal is shown that the sky bag rate of TS is generally about 20%.Video code rate is provided with the redundancy of removing audio code rate and certain assurance system operate as normal usually with the TS code check; Remaining bandwidth is as video code rate; If the undesired video that further reduces again of system works is found in test; Do not have video code rate distribution method accurately, be inconvenient to use and the waste bandwidth resource.With the TS code check is that 6000Kbps, audio code rate are that 256Kbps is an example, and video code rate is set to 5000Kbps or 4500Kbps usually.
Summary of the invention
The objective of the invention is to propose a kind of method and system of automatic distribution MPTS video elementary code stream code check; Configuration information according to transmitting terminal distributes automatically video code rate; Simplify the use and the layoutprocedure of transmitting terminal; Guaranteeing the waste of the normal prerequisite decline of operation low bandwidth, improve picture quality.
According to the present invention, a kind of method of automatic distribution MPTS video elementary code stream code check is provided, this method comprises:
According to application demand configuration MPTS total bitrate B TS, the Program Association Table Program Map Table that sends cycle, program tricks, each programs sends the video frame rate of coding standard, audio sample rate, audio frequency elementary stream code check and each programs of audio frequency way, each road audio frequency that cycle, optional program specific information quantity, each optional program specific information send cycle, each programs;
Obtain Program Association Table code check B according to said program tricks, Program Association Table transmission cycle PAT
The Program Map Table transmission cycle according to said program tricks, each programs obtains Program Map Table code check B PMT
Obtain the code check B of optional program specific information according to the quantity of optional program specific information, the transmission cycle of each optional program specific information PSI
Audio frequency way, the coding standard of each road audio frequency, audio sample rate, audio frequency elementary stream code check according to said each programs obtain audio code rate B Audio
Video frame rate according to said program tricks, each programs obtains video filling code check B Fill
According to said MPTS total bitrate B TS, Program Association Table code check B PAT, Program Map Table code check B PMT, optional program specific information code check B PSI, audio code rate B Audio, video fills code check B FillObtain video code rate B Video
Obtain video elementary code stream code check E according to said video code rate Video
According to said video elementary code stream code check E VideoThe bit rate output of configuration video encoder.
Preferably, said optional program specific information is one or more program specific informations empty or that supported by GB/T 17975.1-2000 " the universal coding part 1 of information technology moving image and sound information thereof: system ".
Preferably, said Program Association Table code check B PATComputing formula be:
B PAT = N PAT × 1000 T PAT × K × 8
Wherein,
N PATExpression is used to represent the TS bag number of Program Association Table;
T PATIn the TS bag transmission cycle of expression Program Association Table, unit is a millisecond;
K representes the byte number of each TS bag.
Preferably, when the program tricks less than 42 the time, N PAT=1.
Preferably, said Program Map Table code check B PMTComputing formula be:
B PMT = Σ i = 1 M ( N PMT i × 1000 T PMT i × K × 8 )
Wherein,
M representes the program tricks;
Figure BDA0000132117210000053
expression is used to represent the TS bag number of the Program Map Table of each programs;
Figure BDA0000132117210000054
representes the TS bag transmission cycle of the Program Map Table of each programs, and unit is a millisecond;
K representes the byte number of each TS bag.
Preferably, the code check B of said optional program specific information PSIComputing formula be:
B PSI = Σ i = 1 S ( N PSI i × 1000 T PSI i × K × 8 )
Wherein,
S representes the quantity of optional program specific information;
Figure BDA0000132117210000061
expression is used to represent the TS bag number of each optional program specific information;
Figure BDA0000132117210000062
representes the transmission cycle of the TS bag of each optional program specific information, and unit is a millisecond;
K representes the byte number of each TS bag.
Preferably, said audio code rate B AudioBe the audio code rate sum of each programs, the audio code rate B ' of each programs AudioComputing formula be:
Wherein,
A representes the audio frequency way of each programs;
L iThe length of representing the every frame audio frequency elementary stream of each road audio frequency under the basic stream bit rate of selected audio;
H iThe audio sample rate of representing each road audio frequency;
C iRepresent the PCM sampled point number of each road audio frequency at the substandard every frame audio frequency of selected audio;
K representes the byte number of each TS bag.
Preferably, said video is filled code check B FillComputing formula be:
B fill = Σ i = 1 M ( F i 2 × K × 8 )
Wherein,
M representes the program tricks;
F iThe video frame rate of representing each programs;
K representes the byte number of each TS bag.
Preferably, said video code rate B VideoComputing formula be:
B cideo=B TS-B PAT-B PMT-B PSI-B audio-B fill
Preferably, said video elementary code stream code check E VideoComputing formula be:
B video = B video × 184 K
Wherein,
The maximum load byte number of each TS bag of 184 expressions;
K representes the byte number of each TS bag.
According to another aspect of the present invention, a kind of system of automatic distribution MPTS video elementary code stream code check, this system comprises:
Dispensing unit is used for according to application demand configuration MPTS total bitrate B TS, the Program Association Table Program Map Table that sends cycle, program tricks, each programs sends the video frame rate of coding standard, audio sample rate, audio frequency elementary stream code check and each programs of audio frequency way, each road audio frequency that cycle, optional program specific information quantity, each optional program specific information send cycle, each programs;
Program Association Table code check acquiring unit is used for obtaining Program Association Table code check B according to said program tricks, Program Association Table transmission cycle PAT
Program Map Table code check acquiring unit is used for obtaining Program Map Table code check B according to the Program Map Table transmission cycle of said program tricks, each programs PMT
Optional program specific information code check acquiring unit is used for the quantity according to optional program specific information, the transmission cycle of each optional program specific information and obtains the code check B of optional program specific information PSI
The audio code rate acquiring unit, the audio frequency way, the coding standard of each road audio frequency, audio sample rate, the audio frequency elementary stream code check that are used for according to said each programs obtain audio code rate B Audio
Video is filled the code check acquiring unit, is used for obtaining video filling code check B according to the video frame rate of said program tricks, each programs Fill
The video code rate acquiring unit is used for according to said MPTS total bitrate B TS, Program Association Table code check B PAT, Program Map Table code check B PMT, optional program specific information code check B PSI, audio code rate B Audio, video fills code check B FillObtain video code rate B Video
Video elementary code stream code check acquiring unit is used for obtaining video elementary code stream code check E according to said video code rate Video
Video elementary code stream Data Rate Distribution unit is used for according to said video elementary code stream code check E VideoThe bit rate output of configuration video encoder.
According to a third aspect of the present invention, a kind of coding method of automatic distribution MPTS video elementary code stream code check is provided, this method comprises,
Automatically distribute the video elementary code stream code check for encoder;
Encode according to said video elementary code stream code check.
According to a fourth aspect of the present invention, a kind of encoder of automatic distribution MPTS video elementary code stream code check is provided, this encoder comprises,
Video elementary code stream Data Rate Distribution unit is used for distributing the video elementary code stream code check for encoder automatically;
Coding unit is used for encoding according to said video elementary code stream code check.
The present invention acts on the transmitting terminal of DTV, need not other configuration at receiving terminal, can normally receive decoding.Automatic distribution video code rate method proposed by the invention can be distributed video code rate exactly according to channel width and multiplexing parameters; Guaranteeing under the whole system reference performance; Maximally utilise channel width; Reduce the empty bag rate of TS, improve video image quality, applicable various multiplexing, the audio frequency of the present invention, video encoding standard.
Description of drawings
Fig. 1 illustrates the operation flow chart.
Fig. 2 illustrates the method flow diagram according to the automatic distribution MPTS video elementary code stream code check of the embodiment of the invention.
Fig. 3 illustrates the block diagram according to the system of the automatic distribution MPTS video elementary code stream code check of the embodiment of the invention.
Fig. 4 illustrates the coding method flow chart according to the automatic distribution MPTS video elementary code stream code check of the embodiment of the invention.
Fig. 5 illustrates the structured flowchart according to the encoder of the automatic distribution MPTS video elementary code stream code check of the embodiment of the invention.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is done further elaboration.
Fig. 2 illustrates the method flow diagram according to the automatic distribution MPTS video elementary code stream code check of the embodiment of the invention.
In step S11, according to application demand configuration MPTS total bitrate B TS, the Program Association Table Program Map Table that sends cycle, program tricks, each programs sends the video frame rate of coding standard, audio sample rate, audio frequency elementary stream code check and each programs of audio frequency way, each road audio frequency that cycle, optional program specific information quantity, each optional program specific information send cycle, each programs.Particularly, the above-mentioned a series of configuration items that remove the video elementary code stream code check are configured at transmitting terminal, wherein, B TSMPTS (TS) the data total amount of representing transmission in 1 second.
In step S12, obtain Program Association Table code check B according to said program tricks, Program Association Table transmission cycle PAT
Particularly, Program Association Table code check B PATComputing formula be:
B PAT = N PAT × 1000 T PAT × K × 8
Wherein, N PATExpression is used to represent the TS bag number of Program Association Table; T PATIn the TS bag transmission cycle of expression Program Association Table, unit is a millisecond; K representes the byte number of each TS bag, is generally 188 bytes or 204 bytes.
According to the embodiment of the invention, the TS bag of each expression Program Association Table can be represented nearly 42 programs, therefore, when the program tricks less than 42 the time, N PAT=1, only the program tricks greater than 42 situation under N PATMaybe be greater than 1.
In step S13, obtain Program Map Table code check B according to Program Map Table transmission cycle of said program tricks, each programs PMT
Particularly, B PMTBy the program tricks of TS, the PMT transmission cycle decision of each program, the PMT of program tricks and each program cycle of sending is disposed by transmitting terminal.Suppose that the program tricks is M, each program PMT is by N PMTIndividual TS wraps and representes, each program PMT transmission cycle is T PMTMillisecond, then:
The TS bag of each expression PMT can represent to surpass 30 tunnel video and audio stream, N under the situation that video-voice frequency flow is a lot of in every programs PMTMaybe be greater than 1.N in practical application PMTSituation greater than 1 can not occur basically.
In step S14, obtain the code check B of optional program specific information according to the quantity of optional program specific information, the transmission cycle of each optional program specific information PSI
Particularly, B PSIBy the number of the optional program specific information of MPTS (TS), the transmission cycle decision of each optional program specific information, optional program specific information and transmission cycle thereof are disposed by transmitting terminal.Suppose that optional program specific information number is S, each program specific information is by N PSIIndividual TS wraps and representes, each PSI transmission cycle is T PSIMillisecond, then:
Figure BDA0000132117210000102
In step S15, obtain audio code rate B according to audio frequency way, the coding standard of each road audio frequency, audio sample rate, the audio frequency elementary stream code check of said each programs Audio
Particularly, audio code rate B AudioBe the audio code rate sum of each programs, the audio code rate B ' of each programs AudioBy the basic stream bit rate E of coding standard, audio sample rate, the audio frequency of audio frequency way and each road audio frequency AudioDetermine etc. coded system.Each frame audio frequency is by an independently integer TS bag transmission, B AudioWith audio frequency elementary stream code check E AudioDifference, audio coding standard, audio sample rate and audio frequency elementary stream code check E AudioDispose by transmitting terminal.The audio frequency way of supposing each programs is A; Every frame audio frequency of each road audio frequency selected audio standard is a C PCM sampled point; Every frame audio ES length is L under the selected audio code check; Audio sample rate is H, then:
Figure BDA0000132117210000111
When comprising multiple programs in the output transport stream, the audio code rate of each programs calculates by same procedure, and the audio code rate of each programs that adds up obtains final audio code rate B Audio
In step S16, obtain video according to the video frame rate of said program tricks, each programs and fill code check B Fill
Particularly, B FillVideo frame rate decision by program tricks and each programs.Each frame video because the length of each frame video elementary code stream (ES) is fixing, when video packetized elementary stream (PES) length is not the integral multiple of K, need be filled to the K byte when sending last TS bag by an independently integer TS bag transmission.Fill bag with different, fill in the bag and still contain video data, need be resolved for the empty bag of the stable filling of TS code check; Filling empty bag is useless all over, can directly abandon at receiving terminal.
Each frame video elementary code stream (ES) length can think that the video data byte number in last TS bag of each frame packetized elementary stream (PES) is being evenly distributed between [0, K] at random, and just the video padding data of each frame is being evenly distributed between [0, K].Video frame rate disposes at transmitting terminal, supposes that video frame rate is F, then:
B fill = F 2 × K × 8
When comprising multiple programs in the output transport stream, the video of each programs calculates video by same procedure and fills code check, and the video of the video of each programs that adds up filling code check obtains final video filling code check B Fill
In step S17, according to said MPTS total bitrate B TS, Program Association Table code check B PAT, Program Map Table code check B PMT, optional program specific information code check B PSI, audio code rate B Udio, video fills code check B FillObtain video code rate B Video
Particularly, B Video=B TS-B PAT-B PMT-B PSI-B Audio-B Fill
In step S18, obtain video elementary code stream code check E according to said video code rate Video
Particularly; The TS packet length is the K byte; Information such as the fixing expression of preceding K ' byte synchronous head, PID; Then the maximum load of TS bag is K-K ' byte, that is:
Figure BDA0000132117210000121
In the present embodiment; When the TS packet length is 188 bytes; Information such as the fixing expression of preceding 4 bytes synchronous head, PID; Then the maximum load of TS bag is 184 bytes, that is:
Figure BDA0000132117210000122
When the TS packet length is 204 bytes; Information such as the fixing expression of preceding 4 bytes synchronous head, PID; Back 16 bytes are fixed as forward error correction (FEC); Then the maximum load of TS bag still is 184 bytes, that is:
Figure BDA0000132117210000123
E VideoBe the video code rate that the present invention distributes for video encoder automatically.
In step S19, according to said video elementary code stream code check E VideoThe bit rate output of configuration video encoder.
Particularly, in video encoding and multiplex system, press B TSThe bit rate output of configure multiplexer, press E VideoThe configuration audio coder bit rate output, press E VideoThe bit rate output of configuration video encoder.
It should be noted that B PAT, B PMT, B PSI, B Audio, B FillCalculate and can be undertaken by random order Deng the code check before video code rate, random order is all within protection scope of the present invention.
It should be noted that; Optional program specific information not only comprises CAT Conditional Access Table and program description list; Also comprise the network information table (NIT) supported by standard GB/T 17975.1-2000, Event Information Table (EIT), time/date table (TDT), BAT bouquet association table (BAT), Running Status Table (RST), TOT Time Offset Table (TOT) etc., its code check computational methods all computational methods with optional program specific information are identical.
Specifically lift two instances below again above-mentioned steps is done further elaboration in detail.
Instance 1
With existing typical digital tv encoder mode is example; According to the specification requirement of General Bureau of Radio, Film and Television about " single-definition digital television encoder, decoder technique require and method of measurement "; Video coding adopts GB/T17975 principal mode main, audio coding to adopt GB/T to encode for 17191 layer 2; Program Association Table (PAT) recurrence interval is less than 500 milliseconds, and Program Map Table (PMT) recurrence interval is less than 500ms.Suppose that current encoder setting only carries out the coding of 1 programs, only comprise 1 road audio frequency, 1 road video in this program, TS packet length K is 188 bytes, and technical scheme then according to the present invention is following to the concrete steps that video code rate distributes automatically:
The first step: encoder configuration output transport stream (TS) total bitrate B TSBe 6000Kbps; MPTS comprises that 1 programs, Program Association Table transmission cycle are 200ms, Program Map Table transmission cycle is that 200ms, MPTS comprise CAT Conditional Access Table (CAT) and program description list (SDT) information; CAT Conditional Access Table (CAT) and program description list (SDT) transmission cycle are has only 1 road audio frequency in 2000ms, the MPTS; Adopt 17191 layer of 2 coded format of GB/T; Sample rate is 48KHz, and coding bit rate is that 256Kbps, video frame rate are 25fps.
Second step: because encoder configuration output TS is that 1 programs, PAT transmission cycle are 200ms, then each TS bag that only needs to send 1 expression PAT, therefore, Program Association Table code check B PATFor:
B PAT = N PAT × 1000 T PAT × K × 8 = 1 × 1000 200 × 188 × 8 = 7520 .
The 3rd step: because encoder configuration output TS is that 1 programs, PMT transmission cycle are 200ms, therefore, Program Map Table code check B PMTFor:
B PMT = Σ i = 1 M ( N PMT i × 1000 T PMT i × K × 8 ) = 1 × 1000 200 × 188 × 8 = 7520 .
The 4th step: because encoder configuration output TS comprises CAT and SDT information, the transmission cycle is 2000ms, therefore, therefore, the code check B of optional program specific information PSIFor:
B PSI = Σ i = 1 S ( N PSI i × 1000 T PSI i × K × 8 ) = ( 1 × 1000 2000 × 188 × 8 ) + ( 1 × 1000 2000 × 188 × 8 ) = 1504
The 5th step: owing to have only 1 road audio frequency among the encoder configuration output TS, adopt 17191 layer of 2 coded format of GB/T, sample rate is 48KHz, and coding bit rate is 256Kbps; According to GB/T 17191 coding standards, every frame audio frequency length is 1152 sampled points, and each frame ES length is fixed, and the maximum load of each TS bag is 184 bytes, and each frame audio frequency need be encoded to an integer TS bag and send.
According to the standard code of 17191 layer 2 of GB/T, 1 frame audio ES length L is:
L=144×256000/48000
Because the maximum load of each TS bag is 184 bytes, each frame audio frequency all need wrap expression by an integer TS, then:
Figure BDA0000132117210000142
Figure BDA0000132117210000143
Figure BDA0000132117210000144
B when comprising MCVF multichannel voice frequency among the TS AudioIt is each road audio frequency actual bit rate sum; When using other audio format, calculate B with similarity method by the respective standard regulation AudioHere also can find out B AudioWith E AudioDifferent.
The 6th step: because video frame rate is 25fps, therefore,
B fill = 25 2 × 188 × 8 = 18800 .
When video frame rate not simultaneously, B FillComputational methods identical.
The 7th step: obtain video code rate B VideoFor:
B video=B TS-B PAT-B PMT-B PSI-B audio-B fill
=6000000-7520-7520-1504-313333-18800
=5651323
The 8th step: obtain video elementary code stream code check E VideoFor:
E video = B video × 184 K = 5651323 × 184 188 = 5531082 = 5531 ( Kbps )
The 9th step is according to E VideoBit rate output for 5531Kbps configuration video encoder.
For this instance, prior art scheme video ES code check usually is set to 5000Kbps, compares with the prior art scheme; The present invention can distribute video ES code check accurately automatically; Make video bandwidth improve 532Kbps, simplified the setting up procedure of video code rate, avoid bandwidth waste; Improve channel utilization, improve video image quality.
Instance 2
Suppose that current encoder setting carries out the coding of 2 programs, comprise 1 road audio frequency, 1 road video in the 1st programs, comprise 2 road audio frequency, 1 road video in the 2nd programs, technical scheme then according to the present invention is following to the concrete steps that video code rate distributes automatically:
The first step: encoder configuration output transport stream (TS) total bitrate B TSBe 6000Kbps; MPTS comprises that 2 programs, Program Association Table (PAT) transmission cycle are Program Map Table (PMT) transmission cycle of 200ms, the 1st programs is that Program Map Table (PMT) transmission cycle of 200ms, the 2nd programs is that 400ms, MPTS comprise CAT Conditional Access Table (CAT) and program description list (SDT) information; CAT Conditional Access Table (CAT) and program description list (SDT) transmission cycle are 2000ms, the 1st programs has only 1 road audio frequency, the 2nd programs to contain 2 road audio frequency, all adopt the video frame rate of 17191 layer of 2 coded format of GB/T, every programs to be 25fps.
Second step: because encoder configuration output TS is that 2 programs, PAT transmission cycle are 200ms, then each TS bag that only needs to send 1 expression PAT, therefore, Program Association Table code check B PATFor:
B PAT = N PAT × 1000 T PAT × K × 8 = 1 × 1000 200 × 188 × 8 = 7520
The 3rd step: because encoder configuration output TS is 2 programs, the PMT transmission cycle of the 1st programs is 200ms, and the PMT transmission cycle of the 2nd programs is 400ms, therefore, and Program Map Table code check B PMTFor;
B PMT = Σ i = 1 M ( N PMT i × 1000 T PMT i × K × 8 ) = ( 1 × 1000 200 × 188 × 8 ) + ( 1 × 1000 400 × 188 × 8 ) = 11280
The 4th step: because encoder configuration output TS comprises CAT and SDT information, the transmission cycle is 2000ms; Therefore, the code check B of optional program specific information PSIFor:
B PSI = Σ i = 1 S ( N PSI i × 1000 T PSI i × K × 8 ) = ( 1 × 1000 2000 × 188 × 8 ) + ( 1 × 1000 2000 × 188 × 8 ) = 1504
The 5th step: encoder configuration output TS sound intermediate frequency all adopts 17191 layer of 2 coded format of GB/T, and sample rate is 48KHz.
The 1st programs has only 1 road audio frequency, and code check is 256Kbps, then:
Figure BDA0000132117210000164
The 2nd programs contains 2 road audio frequency, and code check is respectively 128Kbps and 256Kbps, then:
Figure BDA0000132117210000165
Figure BDA0000132117210000166
Figure BDA0000132117210000167
The total audio code check is:
B audio=313333+501333=814666
The 6th step: be 25fps because encoder disposes the video frame rate of 2 programs, therefore, video is filled code check B FillFor:
B fill = 2 × 25 2 × 188 × 8 = 37600
The 7th step: obtain video code rate B VideoFor:
B video=B TS-B PAT-B PMT-B PSI-B audio-B fill
=6000000-7520-11280-1504-814666-37600
=5127430
The 8th step: obtain video elementary code stream code check E VideoFor:
E video = B video × 184 K = 5127430 × 184 188 = 5018336 = 5018 ( Kbps )
The 9th step is according to E VideoBit rate output for 5018Kbps configuration video encoder.
For multiple programs or MCVF multichannel voice frequency situation, the video ES code check setting of prior art scheme is more uncertain, and the present invention still can distribute video ES code check accurately automatically.It should be noted that the present invention only on the whole for two-path video distributes code check, the concrete code check of two-path video can the whole code check of mean allocation, or mode such as employing statistic multiplexing, and this patent is not done specific requirement.
Fig. 3 illustrates the block diagram according to the system of the automatic distribution MPTS video elementary code stream code check of the embodiment of the invention.
As shown in Figure 3, this system comprises: dispensing unit is used for according to application demand configuration MPTS total bitrate B TS, the Program Association Table Program Map Table that sends cycle, program tricks, each programs sends the video frame rate of coding standard, audio sample rate, audio frequency elementary stream code check and each programs of audio frequency way, each road audio frequency that cycle, optional program specific information quantity, each optional program specific information send cycle, each programs; Program Association Table code check acquiring unit is used for obtaining Program Association Table code check B according to said program tricks, Program Association Table transmission cycle PATProgram Map Table code check acquiring unit is used for obtaining Program Map Table code check B according to the Program Map Table transmission cycle of said program tricks, each programs PMTOptional program specific information code check acquiring unit is used for the quantity according to optional program specific information, the transmission cycle of each optional program specific information and obtains the code check B of optional program specific information PSIThe audio code rate acquiring unit, the audio frequency way, audio sample rate, the coding standard of each road audio frequency, the audio frequency elementary stream code check that are used for according to said each programs obtain audio code rate B AudioVideo is filled the code check acquiring unit, is used for obtaining video filling code check B according to the video frame rate of said program tricks and each programs FillThe video code rate acquiring unit is used for according to said MPTS total bitrate B TS, Program Association Table code check B PAT, Program Map Table code check B PMT, optional program specific information code check B PSI, audio code rate B Audio, video fills code check B FillObtain video code rate B VideoVideo elementary code stream code check acquiring unit is used for obtaining video elementary code stream rate E according to said video code rate VideoVideo elementary code stream Data Rate Distribution unit is used for according to said video elementary code stream code check E VideoThe bit rate output of configuration video encoder.
Fig. 4 illustrates the coding method flow chart according to the automatic distribution MPTS video elementary code stream code check of the embodiment of the invention.As shown in Figure 4, distribute the video elementary code stream code check for encoder at first automatically; Encode according to said video elementary code stream code check then.
Fig. 5 illustrates the structured flowchart according to the encoder of the automatic distribution MPTS video elementary code stream code check of the embodiment of the invention.As shown in Figure 5, this encoder comprises video elementary code stream Data Rate Distribution unit, is used for distributing the video elementary code stream code check for encoder automatically; Coding unit is used for encoding according to said video elementary code stream code check.
The present invention acts on the transmitting terminal of DTV, need not other configuration at receiving terminal, can normally receive decoding.Automatic distribution video code rate method proposed by the invention can be distributed video code rate exactly according to channel width and multiplexing parameters; Guaranteeing under the whole system reference performance; Maximally utilise channel width; Reduce the empty bag rate of TS, improve video image quality, applicable various multiplexing, the audio frequency of the present invention, video encoding standard.
Should be appreciated that and abovely technical scheme of the present invention is specified by the preferred embodiments of the present invention.Those of ordinary skill in the art is reading on the basis of specification of the present invention and can make amendment to the technical scheme that embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these are revised or replacement, do not make the spirit and the scope of the essence disengaging various embodiments of the present invention technical scheme of relevant art scheme.Protection scope of the present invention is only limited the claims of enclosing.

Claims (13)

1. a method of distributing MPTS video elementary code stream code check automatically is characterized in that this method comprises: according to application demand configuration MPTS total bitrate B TS, the Program Association Table Program Map Table that sends cycle, program tricks, each programs sends the video frame rate of coding standard, audio sample rate, audio frequency elementary stream code check and each programs of audio frequency way, each road audio frequency that cycle, optional program specific information quantity, each optional program specific information send cycle, each programs;
Obtain Program Association Table code check B according to said program tricks, Program Association Table transmission cycle PAT
The Program Map Table transmission cycle according to said program tricks, each programs obtains Program Map Table code check B PMT
Obtain the code check B of optional program specific information according to the quantity of optional program specific information, the transmission cycle of each optional program specific information PSI
Audio frequency way, the coding standard of each road audio frequency, audio sample rate, audio frequency elementary stream code check according to said each programs obtain audio code rate B Audio
Video frame rate according to said program tricks, each programs obtains video filling code check B Fill
According to said MPTS total bitrate B TS, Program Association Table code check B PAT, Program Map Table code check B PMT, optional program specific information code check B PSI, audio code rate B Audio, video fills code check B FillObtain video code rate B Video
Obtain video elementary code stream code check E according to said video code rate Video
According to said video elementary code stream code check E VideoThe bit rate output of configuration video encoder.
2. method according to claim 1; It is characterized in that said optional program specific information is one or more program specific informations empty or that supported by GB/T 17975.1-2000 " the universal coding part 1 of information technology moving image and sound information thereof: system ".
3. method according to claim 1 is characterized in that, said Program Association Table code check B PATCalculating
Formula is:
B PAT = N PAT × 1000 T PAT × K × 8
Wherein,
N PATExpression is used to represent the TS bag number of Program Association Table;
T PATIn the TS bag transmission cycle of expression Program Association Table, unit is a millisecond;
K representes the byte number of each TS bag.
4. method according to claim 3 is characterized in that, when the program tricks less than 42 the time, N PAT=1.
5. method according to claim 1 is characterized in that, said Program Map Table code check B PMTComputing formula be:
B PMT = Σ i = 1 M ( N PMT i × 1000 T PMT i × K × 8 )
Wherein,
M representes the program tricks;
Figure FDA0000132117200000023
expression is used to represent the TS bag number of the Program Map Table of each programs;
representes the TS bag transmission cycle of the Program Map Table of each programs, and unit is a millisecond;
K representes the byte number of each TS bag.
6. method according to claim 1 is characterized in that, the code check B of said optional program specific information PSIComputing formula be:
B PSI = Σ i = 1 S ( N PSI i × 1000 T PSI i × K × 8 )
Wherein,
S representes the quantity of optional program specific information;
Figure FDA0000132117200000026
expression is used to represent the TS bag number of each optional program specific information;
representes the transmission cycle of the TS bag of each optional program specific information, and unit is a millisecond;
K representes the byte number of each TS bag.
7. method according to claim 1 is characterized in that, said audio code rate B AudioBe the audio code rate sum of each programs, the audio code rate B of each programs AudioComputing formula be:
Figure FDA0000132117200000032
wherein
A representes the audio frequency way of each programs;
L iThe length of representing the every frame audio frequency elementary stream of each road audio frequency under the basic stream bit rate of selected audio;
H iThe audio sample rate of representing each road audio frequency;
C iRepresent the PCM sampled point number of each road audio frequency at the substandard every frame audio frequency of selected audio;
K representes the byte number of each TS bag.
8. method according to claim 1 is characterized in that, said video is filled code check B FillComputing formula be:
B fill = Σ i = 1 M ( F i 2 × K × 8 )
Wherein,
M representes the program tricks;
F iThe video frame rate of representing each programs;
K representes the byte number of each TS bag.
9. method according to claim 1 is characterized in that, said video code rate B VideoComputing formula be: B Video=B TS-B PAT-B PMT-B PSI-B Audio-B Fill
10. method according to claim 1 is characterized in that, said video elementary code stream code check E VideoComputing formula be:
E video = B video × 184 K
Wherein,
The maximum load byte number of each TS bag of 184 expressions;
K representes the byte number of each TS bag.
11. a system that distributes MPTS video elementary code stream code check automatically is characterized in that this system comprises: dispensing unit is used for according to application demand configuration MPTS total bitrate B TS, the Program Association Table Program Map Table that sends cycle, program tricks, each programs sends the video frame rate of coding standard, audio sample rate, audio frequency elementary stream code check and each programs of audio frequency way, each road audio frequency that cycle, optional program specific information quantity, each optional program specific information send cycle, each programs;
Program Association Table code check acquiring unit is used for obtaining Program Association Table code check B according to said program tricks, Program Association Table transmission cycle PAT
Program Map Table code check acquiring unit is used for obtaining Program Map Table code check B according to the Program Map Table transmission cycle of said program tricks, each programs PMT
Optional program specific information code check acquiring unit is used for the quantity according to optional program specific information, the transmission cycle of each optional program specific information and obtains the code check B of optional program specific information PSI
The audio code rate acquiring unit, the audio frequency way, the coding standard of each road audio frequency, audio sample rate, the audio frequency elementary stream code check that are used for according to said each programs obtain audio code rate B Audio
Video is filled the code check acquiring unit, is used for obtaining video filling code check B according to the video frame rate of said program tricks, each programs Fill
The video code rate acquiring unit is used for according to said MPTS total bitrate B TS, Program Association Table code check B PAT, Program Map Table code check B PMT, optional program specific information code check B PSI, audio code rate B Audio, video fills code check B FillObtain video code rate B Video
Video elementary code stream code check acquiring unit is used for obtaining video elementary code stream code check E according to said video code rate Video
Video elementary code stream Data Rate Distribution unit is used for according to said video elementary code stream code check E VideoThe bit rate output of configuration video encoder.
12. a coding method that automatically distributes MPTS video elementary code stream code check is characterized in that, this method comprises,
Automatically distribute the video elementary code stream code check for encoder;
Encode according to said video elementary code stream code check.
13. an encoder that automatically distributes MPTS video elementary code stream code check is characterized in that, this encoder comprises,
Video elementary code stream Data Rate Distribution unit is used for distributing the video elementary code stream code check for encoder automatically;
Coding unit is used for encoding according to said video elementary code stream code check.
CN201210016883.6A 2012-01-18 2012-01-18 Method and system for automatically distributing code rate of basic video code stream of transmission stream Expired - Fee Related CN102572521B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210016883.6A CN102572521B (en) 2012-01-18 2012-01-18 Method and system for automatically distributing code rate of basic video code stream of transmission stream

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210016883.6A CN102572521B (en) 2012-01-18 2012-01-18 Method and system for automatically distributing code rate of basic video code stream of transmission stream

Publications (2)

Publication Number Publication Date
CN102572521A true CN102572521A (en) 2012-07-11
CN102572521B CN102572521B (en) 2014-04-02

Family

ID=46416795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210016883.6A Expired - Fee Related CN102572521B (en) 2012-01-18 2012-01-18 Method and system for automatically distributing code rate of basic video code stream of transmission stream

Country Status (1)

Country Link
CN (1) CN102572521B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103686185A (en) * 2013-11-28 2014-03-26 成都时代星光科技有限公司 Method for increasing transmission capacity of valid data of wireless image transmission COFDM (coded orthogonal frequency division multiplexing) modulation module
CN111131858A (en) * 2019-12-30 2020-05-08 杭州当虹科技股份有限公司 Method for fixing code rate based on TS video PID
CN113141520A (en) * 2020-01-17 2021-07-20 北京达佳互联信息技术有限公司 Video stream transmission method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050036698A1 (en) * 2003-08-12 2005-02-17 Samsung Electronics Co., Ltd. Method of controlling encoding rate, method of transmitting video data, encoding rate controller for video encoder, and video data transmission system using the encoding rate controller
CN1722835A (en) * 2004-06-14 2006-01-18 美国博通公司 Bit rate automatic gear
CN101242532A (en) * 2007-12-12 2008-08-13 浙江万里学院 A code rate control method oriented to multi-view point video
CN101287129A (en) * 2008-05-20 2008-10-15 上海交通大学 Code rate distributing method of channel code in source and channel combined coding

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050036698A1 (en) * 2003-08-12 2005-02-17 Samsung Electronics Co., Ltd. Method of controlling encoding rate, method of transmitting video data, encoding rate controller for video encoder, and video data transmission system using the encoding rate controller
CN1722835A (en) * 2004-06-14 2006-01-18 美国博通公司 Bit rate automatic gear
CN101242532A (en) * 2007-12-12 2008-08-13 浙江万里学院 A code rate control method oriented to multi-view point video
CN101287129A (en) * 2008-05-20 2008-10-15 上海交通大学 Code rate distributing method of channel code in source and channel combined coding

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103686185A (en) * 2013-11-28 2014-03-26 成都时代星光科技有限公司 Method for increasing transmission capacity of valid data of wireless image transmission COFDM (coded orthogonal frequency division multiplexing) modulation module
CN111131858A (en) * 2019-12-30 2020-05-08 杭州当虹科技股份有限公司 Method for fixing code rate based on TS video PID
CN111131858B (en) * 2019-12-30 2022-03-08 杭州当虹科技股份有限公司 Method for fixing code rate based on TS video PID
CN113141520A (en) * 2020-01-17 2021-07-20 北京达佳互联信息技术有限公司 Video stream transmission method and device, electronic equipment and storage medium
CN113141520B (en) * 2020-01-17 2022-04-01 北京达佳互联信息技术有限公司 Video stream transmission method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN102572521B (en) 2014-04-02

Similar Documents

Publication Publication Date Title
US10848796B2 (en) Transmitting method, receiving method, transmitting device, and receiving device
US10945021B2 (en) Receiving method, receiving device, and transmission and reception system
US10349091B2 (en) Transmitting method, receiving method, transmitting device, and receiving device
US10827208B2 (en) Transmitting method, receiving method, transmitting device and receiving device
US20200236410A1 (en) Transmitting device, receiving device, transmitting method and receiving method
US8510783B2 (en) Video on demand transmission/reception method and system using divided transport stream
KR20050117314A (en) Apparauts and method for transmitting and receiving with reducing the setup time of data packet
US10327000B2 (en) Transmitting method for transmitting a plurality of packets including header information including divided data information and a value of an invalidated fragment counter
CN101729908B (en) Synchronous multiplexing method for video and audio of transmission stream
CN102301702A (en) Transmitting/receiving System And Method Of Processing Data In The Transmitting/receiving System
CN101951506A (en) System and method for realizing synchronous transmitting and receiving of scalable video coding service
US11758201B2 (en) Transmitting method, receiving method, transmitting device, and receiving device
US20220109897A1 (en) Transmitting method, receiving method, transmitting device and receiving device
CN108122558B (en) Real-time capacity conversion implementation method and device for LATM AAC audio stream
CN102572521B (en) Method and system for automatically distributing code rate of basic video code stream of transmission stream
CN100499821C (en) Method for statistics of multiplex transmission stream
US20170134774A1 (en) Transmitting method, receiving method, transmitting device and receiving device
CN102104795A (en) Method for multiplexing program stream (PS) paths into transport stream (TS) path based on moving picture experts group (MPEG)-2
JP2002535934A (en) Method and apparatus for delivering reference signal information at specified time intervals
CN104022844B (en) Data packaging method capable of matching multiple transmission modes and system
CN101959062B (en) Data transmission method, system and device for mobile multimedia broadcasting system
CN113747209B (en) Method and device for reorganizing multi-channel TS (transport stream) programs
CN102480634B (en) The method, apparatus and system that in Mobile Multimedia Broadcasting, classified service is synchronous
CN111131858B (en) Method for fixing code rate based on TS video PID
CN111770364B (en) Video code rate smoothing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140402