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.

Can we disable some DEI features to just merge two field

Dear Experts,

Our request is just to merge two field pictures to one frame picture.
But current DEI have many features such as:
a) Motion-adaptive deinterlacing
b) Edge-Directed Interpolation (EDI)
c) Film Mode Detection (FMD)
d) Bad Edit Detection (BED)

Can we disable these features to achieve "just merge two field pictures to one frame picture"
or How can we achieve this?

below are current DEI settings:

/* DEIH inpMode works better with VPS_DEIHQ_EDIMODE_EDI_LARGE_WINDOW. If it
is VPS_DEIHQ_EDIMODE_EDI_SMALL_WINDOW, the quality is not best but close
to DEI. Some people don't like different qualities from DEIH and DEI.
It's up to you which mode DEIH inpMode is set. */
pChObj->deiHqCfg.inpMode = VPS_DEIHQ_EDIMODE_EDI_SMALL_WINDOW;

pChObj->deiHqCfg.tempInpEnable = TRUE;
pChObj->deiHqCfg.tempInpChromaEnable = TRUE;
pChObj->deiHqCfg.spatMaxBypass = FALSE;
pChObj->deiHqCfg.tempMaxBypass = FALSE;
pChObj->deiHqCfg.fldMode = VPS_DEIHQ_FLDMODE_4FLD;
pChObj->deiHqCfg.lcModeEnable = TRUE;
pChObj->deiHqCfg.mvstmEnable = FALSE;
pChObj->deiHqCfg.tnrEnable = FALSE;
pChObj->deiHqCfg.snrEnable = FALSE;
pChObj->deiHqCfg.sktEnable = FALSE;
pChObj->deiHqCfg.chromaEdiEnable = FALSE;

pChObj->deiCfg.bypass = deiBypass;
pChObj->deiCfg.inpMode = VPS_DEI_EDIMODE_LUMA_CHROMA;
pChObj->deiCfg.tempInpEnable = TRUE;
pChObj->deiCfg.tempInpChromaEnable = TRUE;
pChObj->deiCfg.spatMaxBypass = FALSE;
pChObj->deiCfg.tempMaxBypass = FALSE;

pChObj->deiRtCfg.resetDei = FALSE;
pChObj->deiRtCfg.fldRepeat = FALSE;
pChObj->frameNum = 0;
pChObj->repeatFrequency = DEI_LINK_IN_FIELD_REPEAT_FREQ_INVALID;


What options could we disable it to achieve "just mearge two field pictures to one frame picture".

thx ~

HB

  • But Why do you need for doing this? While writing fields to memory, why dont you write in line interleaved format?

    Rgds,
    Brijesh
  • Dear Brijesh,

    This is our customer's request.

    They want to support "weaving mode"

    https://en.wikipedia.org/wiki/Deinterlacing

    • Weaving is done by adding consecutive fields together. This is fine when the image hasn't changed between fields, but any change will result in artifacts known as "combing," when the pixels in one frame do not line up with the pixels in the other, forming a jagged edge. This technique retains the full vertical resolution at the expense of half the temporal resolution (motion).

    If we use memcopy by CPU, it is very high load. So, we want to know whether DEI can support this feature.

    They can acceptable simillar setting/result. For example every time still picture mode.
    Of course they will check picture quality.

    If possible, plz teach us how to achieve this feature.

    thx 

    HB

  • Hi HB,

    All i am saying is, why do you need DEI for doing this. You could bypass the DEI in this case and write the field a the offset X with the pitch equal to width * 2 and field1 at the offset X+width with pitch equal to width * 2. In this case also, both the fields will be stored in line interleaved format as you want. I am assuming here your output format is YUV420. If it is YUV422, the pitch becomes width*4 for both the outputs.

    Rgds,
    Brijesh
  • Hi Brijesh,

    Do you mean we need to create new M3 Module (\mcfw\src_bios6\links_m3vpss\"modules") to support merging odd/even fields?
    Do you have example/sample code to do that?
    We think this might cause high MP3 CPU usage, isn't it?
    Thus we prefer to use DEI if DEI feature could be disabled to achieve similar weaving mode.

    thx

    HB
  • Hi HB,

    You could use same DEI module to achieve weaving mode.
    You need to set DEI and scalar in bypass mode and set the buffer and lineoffset/pitch so that both the fields are stored in same buffer in line interleaved format.

    This can be achieved in other driver also, you could scalar/SC5 driver for doing this, there is no need to use DEI driver.

    Rgds,
    Brijesh
  • Hi Brijesh,

    Thx to your suggestion. We will and need to study M3 internal module.
    Besides weaving mode, we also need to support original DEI feature. (ex. Two video input, one support weaving, another support original DEI feature). Thus, modify DEI or scalar seems difficult to our situation.

    At this moment, Can you teach us how to set DEI and scalar to bypass mode?
    If possible, plz give us some code hint to achieve "set the buffer and lineoffset/pitch so that both the fields are stored in same buffer ",
    we need to use DMA copy, right?

    By the way, can you also teach how to disable DEI features one by one?
    a) Motion-adaptive deinterlacing
    b) Edge-Directed Interpolation (EDI)
    c) Film Mode Detection (FMD)
    d) Bad Edit Detection (BED)


    thx ~

    HB
  • Hi HB,

    Which framework are you using? Is it DVR-RDK or IPNC?

    in DEI and Scalar config, there is a bypass flag, when you set it to TRUE, it bypasses scalar and DEI.

    Next you have to provide same buffer addresses for both the fields and set the pitch accordingly.
    You dont have to worry about DMA, it will be taken care by the driver.

    You just need to bypass DEI, all other functionalities are disabled then.

    Rgds,
    Brijesh
  • Hi Brijesh,

    We are using DVR-RDK 3.5.

    about How to set "bypass flag"?

    I found that in initDeiPrms~

    deiPrm->enableDeiForceBypass = FALSE;

    I need to check more detail about dei.


    HB

  • Hi HB,

    Just go through DEI link in DVR-RDK, you will get the idea about how to set the buffer addresses and where to set this bypass flag to FASLE..

    Rgds,
    Brijesh
  • Hi Brijesh,

    If we want to use SC5 to do that...

    Plz refet to our architecture as below and focus on red color path.

    If input is 1920x1280 59.94i, then go through by Merger/Select/New4(a new disign component) -> SCLR.

    If we hope: after SCLR, the output will be 1920x1280 29.97p with weaving mode.

    How to set SCLR to support it?

    I think it should be not so easy to just configure SCLR to support weaving mode.

    Could you give some reference code or how to achieve it?

    thx ~

    HB

  • Hi HB,

    We dont have reference code to do exactly what you want.
    Scalar does not have special mode to support weaving mode, You need to set the SCLR in bypass mode or 1x scaling mode, so that scalar outputs is same as input and then update the output buffer addresses such that both the fields are stored in interleaved mode.

    Rgds,
    Brijesh