cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
leodev
Newbie
Newbie
7,711 Views
Registered: ‎11-03-2010

FPGA Spartan2 video decoder

I am interfacing a video camera to spartan 2 xess board Xst 4. I have read its manual and have understood all the internal pin connections but do not know how to use this video decoder feature of spartan 2. Please advice also that i also have a spartan 3e board also. Any help regarding any of the two boards will be very helpful.

0 Kudos
Reply
7 Replies
gszakacs
Professor
Professor
7,702 Views
Registered: ‎08-14-2007

So you read the XESS XST 4.0 manual and the TVP5150A data sheet?  The protocol for video

data from the chip to the FPGA can be very simple if you don't use the CCIR-656 encoding.  The

AVID signal (active video) acts like a data enable and you can use its timing to determine the

position in a frame.  You'll need an I2C bus master interface to write the internal registers

of the video decoder.  I think the manual contains a list of recommended register settings

for simple applications.  You can start with these settings, perhaps using a small memory

to hold the commands to set the register values.  That can simplify the setup process.  Then

you'll need to process the video pixels as they come in.

 

If you decide to use the CCIR-656 protocol, you'll need to decode the active video

from the data stream.  The document describing this protocol is available from

the ITU (but not free).  You might find some ready-made applications from the

board vendor.  Did you check their site?

-- Gabor
0 Kudos
Reply
eteam00
Instructor
Instructor
7,692 Views
Registered: ‎07-21-2009

Since I'm a digital video nerd, I'll add my two cents to Gabor's information...

 

CCIR-656 refers specifically to a physical layer and data coding protocol for standard definition, 8-bit or 10-bit 4:2:2 digital component video.  This CCIR document has morphed into ITU-R BT.656, its current form.  A very similar standard was developed by SMPTE, document SMPTE-125M.  Both SMPTE-125M and ITU-R BT.656 specify ECL signal levels.

 

You can buy either of these signal standards docs, but my guess is that a little digging around on the internet will yield the information you need without the expense.  These standards were first written about 20 years ago.

 

My active days in the professional broadcast video business are long behind me, but two reference books from this era - which include all the useful details of SMPTE-125M and ITU-R BT.656, and much much more - are still in print and available.  Since I'm familiar with these books, and I can recommend them from personal use, I'll list them here:

 

Video Demystified by Keith Jack (my copy is revision 3, current is revision 5, 944 pages)

The Art of Digital Video by John Watkinson (my copy is revision 1, current is revision 4, 688 pages)

 

You won't regret purchasing either book.  Digital video is a broad subject, and a proper understanding of the subject transcends bits and bytes.  Professional standards documents such as SMPTE-125M are intentionally written to be as narrow in scope as possible, so as to fit into an array of related specifications documents with as little overlap as possible.  They are full of references to other documents, and you don't get the "whole picture" until you have a complete set of documents.  The advantage of one of these books (above) is that they cover the entire subject well, more or less homogenously.

 

- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
Reply
leodev
Newbie
Newbie
7,556 Views
Registered: ‎11-03-2010

Thanks man for the reply but i cant download these books from the internet i don't know what he problem is, if you have these books could you please mail me these at

ahsankh05@gmail.com  or provide a link to these books.

        thanks again.

0 Kudos
Reply
leodev
Newbie
Newbie
7,554 Views
Registered: ‎11-03-2010

thanks mate for your suggestions i did find a link to the books and they are very helpful but i still can't understand the CCIR ^%^ protocol can you help me with some verilog code or examples.         Thanks.

0 Kudos
Reply
eteam00
Instructor
Instructor
7,549 Views
Registered: ‎07-21-2009

i still can't understand the CCIR ^%^ protocol can you help me with some verilog code or examples.

  • First you figure out what your design's needed  functions are
  • then you sit down and figure out how you will accomplish these functions
  • then break down the design into small functions or blocks
  • then you write code to implement each small function or block

If you hit some roadblacks related to FPGA design, these forums are often helpful, and the price is right.

 

If you have one or two specific questions on the CCIR format, I can try to help you.  Beyond that, you'll need to study and research on your own.  After all, this is a Xilinx FPGA design support forum, and CCIR tutorials are a bit far afield from Xilinx' forum mission.  We don't want to impose on Xilinx' hospitality.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
Reply
gszakacs
Professor
Professor
7,544 Views
Registered: ‎08-14-2007

I'm not sure if the 656 protocol itself is explained fully in the books.  I remember I had

to buy a copy of the standard from the ITU (it cost 50 swiss francs as I recall), but a

quick Google for itu-r bt.656 brought up this link to the document at Berkeley:

 

CCIR-656 Standard

 

If you still have problems understanding the protocol, you might want to use ChipScope

to look at the raw data coming from your TVP5150.  All of the codes use the 0xFF escape

character, so that's something you can trigger on.

 

HTH,

Gabor

-- Gabor
0 Kudos
Reply
eteam00
Instructor
Instructor
7,536 Views
Registered: ‎07-21-2009

I'm not sure if the 656 protocol itself is explained fully in the books.  I remember I had

to buy a copy of the standard from the ITU (it cost 50 swiss francs as I recall), but a

quick Google for itu-r bt.656 brought up this link to the document at Berkeley:

As I previously mentioned, ITU-R BT.656 defines connector pins, physical transport signal levels, and other physical transport layer details.  The important information - coding levels, H/V timing, sampling system, colour space, etc. - is in ITU-R BT.601.  Having said that, there is just enough information in 656 to design a digital decoder (it's pretty simple once you get the gist of it).

 

The bootleg  656 doc looks authentic - it matches my ITU-R docs.  I wonder if some legal rights agreement has been compromised, but that's not my problem.

All of the codes use the 0xFF escape character, so that's something you can trigger on.

Yes, EAV/SAV are the timing reference markers (End of Active Video and Start of Active Video).  Note that the EAV/SAV preamble is actually a 4 word sequence:  3FF, 000, 000, xy (10bit notation) or FF, 00, 00, xy (8bit notation).  In 10-bit interfaces it is polite and customary for the 2 LSBs to match the MSB, but in the interests of backwards compatibility with 8bit equipment the specification does not specify the 2 LSBs.

 

Most of what is left for the decoder is establishing data values for blanking, black, and peak white.  Also, the proper form for transcoding between YUV and RGB might be useful.  These are most certainly covered in the two digital video books I recommended.

 

- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
0 Kudos
Reply