This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Several related VPFE questions

Anonymous
Anonymous

Hi All,

 

I would like to ask a group of related questions on VPFE:

First is an erratic behavior I observed with FLDSTAT bit of register SYN_MODE in VPFE.

According to the document SPRU977a, 643x VPFE User's Guide, page 126, table 58 "Sync and Mode Set Register (SYN_MODE) Field Descriptions", FLDSTAT serves as field indicator:

                             

                                 
Because in BT.656 mode field 0 and 1 comes alternatively in the stream, and it seems that according to the document, if we have an interrupt service routine being triggered by VD associated with the beginning of each field, we should be able to see the toggling between 0 and 1 every time we entering the interrupt service routine.

But in my experiment, in which I have made the ISR triggered by VDINT0 to be very short to avoid any possible complication due to nested ISR, although I do observe change in FLDSTAT, it is NOT regular. At most times it does NOT toggle as expected at new field (I watch SYN_MODE value in breakpoint within ISR), but could remain at either 1 or 0 for several fields before changing to another. For example, the observed pattern of FLDSTAT between consecutive fields could be like:

11110001111011101

                               

                               

This is recorded by reading and then saving the value of SYN_MODE to an entry in a global static integer array, incrementing the index at every ISR (triggered by VDINT0) by one.

ISR to record SYN_MODE said:

static int i=0;
static int field[50];

interrupt void my_isr()

 i++;
 field[i%50]= VPFE_CCDC_SYN_MODE; //VPFE_CCDC_SYN_MODE points to address 0x01C70408 in my 6437
}

It clearly does NOT look like a field indicator whose pattern of change should be

...1010101010...


I thought on whether it was because this my_isr() executes too fast, immediately following VD so that when my_isr() is reading SYN_MODE, SYN_MODE it has not yet been updated according to the ID of the new (current coming-in) field. To avoid this I tried to change the value VDINT0 delay after VD.

change in VPFE initialization said:

VPFE_CCDC_VDINT  = 0x00300030;    //made both VDINT0 and VDINT1 happen 48+1 (please see page 140, SPRU977a on why there is a "+1") lines after VD, which I think it quite long                               

But even with this fairly long delay, which is to provide enough time if the SYN_MODE.FLDSTAT bit do need time to update after VD, I still observe the same erratic FLDSTAT changing pattern as with very short (in fact 0) VPFE_CCDC_VDINT value.

Why does this happen? Did I miss anything in the setting or have made any mistake in reading SYN_MODE?

                     


My objective of reading FLDSTAT is to determine from which field the current interrupt is coming from. Digital cameras nowadays capture a whole frame once at a time and only split it to two fields to accommodate BT.656 standard which was intially designed for degital conversion of analog TV signals. Therefore, top (field 0) and bottom (field 1) fields needs to be combined to restore the original frame.

What exactly does VPFE work for BT.656 stream? VPFE has a SDOFST register which can be conveniently configured to do the de-interlacing, but what is its internal mechanism?

                       

                                 
( page 55, SPRU977a)


According to Figure 27. CCD Controller Output Formatter Block Diagram – YUV Modes, Line output is the last stage in the pipeline. Does VPFE

  1. has an internal buffer so that it first store field 0 and 1 and then do the de-interlacing all within itself, and only output the restored whole frame in one action (DMA-DDR2 burst) to DDR2?
  2. or does it output each field separately? If this is true
  3. 1)   Does it output each line separately?
    2)   Or does it has an internal buffer to store all lines within in a field first and then output them separetely?
    3)   I don't think in 2) outputting a whole field as an integral block directly to DDR2 is possible. This is due to the interlacing nature of BT.656 such that field 0 and 1 has one line's shift between corresponding lines, so any attempt to write a field as a whole block will overwrite most of the contents of another field.

 

              

               

I wish to have get an answer on these VPFE mechanism questions. There are still a few remaining questions:

                    

                                  
Although BT.656 has embedded FVH bits to as the field ID, how can we get it in VPFE? I have tried to read SYN_MODE.FLDSTAT which is only relevant register I could find in VPFE's document (SPRU977a), yet using it is not successful. If I am not able to determine after which field and ISR (triggered by VDINT0) is from, how do I know that the content in the the DDR2 memory output by VPFE is not a "mixed" frame with field 1 from the previous frame and field 0 from the current frame? In digital cameras these two fields are taken at different time and there could possibly be "interlacing artifact" due to the incorrect combination.

                              

from http://en.wikipedia.org/wiki/Interlace


It is therefore not only necessary, but imperative to know the field ID to determine the proper action in an ISR triggered by VDINT0. How can I know this?

And I also could not understand why VPFE provide both VDINT0 and VDINT1. For the same VD event (two VDs for a BT.656 frame), why two interrupts are needed?

                            

(SPRU977a, page 89)

In what aspects are these interrupts "different"?

 

 

Sincerely,
Zheng

  • 帅哥,你问juan的回复,怎么我收到邮件了……Reply时点错了吧
    问问题一点一点问要好一些,这么一大堆没有几个人会看的,嘿嘿

  • Anonymous
    0 Anonymous in reply to yanbin yue

    Dear Yanbin,

    I am very sorry for have mistakenly replied to your post. I will remove that.

    Sorry for the inconvenience:)

     

    Sincerely,

    Zheng

  • Dear Zheng,

    好像还是我收到的邮件,不用sorry,只不过,我觉得你没回对人,别耽误你问问题
    最好你再开个帖子,找个关键问题,写得少一点问,才有可能回你……嘿嘿
    没有人有时间看你长篇大论的……

     

    Regards

    Yanbin Yue

  • Yanbin,

    Everybody who has ever posted a reply on a particular thread is automatically subscribed to that thread; and all will receive an update when the thread is udpated.

    I agree with you, we do prefer more concise questions.

     

    Zheng,

    Sorry about keeping  you waiting, I am having someone looking into this thread.

     

    regards,

    Paul

  • Anonymous
    0 Anonymous in reply to Paul.Yin

    Dear Paul,

    That's great. I am checking its update almost every five minutes.

     

    Zheng

  • This is an update on the question.

    1. The erroneous FLDSTAT recording was due to an opposite CCDC.SYN_MODE.VDHDOUT direction setting. Please refer to the updated answer by the questioner to post Countless VDINT0 interrupts per second for clarification. When VDHDOUT is configured correctly, VDINT0 gives 60 interrupts for NTSC BT.656 stream as expected. The problem initially reported was due to a register configuration error rather than any problem of the hardware chip.

    2. For the second major question of this thread that whether CCDC two fields of a BT.656 frame separately or combined, I did an experiment and found that CCDC in fact do sends them separately. This is done by:

    1. In the ISR of VDINT0, read FLDSTAT.
    2. Depending on whether FLDSTAT is 0 or 1, change SDR_ADDR to address 1 or address 2 (two arbitrarily selected non-overlapping addresses)

    If we set VPBE's reading address to be either of the aforementioned address 1 or address 2, in both cases we will see only half (all the odd lines or all the even lines) of the alternating lines has valid output and another half of the alternating lines are black. We could conclude from this observation that CCDC do not combine fields before sending to DDR2 but actually sends them separately.

    3. For the third major question on FLDSTAT's use for field identification, please refer to the answer by Paul.Yin to another post FLDSTAT question. FLDSTAT serves this purpose well.

     

    Zheng

  • Dear Zheng:

    (1)We met one problem like yours,can you give us some suggestiona about how to implement application like CVBS input and output on EVM6437。

    (2)The problem we met is it is normal to display on S-video but abnormal to display on CVBS input。 Please see link below~

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/p/111680/395449.aspx#395449

    Best regards,

    Alan