Homebuilt digital video TBC/standards converter

Kapat
X
 
  • Filtre
  • Zaman
  • Gösterim
Clear All
yeni mesajlar
  • weberclas
    Junior Member
    • 16-02-2004
    • 22

    Homebuilt digital video TBC/standards converter




    This project is a timebase corrector/standards converter with the following features:
    • Two CVBS inputs and one Y/C (SVHS) input
    • CVBS, Y/C and RGB outputs available simultaneously
    • PAL BGHDIN, PAL M, NTSC M, NTSC-Japan, NTSC 4.43 and SECAM input standards supported
    • PAL/NTSC Comb filter for CVBS input
    • Control over all usual proc-amp adjustments; contrast, brightness, saturation and hue
    • Conversion of 60Hz NTSC to 50Hz PAL is possible. The 525->625 line conversion is done using line interpolation.
    • Effects: Freeze, Inverted video, Mirror image
    • Black burst and colorbars available
    • PAL, NTSC and SECAM output standards


    For years, I have wanted to design my own video processor/TBC, for copying VHS tapes, recording Laserdiscs or DVDs onto tape (for my own personal use, of course.), video editing etc. (For an introduction to what a TBC is, follow this link.) Input section

    A crucial point in the design is the input/decoder section, and the question of what ICs to use for decoding the input video to component digital video streams. When I first saw the datasheet for the Philips IC SAA7114H I was amazed by what was crammed into just one IC. This chip is basically an A/D converter that produces a digital data stream from an analog video input, but the additional features presents a veritable candy-land for anyone who has an interest in video technology! This IC accepts CVBS inputs, and does all filtering and decoding internally. It extracts sync and generates a line-locked 27 MHz master clock, H/V sync and clock gate signals. SAA7114H even provides real-time digital scaling of the video image. This will take care of the 525 <-> 625 line vertical scaling needed for PAL <-> NTSC conversion. (This is beginning to sound like a Philps ad. Maybe they should pay me...)


    There is a downside to everything - it turned out that it was next to impossible to order this IC on a hobbyist basis. The only companies that stocked the chip would only deliver a minimum quantity of around 500 pcs. A year has passed since I discovered the IC, and now I have finally found a company (in Sweden!) that stocks newer Philips ICs and could deliver two SAA7114H's to me. Thank you, RS components!

    Another problem (for a soldering iron-wielding hobbyist) is the IC package. The SAA7114H comes in a LQFP100 package. This has 100 leads on a plastic square measuring 14mm along each edge. Soldering this is not easy, but it can be done. Necessary equipment is a soldering iron tip filed to a sharp point, solder flux, and a magnifying glass.

    I have designed a PCB pattern for an adapter board that converts the IC to 2.54 mm pin spacing. Feel free to download the UV mask as a PS file here:

    SAA7114adapter.ps



    Frame memories

    The SAA7114H is configured to give a 16-bit 4:2:2 output stream, which is stored in the frame memories. These are Hitachi HM530281R's (20ns access time). These may be hard to get, as I believe that Hitachi has ceased production of RAMs. There should be substitutes for these, although I have not looked into what is available. The HM530281R comes in a plastic package with a 0.8 mm lead pitch. This is easy to solder when comparing to the above.


    Similarly to the above, here is an adapter board converting the memories to 2.54 mm pin spacing

    HM530281adapter.ps



    Output section

    The third important building block is the video encoder, which reads out the image from the memories and recreates a crystal-stable video signal. I have selected the Philips SAA7182A for this. This IC is slightly older, but has a 16-bit wide data input, which was desired here. This IC also has RGB output, which is available simultaneously with the CVBS and Y/C outputs. This means that a very sharp picture can be watched on a RGB monitor, at the same time as the CVBS signal is sent to a recording VCR.
    System control and user interface

    A microcontroller must be used for I2C programming of the registers in the SAA chips (of which there are a lot). I have used a PIC16F84 for this, which also is the heart of the user interface.


    The PIC is connected to a Seiko 2x16 character backlighted LCD display, and four pushbutton switches, which serves as the user interface. Menus and settings are shown in the display, controlled by the switches, marked (up), (<), (>), and (menu/select).

    I have realized that this microcontroller is on the small side for a project like this. The texts, data tables and code just barely fits in the 1024 word flash ROM of the PIC.

    Datasheets for the above ICs are easily found on the web. I have not linked them here since the URLs often change. The SAA's are 3.3V devices, but there are no problems with connecting them to the 5V memories. By the way - why are the 3.3V voltage regulators so darned expensive? I got mine for a price around 10 times that of a 7805! Set-up

    Here is the schematic of the TBC circuit. It is hand-drawn, but fits on an A4 page:





    This schematic shows the minimum circuit, for operation as a TBC for interlaced PAL->PAL or NTSC->NTSC. Of course, there are lots of extra functions that can be added, and I am leaving this up to you, in case you would lime to build something similar. In addition to the circuit shown, separate analog and digital 3.3V supplies are needed, as well as a 5V digital supply.

    My present design uses four memories, and thus provides a complete frame store, or an infinite TBC window. The SAA7114H has pins that can be configured to direct the data stream to the correct (odd or even) memories, but a 74LS74 IC has been added to the output side in order to decode the odd/even field ID and select which memory pair that is output enabled.

    The microcontroller holds tables of data that are written to the internal registers in the SAA devices via the I2C bus when the TBC is powered up. If there is interest, I will post those data tables here.

    When doing the NTSC-PAL conversion, this full frame store cannot be used directly, since the writing point in the memory catches up with the reading point every 1/6 seconds, losing 1/25s of video. This effect makes moving video unwatchable (although still images appear perfect). The system must then revert to the design shown above. This is easily done by software control, making the SAA7114H write to both memory pairs simultaneously. This makes the output section see a memory holding only one field.

    This leads to another problem when producing an interlaced PAL signal from NTSC: Since the NTSC video is written to the memory at a speed 6/5 times the read-out speed the ordering of the odd/even lines is inverted every 5 or 6 fields. In addition to the schematic shown above, some extra logic circuits are used together with the software to fix this. The logic analyzes the timing relationship between the input and output signal, and sends a signal to the microcontroller about the current field phase. If the encoder is about to output an even field which is actually an odd field at the input, it is converted by a vertical phase shift of 1/2 line. (The SAA7114H can do arbitrary vertical phase shifts of the picture, see the datasheet.) This technique looks great for most material, although some flickering can be noted on sharp vertical edges of some objects, such as subtitles. Anyway, it gives the best results that I have been able to produce, and is perfectly adequate for VHS as target media. It is still a bit experimental, and cannot be used the other way around, i.e from PAL to NTSC. To convert interlaced signals both ways, a more advanced converter should be constructed (See below).

    The freeze-frame function is enabled by a simple switch, which inhibits the WE pin of the memories. I have a toggle switch function on my TBC for this. In addition, there is a switch to control the output signal in freeze frame mode (interlace/odd/even). This is because freezing both fields with a moving picture can result in a flickering still frame. This function thus allows to switch between display of both fields, just the even field or just the odd field.

    There is also a 'lock' indicator LED on the front panel. This lights up if the decoder has managed to lock onto the input signal. I have set the conditions for 'lock' to mean a complete phase lock to H-sync, V-sync and color subcarrier.

    Most of the functions listed at the top are completely under software control. Of the effects, inverted video is produced by setting the contrast parameter to C0, and the Mirror image effect is produced by just setting one bit of the 7114 register set. Operation

    All important features are working fine. Watching broadcast TV through the TBC with RGB output results in a great picture, because of the comb filter. Copying a VHS tape to another VHS tape via the TBC results in a considerably better copy compared to the case of a simple cable between the VCRs. The colours in the copy are very stable, and if a good quality cassette is used, there is very little degradation in picture clarity. By the very nature of the design, disturbances such as macrovision copy protection are completely stripped from the video signal in the process. (A status byte can be read from the SAA7114H, which tells whether the input signal contains Macrovision pulses or not.) The picture quality after 525->625 conversion is good, being more or less on par with that of the Panasonic AG W-1 'world video'.


    I may be leaving some details out on this page, but if you are interested in in building a similar project, and manage to solder the SAA7114H, I am sure that you are experienced enough to sort out the rest for yourself, and also that you will want to give the circuit your own custom touch. Also, most of the information you need is in the data sheets for the chips. I do not have a documented source code for the software to put on this page, but the important thing about the software is the data tables that are written to the SAA chips on power-up, via the I2C bus.

    Here are the data tables needed to intitialize the TBC circuit to PAL->PAL mode, plus a short table to start the 525->625 conversion mode.

    Another thing that can help, should you want to build a circuit around a full frame store, is this PCB layout which accomodates four memory chips (using the above adapter boars), and has 16 bit wide input and output ports. Note!! however that this is an experimental single sided PCB that does not have all necessary connections included. Extra wires need to be soldered to the bottom side for the power supply lines and control pins. See the datasheet and you will se what is missing. There are connections reserved for termination resistors in case of problems with clock or sync signals. I did not need to use that in the end. There is also space reserved for the two logic circuits shown the schematic. Photos



    Here is a photo of the core set-up, taken at an earlier stage, with only a single field store (only the SAAs and memories are visible in this picture):



    When designing the circuit boards, I have made ground planes directly below all ICs (especially the SAA7114H). Many connections are done using wires soldered on the bottom side of the PCBs.

    Here is a close-up showing how the SAA7114H was mounted. If you want to build something using this IC, expect to use some 'creative' language when soldering by hand:



    The present design is housed in a neat 19'' 1HU box. See picture at the top. User interface features

    The user interface allows flipping through (using the (<) and (>) buttons) a number of parameters that are shown on the LCD display. These are: Brightness, saturation, hue, sharpness, comb filter (on/off), chroma trap(on/off) input standard, Y/C horizontal shift, mirror image (on/off), colourbars (on/off), output standard, top cutoff, bottom cutoff (adjustable masking of top and bottom edges) and 525->625 (on/off). Selecting one of the above topics displays its current setting (in hexadecimal notation : ) and the (<) and (>) buttons are then used to change the value.
    Yadda, yadda

    Before actually finishing this project, I cannot resist thinking about how a more advanced design could be done, regarding the NTSC -> PAL transcoding. Smooth movements of e.g. a car or rolling credits in the program material can sometimes appear slightly jerky when transcoded using the technique described here. This effect arises since every 6th field is dropped from the NTSC video (but it is rarely noticed.) One idea to do this better would be to use the four memories for complete storage of odd/even fields for NTSC, and replacing the encoder with the newer SAA7128, which includes fading between two separate video streams. Such a setup would make interpolation between video lines as well as between fields possible. This method would attain a conversion quality similar to what is seen used by some broadcast stations. Some clever software would be needed to continuously measure the timing relationships of the input and output, and update all relevant registers. That should be an interesting project. However, the SAA7128 is designed to accept the two separate video streams on the same 8-bit port - at 54 MHz! It certainly sounds tricky to get that working - two separate 16-bit inputs would have been nicer for my purposes. As of now, I do not know of a source for small quantities of this IC. RS doesn't have it.
  • exselans_pr
    Junior Member
    • 24-12-2006
    • 2

    #2
    Konu: Homebuilt digital video TBC/standards converter

    sayın hocam pcye format attım fakat ana kartımın driwerini yuklediğim halde direct sound output v2.2.8 hatasıı veriyor seste winampı actıgımız zaman hiç ses yok bilgisayar baslarken yada kapanırken dahi ses yok acil yardımlarınız beklıyorum

    Yorum

    İşlem Yapılıyor
    X