CN100461747C - Method for adjusting code rate of code stream in multimedia - Google Patents

Method for adjusting code rate of code stream in multimedia Download PDF

Info

Publication number
CN100461747C
CN100461747C CNB2004100071554A CN200410007155A CN100461747C CN 100461747 C CN100461747 C CN 100461747C CN B2004100071554 A CNB2004100071554 A CN B2004100071554A CN 200410007155 A CN200410007155 A CN 200410007155A CN 100461747 C CN100461747 C CN 100461747C
Authority
CN
China
Prior art keywords
packet
buffer memory
bag
gate array
code
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.)
Expired - Fee Related
Application number
CNB2004100071554A
Other languages
Chinese (zh)
Other versions
CN1661985A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2004100071554A priority Critical patent/CN100461747C/en
Publication of CN1661985A publication Critical patent/CN1661985A/en
Application granted granted Critical
Publication of CN100461747C publication Critical patent/CN100461747C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The method of adjusting code rate includes steps: detecting packet id of data packets in transmission data stream; based on the said packet id, determining whether the corresponding data packet is a vacant packet; if not, the data packet is written into storage device; otherwise, the vacant packet is forbidden to write into storage device; when clock of output code rate is effective, determining whether there is a complete data packet in the said storage device; if yes, a data packet is read out and output; otherwise, a vacant packet is output.

Description

A kind of code check method of adjustment of multimedia code stream
Technical field
The present invention relates to digital video technology, particularly a kind of code check method of adjustment of multimedia code stream.
Background technology
Motion picture expert group (Motion Picture Experts Group:MPEG-2) is the international standard that Digital Television adopts, this standard code the compress mode of analog video, audio signal, and defined and be used for the multiplexing data structure of video compression data, audio compression data, control data and private data, comprising: program stream PS (Programme Stream) and transport stream TS (Transport Stream).Wherein transport stream is the long data structure of a kind of fixed packet, is mainly used in the transmission of compressed bit stream.Be generally 188 bytes or 204 bytes, wherein the 1st byte is that the bag sync byte is 0x47H; Low 13 of ensuing the 2nd, 3 bytes is bag sign PID (Packet Identifier), and in order to identify the information category that carries in this packet, such as video data, voice data etc., its basic pack arrangement as shown in Figure 1.
Prior art is made a start at MPEG-2 and is sent the transport stream of cbr (constant bit rate), because the difference of transmission medium or the requirement difference to code check of receiving terminal, thereby the transport stream bad adaptability of cbr (constant bit rate).If the program code check is lower in the transmission code stream, then waste transmission bandwidth, if the transmission code stream code check is too high, surpass the receiving terminal ability to bear, then cause packet loss, can't wait mistake synchronously.
Summary of the invention
The object of the present invention is to provide a kind of code check method of adjustment of multimedia code stream, to solve the problem of the transport stream bad adaptability of cbr (constant bit rate) in the prior art.
For addressing the above problem, the invention provides following proposal:
A kind of code check method of adjustment of multimedia code stream comprises the steps:
Adopt the bag sign of packet in field programmable gate array or other programmable logic chip detected transmission code streams;
After this packet carried out buffer memory by second buffer memory in described field programmable gate array or other programmable logic chips, judge according to described bag sign whether corresponding packet is empty bag, if not the sky bag, then this packet is write the first outer buffer memory of described field programmable gate array or other programmable logic chips, otherwise forbid this sky bag is write described first buffer memory;
When the bit rate output clock is effective, judge the packet that whether has a whole bag in described first buffer memory, if then synchronously read a packet and output from described first buffer memory, otherwise the empty bag storage area of the inside from described field programmable gate array or other programmable logic chips is synchronously exported an empty bag.
When the described first cache writing data bag, be that unit writes, promptly from first byte of this packet with the bag.
Described first buffer memory adopts fifo queue.
The described first buffer memory degree of depth is at least the byte number of two packets.
Whether judge effectively according to the half-full interrupt signal of described first buffer memory whether described first buffer memory has the packet of a whole bag.
It is the hardware configuration processing transmission code stream of core that the present invention adopts with FPGA, have fixing and the fast characteristics of processing speed of postponing in processing such as data write, bag sign PID detection, interrupt responses, treatment effeciency and reliability have been improved, effectively solve the variety of issue that code check does not match and causes, utilized transmission bandwidth fully.
Description of drawings
Fig. 1 is a mpeg 2 transport stream pack arrangement schematic diagram;
Fig. 2 adjusts theory diagram for code check of the present invention;
Fig. 3 is a flow chart of the present invention;
Fig. 4 adjusts functional block diagram for code check.
Embodiment
The present invention adjusts the transmission code stream code check of output by sky bag (promptly bag sign PID is the packet of the 0x1ffH) number of adjusting in the transport stream.The prerequisite of adjusting is that bit rate output must be greater than the effective code check in the input bit rate, and promptly the effective code stream behind the sky bag in removing input code flow must be less than the bit rate output of setting.
Consult shown in Figure 2ly, the present invention adopts First Input First Output (FIFO) to realize the buffer memory of transport stream, i.e. first buffer memory among the figure, and determine to add empty opportunity of wrapping by the state of FIFO, the degree of depth of first buffer memory is at least 2 data packet byte length.PID detects, FIFO control etc. can adopt on-site programmable gate array FPGA (Field Programable Gate Array) or other programmable logic chip to finish, and adopts FPGA in the present embodiment.
Consult Fig. 3 and Fig. 4, specific implementation step of the present invention is as follows:
Step 10: input MPEG-2 transmission code stream.
Step 20: the bag that is detected packet in the input code flow by FPGA identifies PID, is 0x1ffH if wrap sign PID, and then the specified data bag is empty bag, forbids that the write signal of FIFO wraps to abandon sky, otherwise carry out step 30.
Forbid that write signal is in order there not to be the empty bag of transport stream in the data that guarantee to write FIFO.
Because bag sign PID field is the 2nd, 3 bytes in transport stream data packet, for first buffer memory that writes that guarantees that packet can be complete after detection PID field is finished, at inner second buffer memory of realizing minimum 3 bytes of FPGA.
Step 30: write the data packet first buffer memory.
For guarantee with the bag be unit from first buffer memory (FIFO) sense data bag, be that to restart in initial condition or after resetting all must be that sync byte begins to write first buffer memory from first byte of transport stream data packet.
Step 40: when the bit rate output clock is effective, check the state of FIFO, promptly check the packet among the FIFO.
In the present embodiment, whether effectively check by the half-full interrupt signal of judging FIFO and the state of FIFO also can adopt other modes.
Step 50: judge whether half-full interrupt signal is effective, if effectively then represent that FIFO inside has had above half data (promptly having a packet at least) of the FIFO degree of depth, carry out step 60, otherwise it is half-full to show among the FIFO that data also do not arrive, and then carry out step 70.
Step 60: read a packet synchronously from FIFO.
Step 70: from being preset in the synchronous empty bag of output of the inner empty bag storage area of FPGA.
Step 80: output code flow.
The bit rate output clock needs to preestablish according to different situations and demand.
The inventive method is when concrete the application, export the empty bag of interpolation again owing to remove empty bag in input, the packet spacing of the input code flow that can change like this, influence a fundamental clock characteristic (ProgramClock Reference of transport stream, PCR), therefore need adjust PCR, guarantee the correctness of PCR information.

Claims (5)

1. the code check method of adjustment of a multimedia code stream is characterized in that, comprises step:
Adopt the bag sign of packet in field programmable gate array or other programmable logic chip detected transmission code streams;
After packet carried out buffer memory by second buffer memory in described field programmable gate array or other programmable logic chips, judge according to described bag sign whether corresponding packet is empty bag, if not the sky bag, then this packet is write the first outer buffer memory of described field programmable gate array or other programmable logic chips, otherwise forbid this sky bag is write described first buffer memory;
When the bit rate output clock is effective, judge the packet that whether has a whole bag in described first buffer memory, if then synchronously read a packet and output from described first buffer memory, otherwise the empty bag storage area of the inside from described field programmable gate array or other programmable logic chips is synchronously exported an empty bag.
2. the method for claim 1 is characterized in that, is that unit writes with the bag when the described first cache writing data bag, promptly from first byte of this packet.
3. the method for claim 1 is characterized in that, described first buffer memory adopts fifo queue.
4. method as claimed in claim 3 is characterized in that, the described first buffer memory degree of depth is at least the byte number of two packets.
5. method as claimed in claim 4 is characterized in that, whether judges effectively according to the half-full interrupt signal of described first buffer memory whether described first buffer memory has the packet of a whole bag.
CNB2004100071554A 2004-02-25 2004-02-25 Method for adjusting code rate of code stream in multimedia Expired - Fee Related CN100461747C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100071554A CN100461747C (en) 2004-02-25 2004-02-25 Method for adjusting code rate of code stream in multimedia

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100071554A CN100461747C (en) 2004-02-25 2004-02-25 Method for adjusting code rate of code stream in multimedia

Publications (2)

Publication Number Publication Date
CN1661985A CN1661985A (en) 2005-08-31
CN100461747C true CN100461747C (en) 2009-02-11

Family

ID=35011061

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100071554A Expired - Fee Related CN100461747C (en) 2004-02-25 2004-02-25 Method for adjusting code rate of code stream in multimedia

Country Status (1)

Country Link
CN (1) CN100461747C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010064407A1 (en) * 2008-12-02 2010-06-10 パナソニック株式会社 Encoding ratio setting method and radio communication device
CN101951518B (en) * 2010-10-12 2012-05-16 高斯贝尔数码科技股份有限公司 System and method for correcting digital television image under low bit rate
CN103001816B (en) * 2011-09-14 2016-08-10 华为技术有限公司 Data communications method and equipment
CN106231359B (en) * 2016-07-21 2019-04-02 四川九州电子科技股份有限公司 Mpeg TS code stream sending method based on multi-data source dynamic multiplexing algorithm

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1138801A (en) * 1995-04-10 1996-12-25 计数设备公司 Method and apparatus for conditioning and transporting timed program data, independent of transport timing
CN1335711A (en) * 2000-06-14 2002-02-13 三菱电机株式会社 Program recording reproducing method and apparatus
CN1437407A (en) * 2002-02-07 2003-08-20 华为技术有限公司 Adaptation method of digital video compressed code flow in three-level quasi-synchronous serial transmission
CN1449192A (en) * 2002-04-02 2003-10-15 深圳市中兴通讯股份有限公司 Method and device for regulating program reference clock of motion image expert group 2
CN1455597A (en) * 2002-04-29 2003-11-12 深圳市中兴通讯股份有限公司 Motion image expert group-2 transimitting flow transmitting method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1138801A (en) * 1995-04-10 1996-12-25 计数设备公司 Method and apparatus for conditioning and transporting timed program data, independent of transport timing
CN1335711A (en) * 2000-06-14 2002-02-13 三菱电机株式会社 Program recording reproducing method and apparatus
CN1437407A (en) * 2002-02-07 2003-08-20 华为技术有限公司 Adaptation method of digital video compressed code flow in three-level quasi-synchronous serial transmission
CN1449192A (en) * 2002-04-02 2003-10-15 深圳市中兴通讯股份有限公司 Method and device for regulating program reference clock of motion image expert group 2
CN1455597A (en) * 2002-04-29 2003-11-12 深圳市中兴通讯股份有限公司 Motion image expert group-2 transimitting flow transmitting method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于EPLD实现MPEG-2中传输流的码率调整. 谷瑜青,茹国宝,甘海慧.系统工程与电子技术,第25卷第3期. 2003
基于EPLD实现MPEG-2中传输流的码率调整. 谷瑜青,茹国宝,甘海慧.系统工程与电子技术,第25卷第3期. 2003 *

Also Published As

Publication number Publication date
CN1661985A (en) 2005-08-31

Similar Documents

Publication Publication Date Title
JP4689872B2 (en) Digital video stream decoding method and apparatus by pseudo header insertion in digital video system
CN1162007C (en) Programmable filter for removing filling bits from MPEG-2 bit stream
CN101674486B (en) Streaming media audio and video synchronization method and system
JP3633884B2 (en) Playback image transmission device
US6831931B2 (en) System and method for remultiplexing of a filtered transport stream
JP3052824B2 (en) Audio playback time adjustment circuit
US7940799B2 (en) Code conversion method and device thereof
CN103686312A (en) DVR multipath audio and video recording method
EP0933949A1 (en) Transmitting system, transmitting apparatus, recording and reproducing apparatus
US7240013B2 (en) Method and apparatus for controlling buffering of audio stream
US20020136205A1 (en) Packet data processing apparatus and packet data processing method
CN100461747C (en) Method for adjusting code rate of code stream in multimedia
US6687305B1 (en) Receiver, CPU and decoder for digital broadcast
US8014452B2 (en) Format conversion circuit
AU719855B2 (en) Decoding system for motion picture data
CN100388776C (en) Digital video storage system and related method of storing digital video data
EP2557786B1 (en) Delay controlled decoding apparatus and method
CN101720033B (en) Video transmission equipment as well as USB transmission device and method thereof
EP1773043A1 (en) Method and system for storing data packets
CN1110160C (en) Data processing device including buffer memory
JP3642550B2 (en) Video signal transmission method and apparatus
KR100991122B1 (en) Method and device for transferring data packets
JP3369463B2 (en) Digital signal transmission equipment
KR100662651B1 (en) Method and device for writing data to a recording medium in a digital video system
CN113784188A (en) TS (transport stream) hardware analysis method and system

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090211

Termination date: 20130225