Post Go back to editing

Video in bt.656 data stream is left shifted by 2 pixel

Category: Datasheet/Specs
Product Number: ADV7182A

Hello,

I am using ADV7182A with CVBS input to sample PAL video. I use the following configuration:

dec_write(state, 0x0f, 0x80); //Reset the decoder
usleep_range(5000, 10000);
dec_write(state, 0x0f, 0x00); //Exit power down mode
dec_write(state, 0x52, 0xCD); //SE_CVBS AFE IBIAS, ???, from AD example
dec_write(state, 0x00, 0x00); //CVBS in on AIN1
dec_write(state, 0x0E, 0x80); //ADI Required Write
dec_write(state, 0x9C, 0x00); //Reset Coarse Clamp Circuitry [step1]
dec_write(state, 0x9C, 0xFF); //Reset Coarse Clamp Circuitry [step2]
dec_write(state, 0x0E, 0x00); //Enter User Sub Map
dec_write(state, 0x17, 0x41); //Select SH1 chroma shaping filter
dec_write(state, 0x03, 0x0C); //Enable Pixel & Sync output drivers
dec_write(state, 0x04, 0x07); //Power-up INTRQ, HS & VS pads
dec_write(state, 0x13, 0x00); //Enable ADV7182 for 28.63636MHz crystal
dec_write(state, 0x1D, 0x40); //Enable LLC output driver

I am using a PAL generator with cross hatch pattern to generate small vertical white lines on a black background.

I capture the analog signal with an oscilloscope and note at which time during the horizontal line the pixel of the vertical white line begins.

When I look into the BT.656 data stream, the pixel of the vertical line is 2 to 3 pixel (luma samples) too early.

In my understanding, BT.601-7 clearly specifies the relationship between analog video timing and pixel position.

My question is:

Are there register settings which are influencing the video area in a BT.656 data stream?

Am I missing a configuration step to align analog video signal and BT.656 data stream?

Regards,

Torsten

  • Hi,

      Kindly note that, ADV7182 receives analog video and outputs digital video according to the ITU-R BT.656 specification. The ADV7182 outputs the ITU-R BT.656 video data stream over the P0 to P7 data pins and has a line locked clock (LLC) pin and two synchronization pins (HS and VS/FIELD/SFL).
      Video data is output over the P0 to P7 pins in YCrCb 4:2:2 format. Synchronization signals are automatically embedded in the video data signal in accordance with the ITU-R BT.656 specification.

      The LLC output is used to clock the output data on the P0 to P7 pins at a nominal frequency of 27MHz.

        Please refer Page61 at ADV7182 datasheet.

     Also try toggling the Polarity(0x37) register bit, see if the issue goes away .

    Thanks,

    Poornima

  • I have a FPGA connected to P0 to P7 and use LLC as clock signal. I decode the ITU-R BT.656 video data stream (hsync, vsync, field_id, data, ...) and generate an active_video signal when the video data stream contains valid video data. The video data (single frame) can be stored in memory.

    When I read the stored video frame from FPGA memory and compare with the video frame from the PAL (analog) video generator, I see a mismatch/shift of appr. 2 pixel.

    ADV7182A seems to skip the first two pixel in every video line.

    Is this a known behaviour or am I missing a configuration step?

    Could it be that the digital processing blocks in ADV7182A (luma filter, luma resample, luma 2D comb) introduce a shift depending on the setting of registers (see Fig. 12 of ADV7182A, Rev. 0)?

    Thanks,

    Torsten

  • Hi,

       Please let us know, Are you observing any image related issue with this pixel shift?

       Also it seems, You are comparing the analog video against digital frame.

       Could it be that the digital processing blocks in ADV7182A (luma filter, luma resample, luma 2D comb) introduce a shift depending on the setting of registers (see Fig. 12 of ADV7182A, Rev. 0) ?

          Please try to modify the filter related registers and check the shift.

          Modify some of the 2D comb filter registers in the ADV7182A and try reading the Chroma filter, Luma Filter, Chroma Transient Improvement, Digital Noise Reduction and Luma   Peaking Filter, and Comb filter sections of the ADV7182A datasheet. 

    Thanks,

    Poornima

  • Hi,

    there are no image related issues with this pixel shift.

    I modified digital processing registers. My observations are as follows:

    Addr. 0x17 (my setting is value 0x41): Value 0x58 will introduce an additional pixel shift

    Addr. 0x27 (my setting is value 0x58): Values 0x19, 0x1A slightly change the pixel shift (less than one pixel)

    I modified several more registers (addr: 0x18, 0x19, 0x2C, 0x2F, 0x39, 0x4D) which showed no influence on the pixel shift.

    I did not check all registers. I will compensate the pixel shift in the FPGA with the injection of black pixels at the start of every video line.

    My hope was that there is an additional ADI document (whitepaper, application note) which explains which register settings can have influence on the pixel shift.

    Thanks,

    Torsten

  • Hi,

      Please try setting the position control register like HSB, HSE and PHS.  These in turn will shift the Hsync in relation to the active video and hsync pulse.

     Kindly refer page 74 at ADV7182 (Rev. C)

    Thanks,

    Poornima

  • I do not use the synchronisation output signal HSYNC. I decode hsync, hblank, vsync, vblank, field ID and active video by decoding SAV and EAV sequence within the bt.656 data stream.

    Modifications of HSB and HSE do not change the the active video data.

  • Hi,

       Please try to navigate the pixel shift behavior is from ADV7182A or FPGA So configure the ADV7182A in free Run mode and check the output. If your output is shifted by 2 pixels after enabling free run, then it means the issue is with the ADV7182A or else the issue is with FPGA. 

    Thanks,

    Poornima

  • Hi,

    I activated freerun mode (address 0x0c, Bit 0 set to 1) and changed the pattern to boundary box (address 0x14, bits[2:0] set to "101")

    Inside the FPGA, I could clearly detect the pattern 80EB as the first and the last luma pixel in the bt.656 video data stream.

    I will compensate the pixel shift internally inside the FPGA. Maybe it has to do with my settings of ADV7182A. But I will not investigate this issue any further.

    Please close this thread.