Está en la página 1de 68

I HC QUC GIA H NI TRNG I HC CNG NGH

Trn Vn Hoan

PHN TCH DNG TRUYN TI MPEG (MPEG TRANSPORT STREAM)

KHO LUN TT NGHIP I HC H CHNH QUY Ngnh: Cng ngh in t vin thng

Cn b hng dn: TS Ng Thi Tr

H NI - 2008

Trn Vn Hoan K49

Kha lun tt nghip

Tm tt ni dung
Lun vn c trnh by trong 3 chng : Chng 1: Gii thiu tng qut nht v chun nn MPEG, l do cn phi nn d liu, cc nguyn tc c bn c s dng trong chun nn MPEG p dng cho d liu hnh nh cng nh m thanh, gii thiu nhng c im chung nht ca cc chun nn MPEG1, 2, 4 v 7, chng ny cng ch ra cch hnh thnh dng bit MPEG. Chng 2: M t cch thc hnh thnh, cu trc ca dng c s ES, l do cn thit phi chia dng c s thnh cc gi, cch thc to ra cc gi c s ng gi PES ng thi phn tch cu to ca mt gi PES. Chng 3: Phn tch cch to thnh dng truyn ti MPEG, hot ng ca dng truyn ti, phn tch chi tit cu to v nhim v ca tng trng trong gi truyn ti, cui cng l ch ra nhng c im u vit ca dng truyn ti MPEG lm cho chun nn ny c nhng ng dng rng ri trong thc t.

-i-

Trn Vn Hoan K49

Kha lun tt nghip

Mc lc
Trang ph ba..................................................................................................................... Tm tt ni dung...............................................................................................................i Mc lc............................................................................................................................ii Bng cc k hiu vit tt..................................................................................................iv M u.............................................................................................................................1 Chng 1 : Tng quan v MPEG.....................................................................................2 1.1. Gii thiu ................................................................................................................2 1.2. ng dng ca nn d liu:.......................................................................................4 1.3. M ha khng tn hao v m ha d on c......................................................5 1.4. Nguyn l c bn ca nn.........................................................................................7 1.5. Nn video.................................................................................................................9 1.5.1. Nn trong nh.....................................................................................................11 1.5.2. Nn lin nh.......................................................................................................11 1.5.3. Gii thiu v php b chuyn ng....................................................................12 1.6. Gii thiu v MPEG-1...........................................................................................13 1.7. MPEG-2 cng vi cc Profile v Level.................................................................14 1.8. Gii thiu v MPEG -4..........................................................................................16 1.9. Gii thiu v MPEG-7........................................................................................18 1.10. Nn m thanh......................................................................................................18 1.11. Dng bit MPEG..................................................................................................20 Chng 2: Dng c s (elementary stream) v dng c s ng gi (packetized elementary stream).........................................................................................................22 2.1. Dng c s (elementary stream)............................................................................22 2.2. Dng c s ng gi (packetized elementary stream)...........................................24 2.2.1....................................................................Gii thiu chung v dng c s ng gi 24 2.2.2........................................................................................C php dng c s ng gi 27

- ii -

Trn Vn Hoan K49

Kha lun tt nghip

2.2.3...............................................................................................................Cu trc chi tit

32 Chng 3: Dng truyn ti.............................................................................................38 3.1. Gii thiu chung v dng truyn ti:......................................................................38 3.2. Chun ng h (clock references)..........................................................................39 3.3. Gii m dng truyn ti.........................................................................................41 3.4. Phn tch c php dng truyn ti..........................................................................43 3.5. c im dng truyn ti MPEG...........................................................................60 3.6. Tnh linh hot ca dng truyn ti:........................................................................61 Kt lun..........................................................................................................................62 Ti liu tham kho.........................................................................................................63

- iii -

Trn Vn Hoan K49

Kha lun tt nghip

Bng cc k hiu vit tt ABU Asia-Pacific Broadcasting Union ANSI American National Standard Institute ATSC Advance Television System Committee CAT Conditional Access Table CRC Cyclical Redundancy Checking DCT Discrete Cosine Transform DTS Decoding Time Stamp DVB Digital Video Broadcasting EBU European Broadcasting Union ES Elementary Stream GOP Group of Picture HDTV High-definition Television IEC International Electrotechnical Commission ISO International Organization for Standardization ITU International Telecommunication Union MPEG Moving Pictures Experts Group NIT Network Information Table PAT Program Association Table PCR Program Clock Reference PES Packetized Elementary Stream PID Packet Identification PMT Program Map Table PSI Program Specific Information PTS Presentation Time Stamp RLC Run Length Coding SCR System Clock Reference SDTV Standard Definition Television TS Transport Stream

- iv -

Trn Vn Hoan K49

Kha lun tt nghip

M u
Cng ngh s t khi ra i ngy cng th hin tnh u vit v thay th dn cng ngh tng t vn khng hiu qu v li thi. Ngy nay vic s ha c thc hin trn mi dng thc ca d liu, t vn bn ti hnh nh v m thanh. Cc mch in t tch hp c nghin cu ch to ngy cng nhiu c hiu nng tnh ton ngy cng cao, tin cy ngy cng chnh xc lm cho cng ngh s ngy cng pht trin. Trong xu hng s ha mi dng d liu nh trn th vic s ha tn hiu video l mt s tt yu. Tuy nhin tn hiu video c s ha c dung lng qu ln dn n vic lu tr v truyn dn hu nh khng th thc hin c. Do ny sinh nhu cu nn tn hiu video. Nhiu chun nn c ra i l kt tinh cng sc ca cc chuyn gia, cc nh khoa hc hng u trn th gii. Trong s cc chun nn th chun MPEG l chun nn ph bin nht, c ng dng rng ri nht. Chun nn ny c nghin cu, pht trin trong nhiu nm v gii quyt tt bi ton nn tn hiu video, kt qu l c th p ng mt cch rt a dng cc yu cu trong thc t. Mt thnh phn quan trng bc nht trong chun nn MPEG l dng truyn ti MPEG (MPEG Transport Stream). Nh c dng truyn ti m d liu c th c a t ni pht ti ni thu mt cch d dng, chnh xc v an ton. Hn na dng truyn ti cn rt mm do v linh hot, va h tr tt cho cc ng dng hin ti va m bo d dng cho s pht trin trong tng lai. Nhm mc ch tm hiu mt cch su sc v cu to v hot ng ca dng truyn ti MPEG, em chn ti ny vi mong mun c c s hiu bit v mt chun nn c ng dng rng ri nht trong thc t. Em xin chn thnh cm n thy Ng Thi Tr, ngi tn tnh ch bo v gip em trong qu trnh lm lun vn, thy ch cho em phng php nghin cu v cch trnh by lun vn mt cch khoa hc. Em cng xin cm n cc thy c trong Khoa in t vin thng ch bo cho em trong sut qu trnh hc tp. Em xin cm n gia nh v bn b gip em c th hon thnh lun vn ny.

H Ni, 5/2008

- 1-

Chng 1: Gii thiu tng quan v MPEG

Chng 1: Gii thiu tng quan v MPEG


1.1. Gii thiu: MPEG l vit tt ca cm t Moving Pictures Experts Group c thnh lp bi t chc ISO (International Standards Organization) nhm thit lp chun cho vic nn v truyn ti c d liu hnh nh v d liu m thanh.

Ngun d liu (a)

B nn

Knh truyn

B gii nn

D liu gii nn

D liu vo (b)

B m ha phc tp

Dng bit chun

B gii m n gin

Hnh 1.1: (a) tng quan ca mt h thng c nn, bn pha ngun s dng b nn gi l compressor hay coder, bn pha nhn s dng b gii nn l expander hay decoder, (b) minh ha s bt i xng trong h thng, b m ha lun phi phc tp hn b gii m.

Vic nn d liu l tt yu cn thit do hai l do chnh sau y. Th nht l do lu tr: d liu sau khi nn c dung lng nh hn, do vy cn t khng gian lu tr hn. Th hai l do bng thng: d liu sau khi nn c tc bit thp hn nn cn bng thng t hn. T l gia tc bit ca ngun so vi tc bit ca knh truyn gi l t l nn Compression factor hay l Coding gain. H thng truyn ti l bt i xng. B m ha cn phi thng minh thch ng linh hot vi phn d liu cn m ha, cn b gii m ch cn lm n gin c th hiu c thng tin ca knh truyn mang ti. iu ny thch hp cho hot ng qung b khi

- 2-

Chng 1: Gii thiu tng quan v MPEG

m s lng thit b m ha t cn s lng b gii m l rt nhiu. Vi nhng ng dng kiu im-im th hng thit k nh vy khng th hin c tnh u vit.

Tn hiu Video

B m ha B m ha khng c nh ngha bi MPEG tr vic phi to ra dng bit chun

Dng bit

Tn hiu Video B gii m

MPEG nh ngha phn ny

B gii m phi c kh nng hiu c tt c mi dng bit chun

Khng nh ngha (a) B m ha hin ti Dng bit chun B gii m hin ti B gii m hin ti vn c kh nng lm vic

B m ha trong tng lai (b) B m ha c cu trc b mt

Dng bit chun Dng bit chun

B gii m c th lm vic c

(c)

Hnh 1.2: (a) MPEG nh ngha giao thc gia b m ha v b gii m. (b) Hng thit k ca MPEG l cho php to ra b m ha tt hn trong tng lai nhng vn m bo tng thch vi b gii m hin c. (c) Chi tit thit k ca b m ha khng nht thit phi cng khai, c th l b mt thng mi ca nh sn xut.

Hng tip cn ca MPEG l ht sc ng n bi v chun nn ny khng chun ha b m ha hay gii m m l chun ha dng bt. Dng bt m bo cho s pht trin ca b m ha trong tng lai c th cho cht lng tt hn nhng nhng b gii m hin

- 3-

Chng 1: Gii thiu tng quan v MPEG

nay vn c th lm vic c, thm ch c th gii m ngay c khi b m ha l mt b mt thng mi. MPEG hu nh khng cp g v cu trc v hot ng ca b gii m, m ch a ra cu trc ca dng bt v mi b gii m u c kh nng gii m dng bit chun ny, mc d mt s thit k s cho ra cht lng tt hn thit k khc. Cu trc ca b gii m khng cn phi th hin ra dng bt v do vy nh sn xut c th s dng nhng thut ton khc nhau, chi tit trong cng ngh ca h khng cn phi cng khai cho tt c cng bit. iu ny to nn s cnh tranh gia cc nh sn xut nhm to ra thit b ti u nht. V ngi s dng c th c nhiu la chn hn. MPEG khng nhng l mt chun nn, m cn nh ngha cch thc v c php c th kt hp hoc trn ln audio v video to nn mt chng trnh truyn hnh s tng ng. Nhiu chng trnh c th kt hp vi nhau to ra mt dng kt hp. MPEG nh ngha cch to v vn chuyn dng kt hp ny. nh ngha ny cng nu ra nhng yu cu phn cng m b gii m cn phi tha mn c th gii m chnh xc v ngi s dng cn g c th tm thy chng trnh ca mnh. Vn ng b y l vn phc tp bi dng kt hp c to ra bi nhiu chng trnh khng nht thit phi ng b vi nhau.
1.2. ng dng ca nn d liu:

ng dng ca nn d liu l v cng rng ln v do vy t chc ISO c gng to ra mt chun nn c th p ng nhu cu rng ln trong cc ng dng cn nn. Chun nn MPEG bao hm tt c t nhng chun cho mn hnh nh c mn hnh ca my in thoi cho ti nhng ng dng phn gii cao phc v cho vic chiu phim trong rp, t nhng ng dng m thanh mono n m thanh a knh v m thanh vng. Trong truyn thng, gi phi tr cho mt ng truyn thng t l vi tc d liu, v do p lc ti chnh m ngi ta lun mun s dng h s nn cao. Song lun lun phi nh trong u rng bn thn vic lm tng c h s nn cng lun c ci gi phi tr v mt kinh t v iu ny l khng th trnh khi. Trong trng hp video theo yu cu, cng ngh c nghin cu c th truyn ti y bng thng ca video n ngi s dng, song nu nh vy th qu t , nu khng nn HDTV cn qu nhiu bng thng, nu c nn HDTV c th truyn c qua

- 4-

Chng 1: Gii thiu tng quan v MPEG

knh SDTV sn c vi yu cu bng thng tng t. Vic nn ny khng phi l iu bt buc v cng ngh m ch l do yu cu kinh t. Trong cc studio c nhim v dng phim, ngi ta cn lu tr nhng on video, audio vo a cng c th tng thi gian truy xut. Mc d h thng x l cp cao nht phi s dng d liu khng nn nhng ngi ta vn nn li tng c dung lng lu tr ca a cng. Vic s dng h s nn nh th no trong truyn thng c ngha rt quan trng khi m ph tn b hn ch trong khi n li cn thit cho rt nhiu dch v khc v d nh in thoi di ng. Do yu cu s dng ph tn mt cch hiu qu l mt yu cu bt buc. Truyn hnh tng t l cng ngh c v s dng ph tn km hiu qu nht do n b thay th bi truyn hnh s l mt s tt yu do trong thc t ph tn cn cn cho nhiu vic khc. Trn th trng hin nay c rt nhiu b gii m cho ngi dng chn la c sn xut t nhng mch tch hp gi r. Trong khi ch c mt s t b m ha nn vic chng c t th cng khng quan trng lm. Xu hng hin nay l thit b lu tr th cng ny cng r cn ph tn th cng ngy cng t do vy trong tng lai vic nn trong vic lu tr l khng cn thit trong khi nn truyn thng s dng sng v tuyn s cng tng ln. 1.3. M ha khng tn hao v m ha d on c. Mc d c nhiu cng ngh c s dng nn nhng chng c th c phn thnh cc loi sau y. Vi nn khng tn hao, u ra ca b gii m l tng ng bit-bit so vi d liu gc. N cng c gi nh l mt chng trnh stacker s dng trong my tnh c nhn tng dung lng a s dng nhng b codec khng tn hao. S sai lch d ch mt bit vi chng trnh my tnh c th c hu qu nghim trng. Bng cch ny h s nn thng ch t c khong 2:1. Chng ta c th nhn thy rng b m ha khng tn hao khng th m bo mt h s nn cho trc v do ng truyn hoc l b ghi s phi lm vic vi tc d liu ra lun bin i. B m khng tn hao c th i km vi qu trnh kim li.

- 5-

Chng 1: Gii thiu tng quan v MPEG

H s nn cao ch c th t c vi b nn c tn hao. D liu i ra khi b gii m khng phi tng ng bit-bit vi d liu ngun v so snh gia chng ta s thy s khc nhau. Nn c tn hao khng thch hp vi vic s dng cho d liu my tnh, nhng c s dng trong chun MPEG cho h s nn cao hn rt nhiu so vi nn khng tn hao. B nn c hiu qu l b nn lm cho nhng li xut hin ni m c quan th gic hoc thnh gic ca con ngi rt kh c th pht hin c. Do vy b codec ny phi da trn s hiu bit v cm nhn ca mt v tai ngi v chng c gi l b m cm nhn (perceptive codec). Trong b m ha c tn hao, h s nn t c cao hn nhiu. Cc c quan cm nhn ca con ngi cn c m hnh chnh xc. B m ny c th cho mt h s nn c nh. iu ny thun li cho vic truyn thng trong thc t khi m d liu tc c nh lun lun d dng lm vic hn l d liu c tc thay i. Kt qu ca vic h s nn c nh l cht lng u ra thay i theo phc tp ca u vo. B m kiu ny khng th mc ni vo nhau mt cch ty nu chng s dng nhng thut ton khc nhau. Do d liu sau b gii m khng phi tng ng bit-bit vi d liu ngun do vy khng c b kim li no trong b codec ny v cng khng th phn bit c li do b m ha hay l li do truyn thng.

Progressive scan source (a) RGB source (b) Component source (c)

Compress (lossy)

Intelaced signal

Compress

Y. Pr. Pb

Compress (lossy)

Composite NTSC/PALL/ SECAM

Hnh 1.3: Cng ngh nn s dng trong truyn hnh tng t

- 6-

Chng 1: Gii thiu tng quan v MPEG

D l cng ngh s mi c chp nhn gn y song vic nn th c t rt lu khi m c cng ngh truyn hnh. Hnh 1.3 ch ra nhng cng ngh nn s dng trong TV truyn thng. Hu ht tn hiu video u c mi lin h khng tuyn tnh gia sng v mc th ca tn hiu c gi l hin tng gamma. Gamma l cng ngh nn cm nhn da trn s cm nhn ca con ngi v li hnh nh l mt hm ca sng. Cng ngh ny cho php mc li do m ha 8-bit ch nh l m ha tuyn tnh 14-bit. Mt cng ngh s dng lu i nht l cng ngh trn (interlace) c s dng trong cng ngh tng t lm gim bng thng. Vic to ra tn hiu TV mu t RGB l mt minh ha ca b m cm nhn. H thng cm nhn ca con ngi khng cm thy s khc bit v cht lng mc d bng thng ca tn hiu mu c gim i. iu ny l do cm nhn ca mt ngi v thay i mu sc km hn nhiu so vi thay i sng. Hng tip cn ny cn c s dng trong chun nn MPEG. 1.4. Nguyn l c bn ca nn. Trong h thng PCM, tc bit c quyt nh do tn s ly mu v s bit trn mi mu, gi tr ny thng l c nh. Ngc li, lng thng tin th lun thay i. Vi nhng tn hiu thc lun c nhng phn c th bit trc t phn trc hoc sau , mt b gii m c kh nng d on c th on c phn ny v do vy vic gi nhng d liu ny i l khng cn thit, ch c thng tin thc s mi c gi i. Nu c im ca b gii m l bit trc th pha gi c th b qua nhng thng tin m bn thu c th t ti to li c. V do vy th b m ha lun hot ng vi mt kiu ca b gii m. S khc bit gia tc thng tin v tc dng bit gi l d tha. H thng nn c thit k lm gim cng nhiu cng tt s d tha ny trong phm vi c th. Mt cch lm iu ny l khai thc tnh cht d on trc bng thng k. Entropy hay lng thng tin l hm ca s khc bit gia gi tr ca n vi gi tr c d bo trc. Hu ht cc tn hiu c mt s bc d on. Tn hiu hnh sin hon ton c th on trc bi mi chu k chng u nh nhau. Theo l thuyt Shanon th mt tn hiu hon ton c th d bo trc th khng mang thng tin. Trong trng hp sng sin th iu ny l hon ton

- 7-

Chng 1: Gii thiu tng quan v MPEG

ng bi n biu din mt tn s n v khng chim di thng. Ngc li vi trng hp trn, tn hiu nh l n th hon ton khng th on trc c. Mt im cn lu l mt b m lm vic tt vi d liu sch c th s khng lm vic tt na khi m c n cng thm vo. Hu ht cc b nn trong thc t lun i km vi b tin x l, mt b gim n thng c thm vo b ny khi m tn hiu n l khng th d on trc c.

M ha l tng khng tn hao Bc tn hiu Entropy

Entropy

D tha Tn s (a) M ha c tn hao Entro

Cht lng xu Cht lng tt phc tp

(b)

(c)

Hnh 1.4: (a) b m ha l tng khng tn hao ch tch ra phn d tha ca d liu, d liu ban u khng h b mt thng tin, vi b m ha c tn hao th mt phn lng thng tin s b mt i. (b) Khi h s nn tng th phc tp ca b m phi tng ln m bo cht lng. (c) H s nn cao c xu hng lm tng tr ca h thng. Hnh a cho thy lng entropy cn c truyn i. B m l tng cn tch ra c phn ny v cht lng tn hiu c khi phc li l hon ho. Hnh b cho thy h s nn cng cao th cng phc tp. Hnh c cho thy cng nn nhiu th tr cng tng.

- 8-

H s n n

H s n n

Cht lng xu Cht lng tt tr

Chng 1: Gii thiu tng quan v MPEG

Hin nhin rng chng ta cn phi cung cp mt knh truyn c th truyn i entropy c b m ha ly ra. Nu dung nng knh truyn khng th b m ha s phi b qua mt phn entropy km theo l phn thng tin c ch. Mt knh truyn n c tc thay i l knh truyn c t lu nhng khng ph bin lm vi cc nh cung cp, hin nay c nhng h thng mi nh l ATM h tr knh c tc thay i. Truyn thng s s dng trong DVB l tc c nh. Yu cu tc bin i c th c khc phc bng cch kt hp mt s knh c tc thay i thnh mt knh c tc c nh bng cch phn b hp l tc d liu gia cc knh. Kh nng tt c cc knh truyn cng mt lc u t nh entropy l rt nh do vy vi mt knh c tc cho trc th nhng knh c d liu t phc tp, yu cu t bng thng s c truyn cng vi nhng knh c d liu phc tp, yu cu bng thng ln. y l nguyn l c bn ca vic kt hp cc knh. Vi nhng ngun thng tin c to nn t nhng phn t c bn ging nhau, v d nhng bn tin vit bng ting Anh chng hn, ta c th tin hnh thng k xc sut xut hin ca tng ch ci. M ha chiu di thay i l m m s dng nhng t m ngn cho nhng k t c tn s xut hin cao, cn nhng k t tn s xut hin thp s dng m c chiu di ln hn. M ny l mt loi m khng mt thng tin. M rt ni ting l m Morse l m s dng phng php ny. Ch ci e thng xuyn xut hin trong ting Anh v vy n c biu th bi mt chm n (single dot), cn ch ci z t xut hin v n c minh ha bi mt m rt di. Hon ton c th nhn thy l b m ny da trn s hiu bit v tn s cc k t c thng k trc. Nu s dng m ny cho ngn ng khc c th s khng hiu qu na, v d nh ch ci z l rt ph bin vi ting Sc. M Huffman l m lm vic vi nhng s liu thng k ca ngun d liu bit trc. Vic truyn thng c nghin cu trc, sau ngi ta s dnh nhng t m ngn m t cho nhng tn hiu c tn s xut hin cao, ngc li t m di s cho nhng tn hiu c tn s xut hin thp. 1.5. Nn video

- 9-

Chng 1: Gii thiu tng quan v MPEG

Nn trong nh loi b phn d tha trong mt nh (a) Nn lin nh loi b phn d tha gia cc nh (b)

Hnh 1.5: (a) Nn trong nh ch lm vic trn 1 nh n duy nht. (b) Nn lin nh lm vic vi mt chui cc nh

Hnh 1.5a l m ha ca mt hnh nh ring r. y c gi l m ha n nh hay m ha khng gian (spatial compress). Mt li im ca vic nn trong nh l c th bin tp trc tip tng nh mt khng cn lin quan ti cc nh khc trong chui. Mt s chun nn s dng nn trong nh l Digital Betacam, DVC, D-9. Chun ISO JPEG l mt trong cc chun nn kiu ny. ng dng ca chun JPEG trong truyn hnh l Motion JPEG. H s nn cao hn thu c bng cch gim lng d tha thng tin t nh ny so vi nh trc . Nn theo cch ny l nn theo trc thi gian. c gi l nn lin nh hay inter-coding compress. Nn kiu ny cho h s nn cao nhng c mt nhc im l mt nh ch c c bng cch c nh trc cng thm vi phn sai khc. Vic can thip vo mt nh ring l trong dng bit MPEG l khng th v s sai lch ca mt nh c th ko theo s khi phc khng chnh xc cho cc nh tip theo . Cc thut ng thng c s dng l: nh I (Intra-picture): l nh ch s dng nn trong nh, mang thng tin v mt nh hon chnh. nh I cho php truy cp ngu nhin, c nn thp nht. nh P (Predicted-picture): nh d on trc, l nh c m ha c b chuyn ng t nh I hoc nh P pha trc.

- 10-

Chng 1: Gii thiu tng quan v MPEG

nh B (Bi-directional predicted picture): nh d on hai chiu, l nh c m ha s dng b chuyn ng t cc nh I hoc P trc v sau. nh B cho h s nn l cao nht. 1.5.1. Nn trong nh.

y l loi nn lm gim d tha trong min khng gian, ch thc hin nn trn d liu ca mt nh, khng s dng thng tin ca cc nh trc hoc sau . Phn tch hnh nh TV thng thng ch ra rng cc thnh phn tn s cao th hin chi tit ca hnh nh, v ch c phn nh nng lng l ca cc thnh phn ny. Trong hnh nh cng tn ti nhng vng m trong cc im l tng t ging nhau, nhng im nh th ny nm vng tn s thp. Vng c sng nh nhau nm tn s bng 0. Vic b qua nhng vng c tn s cao l khng th c bi n to nn r rng, mm mi ca hnh nh. Tuy vy cc thnh phn tn s cao ch chim mt phn nh nng lng nn cn it bit m ha hn, ng thi sai s nhng vng c tn s cao th con ngi cng kh nhn bit hn. Nh s dng c im ny m vic nn tr nn c hiu qu. 1.5.2. Nn lin nh.

Nn lin nh s dng tnh cht tng t gia cc nh k tip. Thay v truyn thng tin ca tng nh ring r, phng php ny truyn i s sai khc gia nh hin ti vi nh trc bng kiu m ha vi sai. H thng m t hnh 1.6a b hn ch ch nu knh truyn c li th n s gy tc ng n mi nh tip theo . khc phc hin tng ny mt nh chnh xc s c truyn i theo chu k thay v truyn s sai khc so vi nh trc . Vic bin tp dng bit ch c th thc hin ti nhng im m nh I xut hin.

- 11-

Chng 1: Gii thiu tng quan v MPEG

im nh hin ti im nh nh trc Thi gian

Tr 1 nh

+ S khc bit

(a)

Gi nh

I Gi sai khc

D Gi sai khc

D Gi sai khc

Gi nh

(b)

Hnh 1.6: (a) H thng nn lin nh s dng mt nh tr so snh s khc bit vi nh hin ti. (b) trnh li xy ra trn ng truyn, nh I c gi i theo chu k. 1.5.3. b chuyn ng. Gii thiu v php

Trong khi thc hin quay mt chng trnh TV, mt i tng c th ng yn trc mt camera chuyn ng hoc bn thn i tng chuyn ng trc mt camera t c nh. B chuyn ng l qu trnh m o c chnh xc hng chuyn ng ca i tng t hnh nh hin ti sang hnh k tip, do m phn chuyn ng c tch ring ra, lm gim d tha gia cc hnh nh. Hnh 1.7 m t mt v d ca chuyn ng ca i tng gia cc nh. Tt c hnh nh th chuyn ng theo trc thi gian, cn bn thn i tng th di chuyn theo trc optic flow axis . Trc ny s ch ra hng chuyn ng ca i tng t nh ny sang nh k tip. Mt iu hin nhin l d liu din t s chuyn ng ca i tng s thay i tng ng vi thi gian. Tuy nhin nu nhn theo trc optic flow axis th hnh nh ca i tng ch thay i nu chnh bn thn i tng b bin dng, di chuyn vo bng ti hoc b

- 12-

Chng 1: Gii thiu tng quan v MPEG

xoay i. Do vy d liu d tha c loi b ng k nu nh chng ta bit c trc chuyn ng. Khi y h s nn thu c s cao hn nhiu.

Optic flow axis

Trc tung Trc honh

Trc thi gian

Hnh 1.7: Chuyn ng ca i tng trong khng gian 3 chiu s theo trc optic flow axis. Mt b m ha b chuyn ng hot ng theo nguyn tc sau. Mt nh tham chiu c gi i, nhng c lu tr so snh vi cc nh khc tm ra vector chuyn ng cho nhng phn khc nhau trn nh. nh tham chiu ny c dch i theo cc vector chuyn ng loi b i phn chuyn ng gia cc nh. nh ny c gi l nh d on trc. Sau nh ny s c so snh vi nh thc pht hin ra sai s d on. Sai s d on c truyn i cng vi vector chuyn ng. ni thu, nh tham chiu c lu gi trong b nh. N c dch i bi cc vector chuyn ng v cui cng l li c sa li to ra nh gc. 1.6. Gii thiu v MPEG-1 MPEG-1 c thit k ban u nhm m ha nh ng v m thanh thnh dng bit c tc ca audio Compact Disc. Kt qu to ra Video- CD nhng hin nay c thay th bi DVD. c c tc bt thp MPEG-1 ch s dng t l hnh nh t 2430Hz cho kt qu l cht lng ch mc trung bnh. t c tc bit ny, MPEG-1 gim tc ly mu bng mt na TV chun. C th l vi h thng 25Hz hnh nh c kch thc l 352 288 im nh, cn vi h 30Hz l 352 240 im nh. nh dng nh vy c gi l common intermediate

- 13-

Chng 1: Gii thiu tng quan v MPEG

format (CIF). Vi tn hiu u vo l tn hiu video tng hp, CIF c th nhn c bng cch gim tc ly mu cc dng tch cc xung mt na. Chun nn ny dng nh c v rt n s, song cho tc bit thp. Tuy vy n cng c nh gi l cung cp nhng cng c m ha quan trng m cn c tip tc s dng trong MPEG-2 v MPEG-4. Chng bao gm c php dng c s, b chuyn ng, iu khin tc bit . Nhiu nguyn l m ha ca MPEG-1 c ly ra t JPEG. Chun MPEG-1 cng nh ra vic m ha audio hai knh. 1.7. MPEG-2 cng cc Profile v Level MPEG-2 c xem l mt chun c ng dng rt rng ln. V d MPEG-2 h tr phn gii cao (HD) m MPEG-1 khng c. Chun ny cng tr nn quan trng khi n c chn lm chun nn cho DVB v DVD. Chun MPEG-3 d nh thit k cho HDTV nhng ngi ta nhn thy MPEG-2 (cng vi cc m rng ca chun ny) c th p ng cc yu cu ny do vy m ko c chun MPEG-3.
Profile Simple Level High 4:2:0 1920 x1152 80 Mb/s 4:2:0 1440 x1152 60 Mb/s 4:2:0 4:2:0 720 x 576 720 x 576 15 Mb/s 15 Mb/s 4:2:0 352 x 288 4 Mb/s 4:2:2 720 x 608 50Mb/s 4:2:0 720 x 576 15 Mb/s 4:2:0 352 x 288 4 Mb/s 4:2:0, 4:2:2 1920 x1152 100 Mb/s 4:2:0 4:2:0, 4:2:2 1440 x1152 1440 x1152 60 Mb/s 80 Mb/s 4:2:0, 4:2:2 720 x 576 20 Mb/s Main 4:2:2 SNR Spatial High

High 1440

Main

Low

Hnh 1.8: Cc Profile v Level trong MPEG-2

MPEG-2 c xy dng trn c s MPEG-1 vi s m rng v phm vi kch thc hnh nh v tc bit. Vic ghp cc dng bit vi nhau cng c gii quyt trong chun

- 14-

Chng 1: Gii thiu tng quan v MPEG

MPEG-2. Chun MPEG-2 l s m rng ca chun MPEG-1 v vy mt iu d hiu l b gii m MPEG-2 c th lm vic c vi dng bit ca MPEG-1. Vi mt chun duy nht nhng MPEG-2 c th gii quyt c rt nhiu yu cu ng dng. Chun ny c chia nh thnh cc Profile v Level. Cc Profile th hin phc tp cn cc Level th hin kch c hnh nh hoc phn gii i km vi Profile tng ng. Khng phi tt c cc Level u h tr mi Profile. Mt b gii m MPEG-2 vi Profile v Level cho trc c th gii m Profile v Level thp hn. Mt s h thng nn c kh nng to ra tn hiu c th phn cp (scaleable signal). Qu trnh ny l qu trnh m sau khi cho tn hiu u vo th ta s thu c tn hiu u ra gm c mt tn hiu chnh (main signal) v mt tn hiu h tr ( helper signal). Bn thn tn hiu chnh c th c gii m c lp cho cht lng hnh nh nht nh, nhng nu c thm tn hiu h tr th cht lng hnh nh s c tng ln.

Tn hiu vo

B m ha c kh nng phn cp theo SNR

Tn hiu c bn

Hnh nh cht lng trung bnh Hnh nh c cht lng tt hn

Tn hiu tng cng (a)

Tn hiu vo

Tn hiu c bn B m ha c kh nng phn cp theo khng gian Tn hiu tng cng

Hnh nh phn gii thp

Hnh nh phn gii cao

(b)

Hnh 1.9: (a) B phn cp theo t l tn/tp cho ra mt tn hiu c t s tn/n mc trung bnh v mt tn hiu gim n. (b) B phn cp theo khng gian cho ra mt tn hiu mc trung bnh v mt tn hiu tng cht lng hnh nh.

- 15-

Chng 1: Gii thiu tng quan v MPEG

Hnh 1.9a ch ra mt b m ha MPEG, bng cch lng t li c trng s s thu c mt hnh nh c t l tn/tp mc trung bnh. Ti b gii m, hnh nh ny hon ton c kh nng ti to li, nhng km theo chc chn l c n lng t ln lm cht lng hnh km hn. S sai khc do n ny c th c nn v gi i nh l tn hiu h tr. Mt b gii m n gin th ch gii m tn hiu chnh cn b gii m phc tp hn th c th gii m c tn hiu chnh v tn hiu h tr cho kt qu l mt hnh nh mc n thp. y l nguyn l ca b phn cp theo t l tn/tp. Hnh 1.9b l nguyn l ca b phn cp theo khng gian. Nu ch cn m ha mc trung bnh th mt t hiu c phn gii trung bnh c to ra v c th c gii m bng TV c phn gii tiu chun SDTV. Nhng nu gi km vo mt tn hiu tng cng th mt b gii m thch hp ti ni thu c th kt hp c hai tn hiu cho ra hnh nh c phn gii cao HDTV. Chun MPEG-2 tng s knh m thanh ln ti 5 knh nhng vn m bo tng thch vi MPEG-1. Ngoi ra MPEG-2 cn c nhng phng php m ha m thanh khc hiu qu hn nhng khng tng thch ngc vi MPEG-1. l chun nn MPEG-2 AAC (advance audio coding). 1.8. Gii thiu v MPEG -4 MPEG-4 s dng nhng cng c phc tp hn na nhm mang li h s nn cao hn MPEG-2. MPEG-4 c mong i l s c nhiu ng dng trong Internet v Wireless nh l MPEG-2 c trong DVB v DVD. MPEG-4 a ra mt s cc cng c m ha mi c minh ha trong hnh 1.10. chun MPEG-1 v MPEG-2 vic b chuyn ng c thc hin trn tng khi nh c kch thc c nh gi l macroblocks. iu ny cho php b m lm vic tt tc c thit k, tuy nhin cc macroblocs ny khng phi lc no cng c tnh ton chnh xc vi chiu chuyn ng ca vt th thc. iu ny lm tng s bit d tha. chun MPEG-4, i tng ng c th c m ha vi hnh dng ty . i tng ng c th c m t bi cc vector chuyn ng v s lm gim c nhiu d liu d tha. Ty theo tng Profile, i tng ng c th l hai chiu hoc ba chiu, chn sng hay l trong sut. B gii m phi c kh nng xp xp tng lp i tng theo gn xa ca i tng so vi ngi xem thnh mt hnh nh thc. M ha hnh nh trong chun MPEG-4 c gi l m ha xp lp (texture coding) v cho kt qu tt hn MPEG-2.

- 16-

Chng 1: Gii thiu tng quan v MPEG Object coding Visual object: Part of scene which can be independently accessed and manipulated

Video Object

Still texture object

Mesh object

Face and body animation object

Hnh 1.10: MPEG-4 a ra mt s cc cng c mi m cc chun trc khng c. Bao gm m ha i tng, m ha dng li (mesh coding), m ha nh tnh, th hin trng thi ca khun mt v c th.

tng cng vic b chuyn ng, chun MPEG-4 cn c kh nng m t mt i tng di chuyn theo hng v gn hoc ra xa l bao nhiu bng cch s dng cng ngh gi l m ha dng li (mesh coding). Bng cch lm cong hnh nh (warping image), vic d on hnh nh hin ti c tng cng. MPEG-4 cng a ra cch m ha hnh nh dng bin i cosin ri rc DCT hoc dng wavelet. Chun MPEG-2 h tr mt s dng phn cp nh m t trn, chun MPEG-4 cn pht trin xa hn na. Ngoi phn cp theo khng gian v theo tn/tp nh MPEG-2 th MPEG-4 cn h tr phn cp theo thi gian. Mt dng bit cp c s c t l khung hnh nht nh c th kt hp vi mt dng bt h tr thm gii m cho ra hnh nh c t l khung hnh cao hn. iu ny quan trng ch n cho php chng ta pht trin nhng chng trnh c tc khun hnh cao hn so vi tc chun ca TV v phim hin ti nhng vn m bo tng thch vi cc thit b truyn thng. N cng c ng dng trong mng internet, cho php ngi dng c cht lng hnh nh tt nht ng vi kh nng ng truyn m h c. MPEG-4 cn a ra nhng chun cho vic th hin kch thch tnh cm trn khun mt v c th. Nhng vector c bit cho php mt hnh nh tnh ca khun mt hoc c

- 17-

Chng 1: Gii thiu tng quan v MPEG

th km theo c phn c th c kch thch km theo c ging ni vi tc bit rt thp. iu ny rt c ngha vi nhng h thng nh l h thng gi lp hay tr chi in t, khi i tng m ngi s dng iu khin di chuyn khp mn hnh. im bt li ca vic nn theo kiu ny l tng thm phc tp ca b m nhng vi s pht trin trong cng ngh x l s, mch tch hp gi thnh ngy cng r th y r rng khng phi l vn qu ln. Nh c mong i trc khi ra i, vi h thng cng c rt ln, chun MPEG4 p ng mt cch hon ho cho rt nhiu ng dng, cng nh l MPEG-2 h tr cc ng dng khc nhau bng cch chia ra cc Profile v Level. 1.9. Gii thiu v MPEG-7

Ngy nay khi m cc d liu hnh nh v m thanh c s ha ngy cng tr nn ph bin cng vi s pht trin ca my tnh v internet th khi lng cc d liu trn tr thnh khng l. iu dn n vic tm kim c mt on m thanh hoc hnh nh ph hp vi s thch ca ngi s dng l v cng kh khn. Vi nhng d liu dng k t (nh vn bn kiu text, doc, html..) th c nhng gii php tm kim hiu qu, trang web www.google.com l mt v d in hnh trong lnh vc tm kim. Tuy nhin vi d liu a phng tin th vn l v cng phc tp. MPEG-7 ra i nhm mc ch gii quyt vn ny. Chun ny thng c gi l Giao din m t ni dung a phng tin - Multimedia Content Description Interface. N cho php tm kim mt cch nhanh chng v hiu qu cc d liu a phng tin theo ni dung. Ban u MPEG-7 c thit k vi mc ch cung cp thm mt chc nng b sung cho cc chun MPEG trc a ra thng tin v ni dung ca d liu. Sau ny th chc nng ny tr thnh tiu chun ca vic m t ni dung a phng tin. Nh chng ta bit, chun MPEG-4 l chun nn c xy dng trn vic m ha i tng do vy y l nn tng tt xy dng MPEG-7. MPEG-7 c th c s dng c lp vi cc chun nn trc . Nhng cng cn lu l chun MPEG-7 khng th thay th hon ton cc chun MPEG-1, MPEG-2 hay MPEG-4. 1.10. Nn m thanh Cc h thng nn audio c xy dng trn c s nghin cu v c tnh sinh l cng nh gii hn thnh gic ca con ngi nhm loi b thnh phn thng tin d tha trong cc tn hiu audio.

- 18-

Chng 1: Gii thiu tng quan v MPEG

H thng thnh gic con ngi (HAS Human Auditory System) hot ng nh mt b phn tch ph, cc thnh phn ph ca m thanh c phn tch c lp qua cc b lc thng di gi l cc di bng chun. Cc di bng chun c rng 100Hz khi tn s di 500Hz cn khi tn s ln hn 500Hz th rng bng t l vi tn s. Do vy trn thc t m thanh c chia thnh 25 di bng con tng ng vi 25 b lc c tai theo quy lut t nhin. Cc di bng ny s c x l ring r, ri c tng hp li trn c s nh gi mc nng lng v nhy ca HAS vi tng bng. Nn khng tn hao Nn khng tn hao cho php khi phc li mt cch y ht dng bit trc khi nn. Cch nn ny loi b nhng d tha thng k, nhng thng tin trong tn hiu c th d on t cc mu trc . Cch nn ny c u im l cht lng m thanh tt nhng h s nn t c li qu thp, thng ch gii hn t l 2:1 ty thuc vo phc tp ca d liu ngun. Nn khng tn hao thng s dng cc k thut sau y: Thut ton vi phn: sai khc gia cc mu tn hiu lin nhau thng nh hn nhiu so vi bn thn ln ca mu tn hiu. Do vy c mt d tha thng tin ln. K thut DPCM li dng c im ny. DPCM m ha phn khc nhau gia cc tn hiu ch khng m ha bn thn mu tn hiu. H thng ADPCM th li m ha phn khc nhau gia mu thc vi mu d on cho hiu qu nn tt hn na so vi h thng DPCM. M ha vi t m c di thay i lm tng tnh hiu qu ca vic m ha thng tin.

Nn c tn hao Nn c tn hao li dng c im ca h thng HAS l khng th phn bit mt thnh phn tn s no khi c mt tn s gn vi bin ln hn c pht. Bng cch nn ny h s nn t c trong khong t 2:1 n 10:1 ty thuc vo qu trnh m ha v yu cu cht lng ca tn hiu sau nn. Nguyn l c bn ca nn c tn hao l loi b i nhng thnh phn nm di ng cong ngng m. V l do ny nn c tn hao c gi l lm mt cc thnh phn m. Nn c tn hao thng s dng kt hp cc k thut sau y: K thut che (masking) i vi cc thnh phn tn hiu trong min thi gian v min tn s. S bit lng t dng m ha cho mi bng l khc nhau.

- 19-

Chng 1: Gii thiu tng quan v MPEG

Chn mc tp m lng t cho tng m ca tn hiu m thanh bng cch a ra s bit m bo mc nhiu lng t nm di mc gi tr cn chn. M ha ni: s dng tnh d tha trong h thng m thanh a knh. Ngi ta nhn thy rng c nhiu thnh phn tn hiu ging nhau trn cc knh ca mt h thng a knh. Do nhng thnh phn chung ny c m ha ring ra v c ch th gii m lp li trn tt c cc knh. 1.11. Dng bit MPEG

Video 1 B nn Audio 1 ng gi

Ghp knh dng chng trnh Ghp knh dng truyn ti

Dng chng trnh

B nn

ng gi

Video 2

B nn

ng gi

Dng truyn ti n chng trnh (SPTS)

Audio 2

B nn

ng gi

Ghp knh dng truyn ti

Dng truyn ti

Dng c s

Dng c s ng gi

Hnh 1.11: Cu trc dng bit MPEG MPEG h tr mt s loi dng bit cho nhiu mc ch khc nhau c m t hnh 1.11. u ra ca mt b nn c gi l dng c s (elementary stream). Nhiu dng c s c th c trn li thnh mt dng truyn ti (transport stream). Vic ghp knh ny i hi nhng khi hoc gi c kch thc c nh. Cu trc ca dng truyn ti l phc tp v n cn cho bit kt hp vi mt dng c s hnh nh th cn dng c s m

- 20-

Chng 1: Gii thiu tng quan v MPEG

thanh v dng d liu ph thuc no. Tt nhin l c th c dng truyn ti n chng trnh (single program transport stream) ch mang dng c s ca mt chng trnh TV. Vi mt s ng dng nht nh th vic s dng dng truyn ti tr nn khng ph hp. Mi gi truyn ti c kch thc nh, cng vi vic n phi c phn tiu lm cho tn dung lng. trng hp ny ta dng dng chng trnh (program stream). Mt dng chng trnh l dng bit ghp tn hiu hnh nh v m thanh cho mt chng trnh vo vi nhau. Khng ging nh dng truyn ti, cc khi ca dng chng trnh thng ln v c kch thc khng phi l c nh. Cu trc chi tit ca dng c s, dng c s ng gi v dng truyn ti s c m t chi tit trong cc chng sau.

- 21-

Chng 2: Dng c s v dng c s ng gi

Chng 2: Dng c s (elementary stream) v dng c s ng gi (packetized elementary stream)


2.1. Dng c s (elementary stream).

Tn hiu video s dng thc CCIR-601 sau khi nn MPEG c dng mt dng d liu video c s (Elementary Stream - ES). Dng ES ch cha nhng thng tin cn thit khi phc li hnh nh ban u. Tng t, tn hiu audio s dng thc AES/EBU (Tn s ly mu 48kHz, 24bit/mu, tc bt 1152kbps) c m ha thnh dng c s audio (audio ES). Dng c s v c bn l tn hiu gc ti u ra ca b m ha v ch cha nhng thng tin cn thit gip b gii m ti to li hnh nh, m thanh ban u.

D liu video (REC 601) D liu audio (AES/EBU)

M ha Video

Dng c s Elementary Stream ES Dng c s Elementary Stream ES

M ha audio

Hnh 2.1: Dng c s

Hnh 2.2 sau y m t cch thc to ra dng c s. Tn hiu video sau khi qua b m ha hai chiu, cho kt qu l cc thng tin v cc vector chuyn ng, bng lng t, v cc d liu v khng gian. Nhng d liu ny sau khi c m ha bng cc phng thc khc nhau s c trn vo thnh mt dng c s duy nht. D liu sau b ghp (mux) nhiu hay t l ty vo lng thng tin c trong nh. Nhng tc bit ca dng c s l khng i nh qua mt b m. B m ny c kh nng cm nhn tc d liu i ra iu khin tc m ha d liu u vo. Tc ca dng i ra c qui nh

- 22-

Chng 2: Dng c s v dng c s ng gi

bi thit b ng h yu cu (demand clock). ng h ny l do knh truyn hoc thit b lu tr quyt nh.


Bng lng t D liu khng gian

Tn hiu Video

M ha 2 chiu

M ha entropy v m ha di t m thay i M ha vi sai

B ghp

Vector chuyn ng

Dng c s

Slice iu khin tc

B m
ng h yu cu

Hnh 2.2: Hnh thnh dng c s. Cu trc dng c s c m t nh sau:


Vector chuyn ng xn Khi cc h s DCT Macro block xn Slice Tn hiu ng b I/P/B Tn hiu nh thi

xn nh

Tc nh Tn hiu ra Loi mu

Ma trn lng t

Level Profile xn

xn

Video sequence C nh Qut lin tuc/ xen k ng b T l khun hnh

Nhm nh

M/ ng

Hnh 2.3: Cu trc dng c s

- 23-

Chng 2: Dng c s v dng c s ng gi

u tin l mt tp hp hp cc h s biu din khi DCT. Su hoc tm khi DCT to nn mt macro block. nh B v nh P mi macro block s tng ng vi mt vector b chuyn ng. Mt s macro block s to thnh mt lt nh (slice) biu th sc ngang ca hnh nh t tri sang phi. Tp hp cc lt nh to thnh mt nh, nh ny th cn bit gi tr c I/P/B bit c loi nh tng ng. Mt s nh to thnh mt nhm nh (GOP - Group of Picture). Mt nhm nh bt u bng nh I, gia hai nh I lin nhau l mt s nh P v c th c thm nh B. Mt tp hp cc nhm nh to thnh on d liu video. Bt u mi chui video u c phn tiu cha nhng thng tin quan trng h tr cho b gii m.
2.2. Dng c s ng gi (packetized elementary stream)

2.2.1. dng c s ng gi

Gii thiu chung v

Do dng d liu c s l lin tc, c chiu di ty thuc vo lng d liu a vo b m ha, c th truyn i vi tin cy cao, dng ES c ng gi thnh dng c s ng gi ( Packetized Elementary Stream - PES ). Mi gi PES gm mt tiu v d liu ca dng c s.
Dng c s video (Video ES) Dng c s audio (Audio ES) Video PES

ng gi ng gi Hnh 2.4: Dng c s ng gi

Audio PES

Start code

Stream ID

PTS

DTS

Hnh 2.5: Cu trc gi PES

Dng c s video l dng bit lin tc mang thng tin v hnh nh. Trong vic lu tr v truyn dn th s thch hp hn nhiu nu s dng nhng khi d liu ri rc, do vy

- 24-

D at a

Chng 2: Dng c s v dng c s ng gi

dng c s c ng gi to thnh dng c s ng gi PES (packetized elementary stream). Tng t nh vy, d liu audio cng cn c ng gi. Cu trc ca mt gi c m t trong hnh 2.5. Gi c bt u bng phn tiu cha mt m bt u gi v mt m phn bit loi d liu cha trong gi. Ngoi ra c th c thm mt s nhn thi gian ng b vi b gii m hnh nh trong thi gian thc v ng b vi m thanh. Hnh 2.6 ch ra rng nhn thi gian thc cht l ly mu trng thi ca mt b m c iu khin bi ng h 90kHz. ng h ny c c nh chia tn mt ng h ch 27MHz cho 300. C hai loi nhn thi gian l nhn thi gian trnh din PTS (presentation time stamp) v nhn thi gian gii m DTS (decode time stamp). Nhn thi gian trnh din c dng xc nh khi no th hnh nh s c th hin trn mn nh, cn nhn thi gian gii m xc nh khi no hnh nh c gii m. Trong m ha hai chiu, nhng nhn thi gian ny c th khng khc nhau.

27 MHz Encoder clock

: 300

90 kHz

33-bit count

Time stamp

Hnh 2.6: Nhn thi gian Gi d liu m thanh ch c nhn thi gian trnh din. V khi c s ng b m thanh, th dng d liu audio v video phi c gn nhn t cng mt b m. Mt minh ha c cho hnh 2.7. Nhm nh c bt u bi nh I, sau nh P c gi trc nh B1 v B2. nh P phi c gii m trc khi B1 v B2 gii m. Ti mt thi im ch c mt nh c gii m, nh I c gii m thi im N nhng phi ti thi im N+1 th n mi c th hin trn mn nh. Khi nh I c th hin th nh P 1 c gii m. P1 s c lu gi trong RAM. Ti thi im N+2, nh B1 c gii m v th hin ngay trn mn hnh. V l do ny m n khng cn nhn thi gian gii m. Ti thi im N+3, th nh B2 c gii m v th hin. Ti N+4, th nh P1 mi c th hin. Ta thy P1 c s khc nhau nhiu nht ca hai nhn thi gian. Cng thi im ny

- 25-

Chng 2: Dng c s v dng c s ng gi

th nh P2 c gii m v lu tr gii m nh B3. Qu trnh gii m v trnh din c th tip tc.


B1 N+2 Khi truyn B2 P2 N+3 Khi gii m N I N+1 P1 N+2 B1 N+3 B2 N+4 P2 N+5 B3 N+7 N+4 B3 N+5 -

I PTS DTS N+1 N

P1 N+4 N+1

I N+1

B1 N+2

B2

P1

B3 N+5

N+3 N+4 Khi trnh din

Hnh 2.7: S dng nhn thi gian PTS/DTS trong vic ng b gii m 2 chiu.

Trn thc t, khong thi gian gia cc hnh nh n b gii m thng l khng i, do vy s l tha nu gi no cng gn thm nhn thi gian PTS/DTS. Nhn thi gian c th chim mt khong 700ms trong dng chng trnh (program stream) v 100ms trong dng truyn ti (transport stream). V l do m khng phi mi gi u c nhn PTS/DTS. V trong dng bit, mi loi nh (I, B hoc P) u c gn mt c xc nh, do b gii m c th suy ra nhn thi gian cho mi nh trong dng bt. Hnh 2.8 ch ra rng mt s gi PES c th c gom li thnh mt cm (pack) m tiu ca n c cha phn ng b v mt m tham chiu ng h h thng (system clock reference code) cho php b gii m ti to li ng h ca b m ha.

- 26-

Chng 2: Dng c s v dng c s ng gi

Tiu cm PES cha SCR

Video

Audio

Video

Audio

Video

Gi PES

Cm

Hnh 2.8: Mt s cc gi PES to thnh mt cm, phn tiu cm c cha tham chiu ng h (clock reference) 2.2.2. s ng gi
PES START CODE PREFIX (3 BYTE)

C php dng c

STREAM ID (1BYTE)

PES PACKET LENGTH (2 BYTE)

PES HEADER

STUFFING BYTES

PES PACKET DATA

10 (2 BIT)

PES SCRAMBLING CONTROL (2 BIT)

PES PRIORITY (1 BIT)

DATA ALIGNMENT INDICATOR (1 BIT)

COPYRIGHT (1 BIT)

ORIGINAL OR COPY (1 BIT)

7 FLAGS (8 BIT)

PES HEADER DATA LENGTH (8 BIT)

OPTIONAL FIELDS

PTS DTS (40 BIT)

ESCR (48 BIT)

ES RATE (24 BIT)

DSM TRICK MODE (8 BIT)

ADDITIONAL COPY INFO (8 BIT)

PES CRC (16 BIT)

PES EXTENSION

5 FLAGS

OPTIONAL FIELDS

PES PRIVATE DATA

PACK HEADER FIELD

PROGRAM PACKET SEQ COUNTER (16 BIT)

P- STD BUFFER (16 BIT)

PES EXTENSION FIELD

Hnh 2.9: C php gi PES

- 27-

Chng 2: Dng c s v dng c s ng gi 1. M tin t khi u (PES start code prefix): y l m 24-bit c gi tr l 0x000001.

M ny xc nh im bt u ca mt gi PES.
2. Nhn dng dng (stream ID): m 8-bit xc nh loi ca d liu cha trong dng c

s.
3. di gi PES (PES packet length): trng 16-bit, ch ra s byte ca gi c s ng

gi i sau trng ny.


4. Cc byte tiu v m PES: 4.1. Cc byte m (stuffing bytes): c gi tr c nh l 0xFF, c b m ha chn thm

vo gi PES, n b gii m cc byte ny c b qua. 4.2. iu khin o m PES (PES scrambling control): trng 2-bit. Gi tr v ngha c cho theo bng sau: Gi tr 00 01 10 11 ngha Khng o m Ngi dng t nh ngha Ngi dng t nh ngha Ngi dng t nh ngha

4.3. u tin PES (PES priority): trng 1 bit, ch th mc u tin ca ti tin trong gi

PES ny. Nhng gi c gi tr trng ny l 1 s c u tin hn nhng gi c gi tr 0.


4.4. Ch th sp xp d liu (data alignment indicator): trng c 1 bit. Khi c ny c gi

tr 1 ngha l c s sp xp d liu, gi tr 0 ngha l khng c s sp xp.


4.5. Bn quyn tc gi (copy right): trng 1 bit. Gi tr 1 c ngha l d liu trong gi

c bo v bi quyn tc gi, gi tr 0 c ngha l khng c bo v.


4.6. Bn gc hay l bn sao (original or copy): trng 1 bit. Khi trng ny mang gi tr

1 ngha l ni dung ca phn ti tin trong gi PES ny l bn gc. Cn khi c gi tr 0 th c ngha l ni dung trong l bn sao.
4.7. Cc gi tr c (flags):

C nhn thi gian (PTS DTS flags): trng 2-bit. Gi tr 10: nhn thi gian trnh din (PTS presentation time stamp) c trong tiu ca gi PES.
4.7.1.

- 28-

Chng 2: Dng c s v dng c s ng gi

Gi tr 11: c nhn thi gian trnh din PTS v nhn thi gian gii m (DTS decode time stamp) u c trong tiu ca gi PES. Gi tr 00: c hai nhn thi gian u khng c. Gi tr 01: b cm dng. 4.7.2. C ESCR (Elementary Stream Clock Reference Flag): trng 1 bit. Khi c t l 1 c ngha l gi tr ca ESCR c trong tiu ca gi PES. Gi tr trng l 0 c ngha l khng c ESCR trong tiu ca gi PES ny. 4.7.3. C RATE (ES rate flag): trng 1 bit, th hin s c mt hay khng ca trng ES rate trong tiu ca gi PES. 4.7.4. C TM (DSM trick mode flag): c 1 bit, th hin s c mt ca trng 8-bit m t hot ng ca Phng tin lu tr s (DSM Digital Storage Media). 4.7.5. C ACI (additional copy information flag): c 1 bit, th hin s c mt ca trng thng tin thm v loi d liu (bn gc hay l bn sao). 4.7.6. C CRC (PES CRC flag) : c 1 bit, th hin s c mt ca trng kim tra d tha vng CRC (Cyclic Redundancy Check) trong tiu ca gi PES. 4.7.7. C EXT (PES extension flag): c 1 bit, th hin s c mt ca trng m rng (extension field) trong tiu ca gi PES.
4.8. Chiu di d liu tiu (PES header data length): trng 8-bit, ch nh s byte

ca trng ty chn v cc byte m trong tiu ca gi PES ny.


4.9. Trng ty chn (optional field): 4.9.1. 4.9.2. 4.9.3.

4.9.4.

4.9.5.

Nhn thi gian trnh din (PTS Presentation Time Stamp): c s dng xc nh thi im mt n v d liu c th hin my thu. Nhn thi gian gii m (DTS Decode Time Stamp): c s dng xc nh thi im mt n v d liu c a n b gii m. Chun ng h dng c s (ESCR Elementary Stream Clock Reference): trng 48-bit, trong 42-bit c dng biu din cc trng ESCR c s (ESCR base) v ESCR m rng (ESCR extension). Tc dng c s (ES rate - Elementary Stream Rate): trng 24-bit, cho bit tc nhn byte ca gi PES khi n b gii m. n v o ca trng ny l 50 bytes/giy. Gi tr trng ny ca cc gi PES khc nhau c th thay i. Trng DSM Trick Mode: trng 8-bit, gm c:

- 29-

Chng 2: Dng c s v dng c s ng gi 4.9.5.1.

iu khin phng thc k xo (trick mode control): cho bit thng tin v k xo s dng trong dng bit tng ng nh sau: Gi tr 000 001 010 011 100 101 ti 111 M t Chy i nhanh (Fast forward) Chuyn ng chm (Slow motion) ng khung hnh (Freeze frame) Chy ngc nhanh (Fast reverse) Chy ngc chm (Slow reverse) D phng

4.9.5.2.

Nhn dng mnh (field id): trng 2-bit, ch th nhng mnh no c th hin trn mn nh. Gi tr 00 01 10 11 M t Ch th hin mnh 1 Ch th hin mnh 2 Th hin c 2 mnh D phng

4.9.5.3.

4.9.5.4.

Phc hi lt trong nh (intra slice refresh): trng 1-bit. Khi trng ny mang gi tr 1 c ngha l c th c nhng macroblocks b thiu trong d liu video ca gi PES ny. Lc ny b gii m s thay nhng macroblock b thiu bi macroblock tng ng ca hnh c gii m trc . Gi tr 0 c ngha l khng b thiu. Ct tn s (frequency truncation): trng 2-bit, ch th s hn ch cc h s tn s c s dng trong m ha d liu hnh nh. Gi tr 00 01 10 11 M t Ch c h s 1 chiu l khc 0 Ch 3 h s u tin khc 0 Ch 6 h s u tin khc 0 Tt c cc h s u c th khc 0

4.9.6.

Trng thng tin cng thm (additional copy info): trng 7-bit cha nhng d liu c nhn lin quan n thng tin v bn quyn tc gi.

- 30-

Chng 2: Dng c s v dng c s ng gi

PES CRC: trng 16-bit, mang thng tin v m sa sai (m kim tra d tha vng Cyclic Redundancy Check) ca dng PES. 4.9.8. Trng m rng (PES extension): 4.9.8.1. Cc trng c (5 flags):
4.9.7.

C d liu c nhn (PES private data flag): th hin s c mt hay khng ca d liu c nhn. C trng tiu cm (pack header field flag): th hin s c mt hay khng ca tiu cm (pack header). C m th t gi chng trnh (program packet sequence counter): Khi trng ny mang gi tr 1 th trong gi PES ny s c cc trng sau: program packet sequence counter, MPEG1 MPEG2 identifier, v trng original stuff length. Nu gi tr l 0 th s khng c cc trng nu trn. C m h thng gii m dng chng trnh (P-STD buffer flag - Program stream system target decoder buffer flag): c 1 bit, khi mang gi tr 1 ngha l cc trng sau c trong gi PES: P-STD buffer size v P-STD buffer scale. C m rng PES (PES extension flag): c 1-bit, khi t gi tr 1 ngha l trong gi PES c trng PES extension field length v cc trng c lin quan. 4.9.8.2. Trng ty chn (optional field)

D liu c nhn (PES private data): trng 16-bit mang d liu c nhn. Trng tiu cm (pack header field).

B m th t gi chng trnh (program packet sequence counter): trng 7-bit c chc nng m cc gi PES. Gi tr trng ny s tr v 0 sau khi t ch s ln nht. B m h thng gii m dng chng trnh (P-STD buffer - Program stream system target decoder buffer ).

Trng m rng PES (PES extension field).

- 31-

Chng 2: Dng c s v dng c s ng gi

2.2.3. tng trng v s bit c th tham kho theo bng sau: C php
PES_packet() { packet_start_code_prefix stream_id PES_packet_length if (stream_id != program_stream_map && stream_id != padding_stream && stream_id != private_stream_2 && stream_id != ECM && stream_id != EMM && stream_id != program_stream_directory && stream_id != DSMCC_stream && stream_id != ITU-T Rec. H.222.1 type E stream) { '10' PES_scrambling_control PES_priority data_alignment_indicator copyright original_or_copy PTS_DTS_flags ESCR_flag ES_rate_flag DSM_trick_mode_flag additional_copy_info_flag PES_CRC_flag PES_extension_flag PES_header_data_length if (PTS_DTS_flags = = '10') { '0010' PTS [32..30] marker_bit

Cu trc chi tit

S bit
24 8 16

2 2 1 1 1 1 2 1 1 1 1 1 1 8 4 3 1

- 32-

Chng 2: Dng c s v dng c s ng gi PTS [29..15] marker_bit PTS [14..0] marker_bit } if (PTS_DTS_flags = = '11') { '0011' PTS [32..30] marker_bit PTS [29..15] marker_bit PTS [14..0] marker_bit '0001' DTS [32..30] marker_bit DTS [29..15] marker_bit DTS [14..0] marker_bit } if (ESCR_flag = = '1') { reserved ESCR_base[32..30] marker_bit ESCR_base[29..15] marker_bit ESCR_base[14..0] marker_bit ESCR_extension marker_bit } if (ES_rate_flag = = '1') { marker_bit ES_rate 15 1 15 1

4 3 1 15 1 15 1 4 3 1 15 1 15 1

2 3 1 15 1 15 1 9 1

1 22

- 33-

Chng 2: Dng c s v dng c s ng gi marker_bit } if (DSM_trick_mode_flag = = '1') { trick_mode_control if ( trick_mode_control = = fast_forward ) { field_id intra_slice_refresh frequency_truncation } else if ( trick_mode_control = = slow_motion ) { rep_cntrl } else if ( trick_mode_control = = freeze_frame ) { field_id reserved } else if ( trick_mode_control = = fast_reverse ) { field_id intra_slice_refresh frequency_truncation } else if ( trick_mode_control = = slow_reverse ) { rep_cntrl } Else reserved } if ( additional_copy_info_flag = = '1') { marker_bit additional_copy_info } if ( PES_CRC_flag = = '1') { previous_PES_packet_CRC } if ( PES_extension_flag = = '1') { 1

3 2 1 2

2 3

2 1 2

1 7

16

- 34-

Chng 2: Dng c s v dng c s ng gi PES_private_data_flag pack_header_field_flag program_packet_sequence_counter_flag P-STD_buffer_flag reserved PES_extension_flag_2 if ( PES_private_data_flag = = '1') { PES_private_data } if (pack_header_field_flag = = '1') { pack_field_length pack_header() } if (program_packet_sequence_counter_flag = = '1') { marker_bit program_packet_sequence_counter marker_bit MPEG1_MPEG2_identifier original_stuff_length } if ( P-STD_buffer_flag = = '1') { '01' P-STD_buffer_scale P-STD_buffer_size } if ( PES_extension_flag_2 = = '1') { marker_bit PES_extension_field_length for (i = 0; i < PES_extension_field_length; i) { reserved } } } } For ( i = 0 ; i < N1 ; i++){ 1 1 1 1 3 1 128

1 7 1 1 6

2 1 13

1 7 8

- 35-

Chng 2: Dng c s v dng c s ng gi stuffing_byte } for (i = 0; i <N2; i++) { PES_packet_data_byte } } else if ( stream_id = = program_stream_map || stream_id = = private_stream_2 || stream_id = = ECM || stream_id = = EMM || stream_id = = program_stream_directory || stream_id = = DSMCC_stream || stream_id = = ITU-T Rec. H.222.1 type E stream ) { for (i = 0; i < PES_packet_length; i++) { PES_packet_data_byte } } else if ( stream_id = = padding_stream) { for (i = 0; i < PES_packet_length; i++) { padding_byte } } } 8

- 36-

Chng 2: Dng c s v dng c s ng gi

Cc gi PES ny c ghp knh vi nhau to ra dng truyn ti (Transport Stream) hoc dng chng trnh (Program Stream). Dng chng trnh (Program Stream) c thit k truyn i trong mi trng khng c tp nhiu v sai lm, v d nh trong cc ng dng CD-ROM. Cn vi mi trng truyn dn, pht sng thc t lun c li, trong trng hp ny ta cn phi s dng dng truyn ti (Transport Stream).

D LIU VIDEO

M HO VIDEO

ES

NG GI

VIDEO PES

GHP KNH CHNG TRNH

DNG CHNG TRNH

AUDIO PES D LIU AUDIO M HO AUDIO VIDEO PES AUDIO PES VIDEO PES AUDIO PES ES NG GI GHP KNH DNG TRUYN TI

( PROGRAM STREAM )

DNG TRUYN TI ( TRANSPORT STREAM )

Hnh 2.10: S mch m ha MPEG

- 37-

Chng 3: Dng truyn ti

Chng 3: Dng truyn ti


3.1. Gii thiu chung v dng truyn ti: Mt chng trnh TV thng gm c thng tin v hnh nh, m thanh v cc d liu khc lin quan. Mc d mt dng truyn ti ch mang mt chng trnh n cng c cho php nhng mc ch chnh khi thit k dng truyn ti l ghp nhiu chng trnh truyn hnh vo mt dng truyn ti duy nht. Dng truyn ti c xy dng t nhng phn t c bn l cc gi c kch thc c nh l 188 bytes thun tin cho vic ghp knh v sa li. Nhng gi truyn ti l nh v c kch thc c nh, khc vi gi PES l nhng gi ln v c chiu di khc nhau .

Header

Payload

Header

Payload

Header

Payload

SYNC BYTE (8 BIT)

TRANSPORT ERROR INDICATOR (1 BIT)

START INDICATOR (1BIT)

TRANSPORT PRIORITY (1 BIT)

PID (13 BIT)

SCRAMBLING CONTROL (2 BIT)

ADAPTATION FIELD CONTROL (2 BIT)

CONTINUITY COUNTER (4 BIT)

ADAPTATION FIELD

PAYLOAD

ADAPTATION FIELD LENGHTH (1 BYTE)

DISCONTINUITY INDICATOR (1 BIT)

ELEM RANDOM STREAM ACCESS PRIORITY INDICATOR INDICATOR (1 BIT) (1 BIT)

5 FLAGS (5 BIT)

OPTIONAL FIELDS

STUFFING BYTES

PCR (48 BIT)

OPCR (48 BIT)

SPLICE COUNTDOWN (8 BIT)

TRANSPORT PRIVATE DATA (40 BIT)

ADAPTATION FIELD EXTENSION (40 BIT)

Hnh 3.1: Cu trc gi truyn ti

- 38-

Chng 3: Dng truyn ti

Gi truyn ti lun bt u bi phn tiu (header), phn cn li mang d liu gi l phn ti tin (payload). cho vic truyn ti c hiu qu th kch thc phn tiu thng l nh, nhng nhm thc hin mt s mc ch c bit th phn tiu c th c m rng. Khi y phn ti tin s c thu hp li m bo kch thc ca gi truyn ti vn l khng i. Phn tiu bt u bi byte ng b (syncbyte) c nhn bit bi b gii m. Trong dng truyn ti c th mang rt nhiu dng c s, mi dng c s s c mang mt m nhn dng 13-bit duy nht l PID (Packet Identification Code). Nh c m ny m b gii m c th nhn din tng gi truyn ti l ca dng c s tng ng no. Trong vic ghp knh c trng hp xy ra l ang c mt chui cc gi ca dng c s ny c truyn th li chuyn sang mt chui cc gi ca dng c s khc. V vy tr gip cho b gii m th trong phn tiu ca gi truyn ti c mt b m lin tc (continuity count). B m ny s tng ng vi mt gi tip theo ca mt dng c s c truyn i. T cch lm vic ca dng truyn ti cho thy: dng truyn ti khng m bo mt tc bit c nh cho mt dng c s, tng tc ca cc dng c s trong dng truyn ti s c hn ch khng vt qu gi tr ln nht, tc ca dng truyn ti s c gi khng i nh chn thm cc byte m hoc cc gi rng (null packet).
3.2. Chun ng h (clock references)

Dng truyn ti l s kt hp ca mt s cc chng trnh truyn hnh vi nhau, nhng chng trnh ny c ly t nhng ngun khc nhau. S l o tng nu cho rng tt c cc chng trnh ny ng b vi nhau, v th dng truyn ti phi c thit k cho cc chng trnh khng ng b. C ch tch cc chng trnh khng ng b trong dng truyn ti gi l chun ng h chng trnh PCR (Program Clock Reference). Vi dng chng trnh (program stream), th tt c cc chng trnh yu cu phi c ng b, do ch cn mt ng h b gii m. Trong trng hp ny c ch ng b gi l chun ng h h thng SCR (System Clock Reference).

- 39-

Chng 3: Dng truyn ti

Hnh 3.2 m t cch thc m h thng PCR/SCR lm vic. Mc tiu l ti to li ng h 27MHz b gii m ng b vi b m ha. Ti b m ha, ng h chun 27MHz c a n b m tin 48-bit. B hp knh dng truyn ti s ly mu theo chu k trng thi ca b m v t gi tr ny vo phn tiu ca gi truyn ti. chnh l gi tr PCR. B gii m ch chn nhng gi c PID ph hp vi chng trnh m n c yu cu gii m. T nhng gi ny, b gii m s tch ra gi tr PCR. Vi dng chng trnh th gi tr c chn vo phn tiu khng phi l PCR m l SCR.

Hnh 3.2: S dng tham chiu ng h chng trnh hoc tham chiu ng h h thng (PCR/SCR) ti to ng h b gii m

Gi tr PCR/SCR c dng iu khin vng kha s NLL (numerically locked loop). NLL c cha mt b 27 MHz VCXO (voltage controlled crystal oscillator). B VCXO ny iu khin mt b m 48-bit ging nh b m ha. Gi tr ca b m ny c so snh vi gi tr ca PCR/SCR, s sai khc ny c s dng iu chnh tn s

- 40-

Chng 3: Dng truyn ti

ca b VCXO. Sau mt thi gian iu chnh, gi tr ca b m s trng vi gi tr PCR/SCR, khi b VCXO s c gi c nh khng thay i na. Trn thc t th do nh hng ca knh truyn m vn c s sai pha trong vng lp. Li ny c loi b bi b lc vng (loop filter) lm cho b VCXO vn lm vic hiu qu vi li pha. 3.3. Gii m dng truyn ti.
PAT (PID = 0) Program 0 Program 1 Program 2 . . 18 35 50 NIT (PID = 18)

Stream 1 Stream 2 Stream 3 Stream 4 Stream 5 Stream 6 PMT 1 PID = 35

V A A A A D

51 53 54 56 60 65

Stream 1 Stream 2 Stream 3 Stream 4 PMT 2 PID = 50

V A A D

17 36 38 41

PAT - Program Association Table CAT - Conditional Access Table NIT - Network Information Table Null packets PID = 8191

Hnh 3.3:Cu trc bng xc nh chng trnh PSI

Trong dng truyn ti c rt nhiu dng c s ca nhiu chng trnh khc nhau. Mi dng c s u c mt gi tr PID khc nhau. Nhng b gii m phi c cho bit dng c s video no kt hp vi dng c s audio no th mi c th gii m c.

- 41-

Chng 3: Dng truyn ti

Nhim v ny l ca PSI (Program Specific Information). Hnh 3.3 ch ra cu trc ca PSI. Khi b gii m c khi ng, n hon ton khng bit g v dng truyn ti sp phi gii m. Vic u tin l n nhn cc gi c PID = 0. Nhng gi ny mang thng tin v bng lin kt chng trnh PAT (Program Association Table). PAT c truyn i nhng thi khong xc nh, n mang thng tin v tt c cc chng trnh c trong dng truyn ti. Cc chng trnh th c m t chi tit hn bi bng bn chng trnh PMT (Program Map Table). Nhng gi tr PID ca PMT c mang trong bng lin kt chng trnh PAT. Hnh trn cng ch ra rng PMT cho php xc nh y mt chng trnh. Trong cha ng PID ca cc dng c s video, audio v d liu tng ng ca mt chng trnh. Do , khi ngi dng chn mt knh chng trnh no th u tin my thu s tm ra PMT ca chng trnh . T tch ra cc gi ca dng c s tng ng a i gii m. Chng trnh s 0 mang thng tin v mng NIT (Network Information Table). N mang thng tin v cc dng truyn ti khc ang hin hu. V d nh trong qung b v tinh, bng thng tin mng NIT s mang thng tin v v tr qu o, s phn cc, tn s sng mang, v phng thc iu ch. S dng bng NIT, my thu c th chuyn i t ng gia cc dng truyn ti. Nhng gi c PID bng 1 c dng mang thng tin v bng truy cp c iu kin CAT (Conditional Access Table). y l c ch iu khin truy cp h tr cho nhng dch v m cn tr ph th mi c th gii m c chng trnh.

- 42-

Chng 3: Dng truyn ti

3.4. Phn tch c php dng truyn ti Bng 3.1 : Dng truyn ti C php
MPEG_transport_stream() { do { transport_packet() } while (nextbits() = = sync_byte) }

S bit

Bng 3.2: Cu trc gi truyn ti C php


transport_packet(){ sync_byte transport_error_indicator payload_unit_start_indicator transport_priority PID transport_scrambling_control adaptation_field_control continuity_counter if(adaptation_field_control = = '10' || adaptation_field_control = = '11'){ adaptation_field() } if(adaptation_field_control = = '01' || adaptation_field_control = = '11') { for (i = 0; i < N ; i++){ data_byte } } }

S bit

8 1 1 1 13 2 2 4

Phn header c di ti thiu l 4 bytes v cha nhng thng tin sau:

- 43-

Chng 3: Dng truyn ti 1. Byte ng b (Sync Byte): byte ny c nhn bit bi b gii m. Byte ny c c

nh gi tr l 0x47.
2. Ch th li truyn ti (Transport Error Indication) : C di 1bit .Ch th ny thng

bo khi t l li bt BER vt qu gi tr cho php. Khi gi tr ny c t l 1 n ch th rng c t nht 1 li khng th sa c trong gi truyn ti, v s khng th t li thnh gi tr 0 chng no m cc li cha c sa ht.
3. Ch th bt u n v d liu (Payload Unit Start Indicator): trng c 1 bit mang

thng tin v gi PES hoc d liu PSI trong gi truyn ti. Khi m phn ti tin ca gi truyn ti mang d liu ca cc gi PES th bt ny c ngha nh sau: bit c gi tr 1 nu phn payload ca gi truyn ti ny cha byte u tin ca gi PES, c gi tr 0 nu khng phi nh vy. Khi m phn ti tin ca gi truyn ti mang d liu PSI th bit ny c t l 1 nu gi ny c cha byte u tin ca PSI, nu khng phi vy th bit ny s c gi tr 0. Khi y l gi trng (null packet) th bit ny c t l 0
4. u tin truyn ti (Transport Priority): Khi c t l 1, bit ny ch th rng gi

ny c u tin cao hn cc gi khc c cng PID m bit ny c gi tr 0. C ch ny cho php xc lp mc u tin ca d liu trong bn thn mt dng c s. Ph thuc tng ng dng m trng ny c th c m ha theo cch khng cn quan tm n cc PID hay l ch xt trong 1 PID duy nht. Trng ny th c th b thay i bi b m ha hoc gii m ca ty tng knh truyn.
5. Nhn dng gi (Packet Identification - PID): trng 13-bit ch ra loi d liu cha

trong phn ti tin. Sau y l bng cc gi tr PID

Gi tr 0x0000

M t Bng lin kt chng trnh(Program Association Table)

- 44-

Chng 3: Dng truyn ti

0x0001 0x0002 0x0003 0x000F 0x00010 0x1FFE 0x1FFF

Bng truy nhp c iu kin (Conditional Access Table) Transport Stream Description Table D phng C th c gn cho network_PID, Program_map_PID, elementary_PID hoc cc mc ch khc. Gi rng (Null packet)

6. iu khin o m truyn ti (Transport Scrambling Control): trng 2-bit ch ra kiu

xo trn d liu trong ti tin ca gi truyn ti. Phn tiu (header) v phn thch nghi (adaptation field) trn thc t khng c xo trn. Trong trng hp gi rng gi tr ca trng ny c t l 00. Sau y l bng gi tr ca trng ny: Gi tr 00 01 10 11 M t Khng xo trn D phng B xo trn bi kha chn B xo trn bi kha l

7. iu khin trng thch nghi (Adaptation Field Control): cho bit thng tin v trng

thch nghi (Adaptation Field): Gi tr 00 01 10 11 M t D phng Khng c trng thch nghi, ch c payload Ch c trng thch nghi, khng c payload C trng thch nghi, sau l payload

8. B m lin tc (Continuity Counter): y l b m 4-bit, m cc gi c cng PID.

Khi t gi tr ln nht (0xF) th s quay v 0. B m ny s khng thc hin m nu gi tr ca Adaptation Field Control l 00 hoc 10. Trong dng truyn ti, mt gi c th c gi thnh hai ln. Trong gi th hai l bn sao ca gi th nht (duplicate packet). Trong trng hp ny th gi tr ca b m lin tc s khng tng. Hai gi ny s c cc byte tng ng ging nhau y ht tr gi tr

- 45-

Chng 3: Dng truyn ti

ca trng chun ng h chng trnh (program clock reference) nu c th s c thay bng gi tr thch hp. Gi tr ny c tng ln 1 n v so vi gi tr trong gi truyn ti trc m c cng gi tr PID, hoc khng tng trong trng hp trng Adaptation Field Control c gi tr l 00 hoc 10 nh m t trn. B m ny c th b gin on nu gi tr ca trng ch th bt lin tc (discontinuity indicator) c t l 1. Trong trng hp gi rng, gi tr ca Continuity Counter cha c nh ngha.
9. Byte d liu (data byte): y l nhng byte mang d liu ca cc gi PES, thng tin

ca PSI, ca cc byte d liu ring (private data) hoc cc byte m. Trong trng hp gi rng (gi c PID bng 0x1FFF) th byte d liu c th mang bt k gi tr no. S byte d liu N bng 184 tr i s byte ca trng thch nghi c m t ngay sau y.
10. Trng thch nghi (Adaptation Field): gm c:

- 46-

Chng 3: Dng truyn ti

Bng 3.3: Trng thch nghi C php


adaptation_field() { adaptation_field_length if (adaptation_field_length > 0) { discontinuity_indicator random_access_indicator elementary_stream_priority_indicator PCR_flag OPCR_flag splicing_point_flag transport_private_data_flag adaptation_field_extension_flag if (PCR_flag = = '1') { program_clock_reference_base reserved program_clock_reference_extension } if (OPCR_flag = = '1') { original_program_clock_reference_base reserved original_program_clock_reference_extension } if (splicing_point_flag = = '1') { splice_countdown } if (transport_private_data_flag = = '1') { transport_private_data_length for (i = 0; i < transport_private_data_length; i++) { private_data_byte } }

S bit

8 1 1 1 1 1 1 1 1 33 6 9

33 6 9

8 8

- 47-

Chng 3: Dng truyn ti if (adaptation_field_extension_flag = = '1') { adaptation_field_extension_length ltw_flag piecewise_rate_flag seamless_splice_flag reserved if (ltw_flag = = '1') { ltw_valid_flag ltw_offset } if (piecewise_rate_flag = = '1') { reserved piecewise_rate } if (seamless_splice_flag = = '1') { splice_type DTS_next_AU[32..30] marker_bit DTS_next_AU[29..15] marker_bit DTS_next_AU[14..0] marker_bit } for (i = 0; i < N; i++) { reserved } } for (i = 0; i < N; i++) { stuffing_byte } } } 8 1 1 1 5 1 15

2 22

4 3 1 15 1 15 1

- 48-

Chng 3: Dng truyn ti 10.1.

di trng thch nghi (Adaptation Field Length): trng 8-bit ch th c bao nhiu byte trong trng thch nghi i ngay sau trng ny. Gi tr di trng thch nghi bng 0 c ngha l chn thm 1 byte m vo gi truyn ti. Khi gi tr ca trng iu khin trng thch nghi (Adaptation Field Control) l 11, c ngha l trong gi truyn ti c c trng thch nghi v c c phn ti tin, th gi tr ca trng ny s trong khong 0-182. Khi gi tr ca Adaptation Field Control l 10, ngha l trong gi truyn ti ch c trng thch nghi khng c phn ti tin,gi tr ca trng ny s l 183. Khi m dng truyn ti mang gi PES th vic chn byte m l cn thit khi m kch thc ca phn gi PES cn gi i khng lm y mt gi truyn ti vn c nh sn l c kch thc c nh. Trng hp ny s c gii quyt bng cch t gi tr ca trng di trng thch nghi nhiu hn phn d liu m thc s n c sao cho phn cn li va cha d liu ca gi PES. Phn d ra trong trng thch nghi s c t vo bng cc byte m (stuffing byte).Phng php ny cho php dng truyn ti c th vn chuyn cc gi PES c di thay i. Ch th khng lin tc (Discontinuity Indicator): trng 1 bit ch th s khng lin tc ca gi truyn ti hin ti. C gi tr 1 nu m khng lin tc. Ch th ny cho bit hoc l ng h chun (system time-base) hoc b m lin tc (Continuity Counter) khng lin tc. Ch th truy cp ngu nhin (Random Access Indicator): trng 1-bit ch th rng gi truyn ti hin ti, hoc c th cc gi sau na m c cng PID, c cha d liu vi chc nng nh mt im truy cp ngu nhin. Chnh xc l khi trng ny c t l 1 th gi PES tip theo c mang trong gi truyn ti c cng ch s PID hin ti s cha byte u tin ca tiu chui video (trong trng hp dng c s l dng c s video) hoc s cha byte u tin ca mt khung audio (trong trng hp dng c s l audio). ng thi trong gi PES cng s mang nhn thi gian trnh din PTS ca d liu tng ng. Ch th u tin dng c s (Elementary Stream Priority Indicator): Ch th mc u tin ca dng d

10.2.

10.3.

10.4.

- 49-

Chng 3: Dng truyn ti

liu. Gi tr 1 ch th gi c mc u tin cao hn gi c gi tr 0. Trong trng hp gi truyn ti mang d liu hnh nh th trng ny ch c t l 1 nu gi truyn ti ny mang thng tin ca nh I (intra-coded picture). 10.5. gm:
10.5.1.

Cc trng c bao

PCR-flag: c 1-bit. Gi tr l 1 cho bit c s c mt ca chun ng h chng trnh (Program Clock Reference). 10.5.2. OPCR-flag: c 1-bit. Gi tr l 1 cho bit s c mt ca ng h chng trnh gc (Original Program Clock Reference). 10.5.3. Splicing Point Flag: C hiu im ghp ni di 1bit, ch ra s c mt ca trng m ngc im ghp ni (Splice Countdown). 10.5.4. Transport Private Data Flag: c 1 bit. C gi tr 1 nu trong trng thch nghi c cha mt hoc nhiu hn mt byte d liu c nhn (private data byte), c gi tr 0 nu khng cha byte no. 10.5.5. Adaptation Field Extension Flag: c 1bit ch s c mt ca phn m rng ca trng thch nghi. C gi tr 1 nu c phn m rng ny, c gi tr 0 nu khng c.
10.6.

Trng

ty

chn

(Optional Field): Bao gm: 10.6.1. PCR (Program Clock Reference): c 48-bit. y l chun ng h chng trnh c dng ng b qu trnh gii m h thng. Trng ny c th c sa i trong qu trnh truyn (PCR c truyn ti thiu 1 ln/100 ms). Trng ny c m ha thnh 2 phn. Phn th nht l trng 33-bit program clock reference base. Phn th hai l trng 9-bit program clock reference extension. Cc trng ny c gi tr tnh theo cng thc sau: PCR(i) = PCR_base(i) 300 + PCR_ext(i) PCR_base(i) = ((system_clock_ frequency t(i)) DIV 300) % 233 PCR_ext(i) = ((system_clock_ frequency t(i)) DIV 1) % 300 Trong : t(i) l thi gian byte th i ca dng truyn ti ti b gii m. DIV l php chia lm trn v hng m v cng. % l ton t ly phn d

- 50-

Chng 3: Dng truyn ti

6-bit cn li ca trng ny c dng d phng. 10.6.2. OPRC (Original Program Clock Reference): c 48-bit. y l chun ng h chng trnh gc, khng c sa i trong qu trnh truyn, ch c th s dng ghi v pht li chng trnh n. Trng ny cng c m ha thnh 2 phn tng ng vi trng PCR. N cng gm c phn c s (original program clock reference base) v phn m rng (original program clock reference extension). S c mt ca trng ny c quyt nh bi c OPCR (OPCR flag). Trng ny ch c m ha nhng gi truyn ti m c mt ca trng PCR. Trng ny c cho php c dng truyn ti n chng trnh v a chng trnh. Trng OPCR gip cho vic ti to li mt dng truyn ti n chng trnh t mt dng truyn ti khc. Khi ti to li mt chng trnh n, trng OPCR c th c sao chp thnh trng PCR. Ch khi no ton b mt dng truyn ti n chng trnh c ti to li hon chnh th gi tr PCR ny mi c coi l hp l. Trong trng hp c t nht mt gi PSI hoc gi d liu c nhn (private data packets) no trong dng chng trnh n gc ny th c th s cn mt s sp xp no khc na mang tnh c nhn. iu ny cng c ngha l trng OPCR phi l mt bn sao nguyn gc ca trng PCR trong dng truyn ti n chng trnh tng ng. Trng OPRC c tnh theo cng thc sau: OPCR(i) = OPCR_base(i) 300 + OPCR_ext(i) trong : OPCR_base(i) = ((system_clock_ frequency t(i)) DIV 300) % 2 33 OPCR_ext(i) = ((system_clock_ frequency t(i)) DIV 1) % 300 t(i) l thi gian byte th i ca dng truyn ti ti b gii m. DIV l php chia lm trn v hng m v cng. % l ton t ly phn d Trng OPCR s c b qua ti b gii m. V trng ny th khng th b thay i bi bt k b ghp knh hoc b gii m no. 10.6.3. Trng m li im ghp ni (Splice Countdown): chim 8-bit. Trng ny ch th s gi truyn ti (TS Packet) cn li cho n khi gp im ni (Splice Point).

- 51-

Chng 3: Dng truyn ti

y l trng 8-bit m t mt gi tr c th l dng hoc m. Mt gi tr dng s mang ngha l cn bao nhiu gi truyn ti na (m c cng ch s PID) th s ti im ni (splicing point). Nhng gi truyn ti kiu bn sao (duplicate packet) hoc gi truyn ti m ch cha trng ty chn s b loi tr. im ni c nh v ngay ti v tr sau byte cui cng ca gi truyn ti m c gi tr trng ny bng 0. Byte cui cng trong phn payload ca gi truyn ti ny s cha byte cui cng ca mt khung audio hoc mt hnh c m ha. Nhng gi truyn ti c cng ch s PID sau c th cha ng d liu t mt dng c s khc cng loi. Phn payload ca gi truyn ti tip theo m c cng PID s bt u bng byte u tin ca mt gi c s ng gi (PES packet). Trong trng hp d liu m thanh, phn payload ca gi PES s bt u bng mt im truy cp (an access point). Trong trng hp d liu hnh nh, phn payload ca gi PES s bt u bng mt im truy cp, hoc mt m kt thc chui (sequence end code) theo sau l mt im truy cp. Sau im ni c th vn cn trng m li im ghp ni. Khi y gi tr ca trng ny l mt gi tr m n n ch ra rng gi truyn ti ny l gi th n sau im ni. im truy cp c nh ngha nh sau: Vi d liu hnh: l byte u tin ca tiu chui hnh nh (video sequence header). Vi d liu m thanh: l byte u tin ca khung m thanh (audio frame). 10.6.4. Trng d liu ring truyn ti (Transport Private Data) : chim 5 byte. Byte d liu c nhn (Private data byte): nhng byte ny khng c nh trc bi ITU-T | ISO/IEC m thay i ty theo ngi dng. Chiu di d liu c nhn (transport private data length): trng 8 bit, ch ra s byte d liu c nhn i ngay sau trng ny. 10.6.5. M rng trng thch nghi (Adaptation Field Extention): chim 5 byte. 10.6.5.1. Chiu di m rng trng thch nghi (adaptation field extension length): trng 8-bit. Ch ra s byte ca trng thch nghi m rng i sau trng ny (bao gm c nhng byte d phng nu c). 10.6.5.2. ltw_flag (legal time window_flag): trng c 1 bit. Khi c t gi tr 1 th c ngha l c mt ca trng ltw_offset

- 52-

Chng 3: Dng truyn ti 10.6.5.3. piecewise_rate_flag: c 1 bit, th hin s c mt hay khng ca

trng piecewise_rate. 10.6.5.4. seamless splice flag: c 1 bit. Khi c ny c t gi tr 1 th s c cc trng splice_type v DTS_next_AU. Nu gi tr ca c ny l 0 th c hai trng trn u khng c. Trng ny khng th c t l 1 trong nhng gi truyn ti m c splicing point flag khng c t l 1. Khi m c ny c t l 1 trong mt gi truyn ti m c ch s splice countdown l s dng, th cc gi truyn ti tip theo c cng PID cng s c gi tr c ny l 1, cho ti khi no m gi truyn ti c ch s splice countdown li v n 0 (bao gm c gi truyn ti hin ti). Khi c ny c t, nu dng c s trong l dng d liu m thanh, th trng splice type s c t l 0000. Nu dng c s trong cha d liu hnh nh th n phi tha mn nhng iu kin t ra ty theo gi tr ca trng splice type 10.6.5.5. ltw_valid_flag (legal time window_valid_flag): trng 1 bit. Khi c t l 1 c ngha l gi tr ca ltw_offset l hp l. Cn nu l 0 c ngha l gi tr ca trng ltw_offset khng xc nh. 10.6.5.6. ltw_offset (legal time window offset): ca s thi gian hp l, trng 15-bit. Gi tr ca trng ny ch c xc nh khi gi tr ca c ltw_valid c t l 1. n v ca trng ny l 300/fs giy. Trong fs l tn s ng h h thng. Gi tr ca trng c tnh theo cng thc sau: offset = t1(i) t(i) ltw_offset = offset//1 trong i l ch s ca byte u tin ca gi truyn ti, offset l gi tr c m ha trng ny, t(i) l thi gian n ca byte i b gii m (T-STD Transport Stream System Target Decoder), t1(i) l gii hn trn ca khong thi gian ca ca s thi gian hp l tng ng vi gi truyn ti ny. 10.6.5.7. piecewise rate: trng 22-bit. Gi tr ca trng ny ch c ngha khi m c 2 c ltw_flag v ltw_valid_flag c t ln 1. Khi y, gi tr ny l mt s ngyn dng ch ra mt t l bit gi thit l R c s dng nh ngha ca s thi gian hp l ca nhng gi truyn ti,c cng ch s PID, i sau gi ny nhng li khng c trng legal time window offset. Gi thit byte u tin ca gi truyn ti ny v N gi tip theo c cng PID, c cc ch s tng ng l Ai, Ai + 1, ..., Ai + N. N gi tip sau ny khng c gi tr c

- 53-

Chng 3: Dng truyn ti

m ha trong trng legal time window offset. Khi gi tr ca t1(Ai + j) c tnh theo cng thc sau: t1(Ai + j) = t1(Ai) + j 188 8-bits/byte /R vi j trong khong t 1 n N. Tt c cc gi nm gia gi ny v gi tip theo c cng PID m c cha trng legal time window offset s c x l nu n c gi tr : offset = t1(Ai) t(Ai) Gi tr ca trng ny s khng c xc nh trong nhng gi truyn ti m khng c trng legal time window offset. 10.6.5.8. Loi im ghp ni (splice type) : trng 4-bit. Trong tt c cc gi truyn ti, c cng PID, m gi tr ca trng splice countdown gim dn t gi tr ln nht v 0, th trng loi im ghp ni s c cng gi tr. Nu dng c s trong l m thanh th trng ny c gi tr 0000. Nu dng c s trong l dng d liu hnh nh th gi tr ca trng ny s ch ra cc iu kin cn phi tn trng khi thc hin im ni. Nhng iu kin ny c ch ra trong cc bng t 3.4.1 n 3.4.14. 10.6.5.9. Nhn thi gian gii m n v truy cp k tip DTS_next_AU (decoding time stamp next access unit): trng 33-bit, m ha thnh 3 phn. Trong trng hp gii m lin tc v theo chu k th trng ny ch ra thi gian gii m ca n v truy cp ngay sau im ni. Thi gian gii m ny c m t trong c s thi gian hp l trong gi truyn ti c gi tr splice countdown l 0. Trng ny s gi nguyn gi tr trong cc gi truyn ti, c cng PID, tip theo cho ti khi gi tr ca trng splice countdown gim ti 0.
10.7.

Cc byte m (Stuffing Bytes): Mi byte c gi tr c nh l 0xFF, c chn thm vo bi b m ha v cc byte ny s c b qua ti b gii m.

- 54-

Chng 3: Dng truyn ti

Bng 3.4.1 Splice parameters Table 1 Simple Profile Main Level, Main Profile Main Level, SNR Profile Main Level (both layers), Spatial Profile High-1440 Level (base layer), High Profile Main Level (middle base layers), Multi-view Profile Main Level (base layer) Video
Splice type 0000 0001 0010 0011 0100 1011 1100-1111 iu kin splice_decoding_delay = 120 ms; max_splice_rate = 15.0 106 bit/s splice_decoding_delay = 150 ms; max_splice_rate = 12.0 106 bit/s splice_decoding_delay = 225 ms; max_splice_rate = 8.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 7.2 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.2 Splice parameters Table 2 Main Profile Low Level, SNR Profile Low Level (both layers), High Profile Main Level (base layer), Multi-view Profile Low Level (base layer) Video
Splice type 0000 0001 0010 0011 0100 1011 1100-1111 iu kin splice_decoding_delay = 115 ms; max_splice_rate = 4.0 106 bit/s splice_decoding_delay = 155 ms; max_splice_rate = 3.0 106 bit/s splice_decoding_delay = 230 ms; max_splice_rate = 2.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 1.8 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.3 Splice parameters Table 3 Main Profile High-1440 Level, Spatial Profile High-1440 Level (all layers), High Profile High-1440 Level (middle base layers), Multi-view Profile High-1440 Level (base layer) Video
Splice type 0000 0001 0010 iu kin splice_decoding_delay = 120 ms; max_splice_rate = 60.0 106 bit/s splice_decoding_delay = 160 ms; max_splice_rate = 45.0 106 bit/s splice_decoding_delay = 240 ms; max_splice_rate = 30.0 106 bit/s

- 55-

Chng 3: Dng truyn ti 0011 0100 1011 1100-1111 splice_decoding_delay = 250 ms; max_splice_rate = 28.5 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.4 Splice parameters Table 4 Main Profile High Level, High Profile High-1440 Level (all layers), High Profile High Level (middle base layers), Multi-view Profile High Level (base layer) Video
Splice type 0000 0001 0010 0011 0100 1011 1100-1111 iu kin splice_decoding_delay = 120 ms; max_splice_rate = 80.0 106 bit/s splice_decoding_delay = 160 ms; max_splice_rate = 60.0 106 bit/s splice_decoding_delay = 240 ms; max_splice_rate = 40.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 38.0 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.5 Splice parameters Table 5 SNR Profile Low Level (base layer) Video
Splice type 0000 0001 0010 0011 1011 1100-1111 iu kin splice_decoding_delay = 115 ms; max_splice_rate = 3.0 106 bit/s splice_decoding_delay = 175 ms; max_splice_rate = 2.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 1.4 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.6 Splice parameters Table 6 SNR Profile Main Level (base layer) Video
Splice type 0000 0001 0010 0011 iu kin splice_decoding_delay = 115 ms; max_splice_rate = 10.0 106 bit/s splice_decoding_delay = 145 ms; max_splice_rate = 8.0 106 bit/s splice_decoding_delay = 235 ms; max_splice_rate = 5.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 4.7 106 bit/s

- 56-

Chng 3: Dng truyn ti 0100 1011 1100-1111 D tr Ngi dng t nh ngha

Bng 3.4.7 Splice parameters Table 7 Spatial Profile High-1440 Level (middle base layers) Video
Splice type 0000 0001 0010 0011 0100 1011 1100-1111 iu kin splice_decoding_delay = 120 ms; max_splice_rate = 40.0 106 bit/s splice_decoding_delay = 160 ms; max_splice_rate = 30.0 106 bit/s splice_decoding_delay = 240 ms; max_splice_rate = 20.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 19.0 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.8 Splice parameters Table 8 High Profile Main Level (all layers), High Profile High-1440 Level (base layer) Video
Splice type 0000 0001 0010 0011 0100 1011 1100-1111 iu kin splice_decoding_delay = 120 ms; max_splice_rate = 20.0 106 bit/s splice_decoding_delay = 160 ms; max_splice_rate = 15.0 106 bit/s splice_decoding_delay = 240 ms; max_splice_rate = 10.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 9.5 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.9 Splice parameters Table 9 High Profile High Level (base layer), Multi-view Profile Main Level (both layers) Video
Splice type 0000 0001 0010 0011 1011 1100-1111 iu kin splice_decoding_delay = 120 ms; max_splice_rate = 25.0 106 bit/s splice_decoding_delay = 165 ms; max_splice_rate = 18.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 12.0 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.10 Splice parameters Table 10 High Profile High Level (all layers), Multi-view Profile High-1440 Level (both layers) Video

- 57-

Chng 3: Dng truyn ti

Splice type 0000 0001 0010 0011 0100 1011 1100-1111

iu kin splice_decoding_delay = 120 ms; max_splice_rate = 100.0 106 bit/s splice_decoding_delay = 160 ms; max_splice_rate = 75.0 106 bit/s splice_decoding_delay = 240 ms; max_splice_rate = 50.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 48.0 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.11 Splice parameters Table 11 4:2:2 Profile Main Level Video
Splice type 0000 0001 0010 0011 0100 0101 1011 1100-1111 iu kin splice_decoding_delay = 45 ms; max_splice_rate = 50.0 106 bit/s splice_decoding_delay = 90 ms; max_splice_rate = 50.0 106 bit/s splice_decoding_delay = 180 ms; max_splice_rate = 50.0 106 bit/s splice_decoding_delay = 225 ms; max_splice_rate = 40.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 36.0 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.12 Splice parameters Table 12 Multi-view Profile Low Level (both layers) Video
Splice type 0000 0001 0010 0011 0100 1011 1100-1111 iu kin splice_decoding_delay = 115 ms; max_splice_rate = 8.0 106 bit/s splice_decoding_delay = 155 ms; max_splice_rate = 6.0 106 bit/s splice_decoding_delay = 230 ms; max_splice_rate = 4.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 3.7 106 bit/s D tr Ngi dng t nh ngha

Bng 3.4.13 Splice parameters Table 13 Multi-view Profile High Level (both layers) Video
Splice type 0000 0001 0010 0011 iu kin splice_decoding_delay = 120 ms; max_splice_rate = 130.0 106 bit/s splice_decoding_delay = 150 ms; max_splice_rate = 104.0 106 bit/s splice_decoding_delay = 240 ms; max_splice_rate = 65.0 106 bit/s splice_decoding_delay = 250 ms; max_splice_rate = 62.4 106 bit/s

- 58-

Chng 3: Dng truyn ti 0100 1011 1100-1111 D tr Ngi dng t nh ngha

Bng 3.4.14 _ Splice parameters Table 14 4:2:2 Profile High Level Video
Splice type 0000 0001 0010 0011 0100 0101-1011 1100-1111 iu kin splice_decoding_delay = 45 ms; max_splice_rate = 300.0 106 bit/s splice_decoding_delay = 90 ms; max_splice_rate = 300.0 106 bit/s D tr splice_decoding_delay = 250 ms; max_splice_rate = 180.0 106 bit/s D tr Ngi dng t nh ngha

3.5.

c im dng truyn ti MPEG

Dng truyn ti MPEG c cu to t cc gi truyn ti di c nh, th hin nhng u im ni bt sau: Dung lng cp pht cho cc knh truyn c th thay i c: Cc gi TS vi di c nh to kh nng linh hot trong vic cp pht dung lng knh gia cc s liu video, audio, cng nh cc s liu ph. Nhng gi truyn ti ca cc dng c s khc nhau c th c nhn ra bi PID. Dung lng ton b ca knh cng c th c cp pht li khi phn phi s liu. Kh nng ny c th c ng dng phn phi cc kha m trong tng giy n ngi xem trong cc chng trnh truyn hnh c thu ph. Kh nng co gin: Mt knh truyn c di thng ln c th c khai thc ti a nh ghp nhiu nht c th cc dng c s ES vo knh truyn, hoc ghp thm dng c s mi vo mt b ghp knh th hai. Tnh cht ny c gi tr khi phn phi trn mng cng nh cung cp kh nng lin vn hnh. Ti mc truyn ti, kh nng lin vn hnh ca dng bit truyn hnh l mt c tnh quan trng ca h thng truyn hnh s. Kh nng lin vn hnh th hin hai im: (a) Dng truyn ti MPEG c th c truyn trn tt c cc h thng thng tin. (b) H thng truyn ti MPEG cng c th truyn cc dng bit c to ra bi cc h thng thng tin khc.

- 59-

Chng 3: Dng truyn ti

Kh nng m rng: Cu trc ca dng truyn ti cho php cung cp cc dch v mi trong tng lai m khng lm nh hng ti cu trc hin ti. Khi c nhu cu to ra mt loi dng c s mi, vic duy nht cn lm l cp pht thm mt ch s PID m khng h lm thay i cu trc phn cng ca thit b. Tnh tng thch vn c m bo. Cc thit b gii m hin ti vn c kh nng gii m cc gi c ch s PID bit v b qua cc gi c ch s PID mi. Kh nng ny c th c ng dng a vo cc dng thc 1000 dng qut lin tc hay 3D-HDTV bng cch gi thm s liu theo tn hiu c bn. Kh nng chng li v ng b: Cc gi TS c di khng i to nn tng cho vic kim sot li gy ra bi ng truyn v vic khi phc li ng b. Trong dng truyn ti, cc chng trnh khc nhau c th c sp t nhng v tr khc nhau v khng nht thit phi ng b vi nhau. Kt qu dng truyn ti cn phi c nhng h thng ng b ring bit cho mi chng trnh. Phng php ng b ny cn c gi l Program Clock Reference PCR. Thit b thu r tin: Cc gi TS c di khng i cng s cho php ch to b gii m h thng n gin, r tin. 3.6. Tnh linh hot ca dng truyn ti: Dng truyn ti MPEG rt linh hot th hin hai kha cnh sau: Cc chng trnh c nh ngha nh l bt k s kt hp no ca dng bt s cp. Mt dng bt s cp c th xut hin trong mt hoc nhiu chng trnh khc nhau. V d 2 dng bt video khc nhau c th kt hp vi 1 dng bit audio to ra 2 chng trnh khc nhau. Cc chng trnh cng c th sa i ph hp vi mt s yu cu c bit. V d cng mt chng trnh truyn hnh nhng phn m thanh c th l nhiu ngn ng khc nhau. Nhiu chng trnh khc nhau c th c ghp knh trong cng mt h thng truyn ti. Ti pha thu, tng chng trnh ring r c th c tch ra mt cch d dng.

- 60-

Chng 3: Dng truyn ti

Hnh 3.4: Ghp knh 2 chng trnh Vi nhng c im v tnh u vit ca dng truyn ti MPEG cho php c nhiu ng dng ca chun MPEG trong truyn hnh s. Chnh v vy cc thit b truyn hnh theo chun MPEG ang ngy cng tr nn ph bin, p ng c nhu cu hin ti cng nh s pht trin trong tng lai ca truyn hnh s.

- 61-

Trn Vn Hoan K49

Kha lun tt nghip

Kt lun
Yu cu quan trng nht ca vic nn d liu l loi b c cng nhiu d liu d tha cng tt, sao cho t c t l nn cao m cht lng suy gim khng ng k. Ngoi ra th vic vn chuyn d liu sau khi nn t ni pht ti ni thu l mt vic cng rt quan trng. Vi chun MPEG nhim v ny c thc hin bi dng truyn ti. D liu sau khi qua b nn, c gi l dng c s, s c ng gi thnh dng c s ng gi PES. Dng c s ng gi li c ng gi mt ln na cho ra dng truyn ti. Dng truyn ti MPEG c to nn t cc gi truyn ti c kch thc c nh l c s cho vic phn phi d liu an ton v chnh xc. ng thi cng nh c c im cu to nh trn m dng truyn ti ht sc mm do v linh hot, d dng trong vic ghp knh, tch knh cng nh cp pht dung lng. Dng truyn ti c chun ha gip cho vic ch to thit b tr nn d dng. Dng truyn ti c cu to va m bo tnh cht ch v an ton cho d liu c vn chuyn, li va m bo tnh m rng trong tng lai. y l mt yu cu thc t thng thy trong s pht trin ca cng ngh. Do khun kh ca lun vn v iu kin khch quan khng cho php nn em mi ch nghin cu trn l thuyt m cha c iu kin phn tch, o c mt dng truyn ti thc t. V l do nhng kin thc em trnh by trn khng trnh khi thiu st v hn ch, em rt mong nhn c s ch bo ca cc thy c v cc bn.

H Ni, 5/2008 Sinh vin: Trn Vn Hoan

- 62-

Trn Vn Hoan K49

Kha lun tt nghip

Ti liu tham kho:


Ting Anh [1] http://en.wikipedia.org/wiki/MPEG [2] http://en.wikipedia.org/wiki/MPEG_transport_stream#PAT [3] http://www.computermodules.com/DVB-ASI-MPEG-2-white-papers.shtml [4] http://www.chiariglione.org/mpeg/faq/mp2-sys/mp2-sys.htm#mp2-12 [5] http://chapters.scte.org/cascade/DVB%20Overview.ppt [6] http://www.mpeg.org/MPEG/splicing-FAQ.html [7] http://www.answers.com/MPEG?cat=technology [8] John Watkinson, The MPEG handbook. [9] John Watkinson, Convergence in Broadcast and Communications Media. [10] ISO/IEC 13818-1 Information technology Generic coding of moving pictures and associated audio information: Systems. Ting Vit [11] Ng Thi Tr, Truyn hnh s mt t, Nh xut bn Bu in 2005. [12] Hong Tin V c L, Truyn hnh s, Nh xut bn Khoa hc v k thut 2001.

- 63-