www.ti.com
3.9CaptureLineBoundaryConditions
Y FIFO
Cb FIFO
Y 74 Y 76 YDEFY73 Y 75 Y 77 YDEF
VDOUT[9−2]
VCLKOUT
63 5655 48 47 4039 32
Y 5
Y 4
Y 7 Y 6
Y 69 Y 68
Y 71 Y 70
Y 77 Y 76
Cb 37 Cb 36
Cb 38
Little-Endian Packing
YDEF YDEFYDEF YDEF
Cb 36 Cb 37 Cb 38 CbDEFCr 36 Cr 37 Cr 38 CrDEF
VDOUT[19−12]
CbDEF CbDEFCrDEF CrDEF
Y 72
31 2423 1615 8 7 0
Y 1
Y 0Y 3 Y 2
Y 65 Y 64Y 67 Y 66
Y 73 Y 72Y 75 Y 74
31 2423 1615 8 7 0
Cb 33 Cb 32Cb 35 Cb 34
63 5655 48 47 4039 32
IPCOUNT = IMGHSIZE(78)
Cb 5 Cb 4
Cb 7 Cb 6
Cb 1 Cb 0Cb 3 Cb 2
Cr FIFO
Cr 37 Cr 36
Cr 38
31 2423 1615 8 7 0
Cr 33 Cr 32Cr 35 Cr 34
63 5655 48 47 4039 32
Cr 5 Cr 4
Cr 7 Cr 6
Cr 1 Cr 0Cr 3 Cr 2
Line n
Line n+1
Line n
Line n+1
Line n
Line n+1
3.10CapturingVideoinBT.656orY/CMode
CaptureLineBoundaryConditions
ThevideoportgeneratesaYEVTafterthespecifiednumberofnewsampleshasbeencapturedinthe
buffer.ThenumberofsamplesrequiredtogenerateYEVTisprogrammableandissetintheVCTHRLD1
bitsofVCATHRLD.VCTHRLD1shouldbesettothepacketsizeplus8bytesoftimestamp.Onevery
YEVT,theEDMAshouldmovedatafromthebuffertotheDSPmemory.Whenmovingdatafromthe
buffertotheDSPmemory,theEDMAshouldusethememoryaddressoftheYSRCAlocationasasource
address.
InordertosimplifyEDMAtransfers,FIFOdoublewordsmustnotcontaindatafrommorethanonecapture
line.ThismeansthataFIFOwritemustbeperformedwhenever8byteshavebeenreceivedorwhenthe
linecompletecondition(HCOUNT=VCXSTOP)occurs.Thus,everycapturedlinebeginsonadouble
wordboundaryandnon-doublewordlengthlinesarepaddedattheend.Anexampleisshownin
Figure3-20.
InFigure3-20(8-bitY/Cmode),thelinelengthisnotadoubleword.WhentheconditionHCOUNT=
VCXSTOPoccurs,theFIFOlocationiswritteneventhough8byteshavenotbeenreceived.Thenext
capturelinethenbeginsinthenextFIFOlocationatbyte0.Thisoperationextendstoallcapturemodes.
InthecaseofTCIandrawdatamodes,therearenolines.Inthesemodes,afinalwriteattheendofthe
packetmustbeperformedwhenthepacketdatacountequalsthe24-bitcombinedvalueofVCXCOUNT
andVCYCOUNT.
Figure3-20.CaptureLineBoundaryExample
InordertocapturevideointheBT.656orY/Cformat,thefollowingstepsareneeded:
1.TousethedesiredVideoPort,programthePinMuxregister(PINMUX)appropriatelytoensurethat
themultiplexedpinsworkasVideoPortPins.Refertothedevice-specificdatamanualfordetailsabout
PINMUXregister.
2.ProgramtheVPx_CTLregisterappropriatelytousethedesiredVideoPortasaCapturePort.
3.SetthePERENbitinthevideoportperipheralcontrolregister(PCR).
4.SetthelastpixeltobecapturedinVCxSTOP1andVCxSTOP2(settheVCXSTOPandVCYSTOP
bits).
5.SetthefirstpixeltobecapturedinVCxSTRT1andVCxSTRT2(settheVCXSTARTandVCYSTART
bits).
6.WritetoVCxTHRLDtosetthecapturethreshold.Thethresholdneedstobesetinunitsofdouble
word.Onedoublewordisequalto8bytes.Everytimethenumberofreceivedbytesreachesthe
SPRUEM1–May2007VideoCapturePort67
SubmitDocumentationFeedback