Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Dynamic Intra Frame encoding support

kkmanoj
Beginner
401 Views

Hello,

I amusingthe H.263(1996) encoder/decoder for our video conferencing application.

Currently we have a requirement of dynamic Intra-Frame encoding support.

The scenario is :

  1. H.263 encoder is initialized and running.It is pumping the encoded data as per the expectation with encoder settings as 176 X 144 , 64/128kbps , 15 fps.

  2. Now the client requests toan H.263 Intra-Frameat the earliest.

We are using GetFrame API of H263VideoEncoder class with VideoData as IN parameter and MediaData as OUT parameter.

Please suggest as to how to generate an I-Frame for H.263 codec.

TIA

Manoj

0 Kudos
3 Replies
Intel_C_Intel
Employee
401 Views
In umc_h263_video_encoder.cpp, in the code partshown belowone can add the linesending with /* --------- line to be added --------- */ :
if (pVideoDataIn) {
// copy YUV to internal frame
IppiSize roi;
Ipp8u *pY, *pU, *pV;
Ipp32s stepL, stepC;
h263enc.GetCurrentFrameInfo(&pY, &pU, &pV, &stepL, &stepC);
roi.width = m_Param.info.clip_info.width;
roi.height = m_Param.info.clip_info.height;
ippiCopy_8u_C1R((Ipp8u*)pVideoDataIn->GetPlanePointer(0), pVideoDataIn->GetPlanePitch(0), pY, stepL, roi);
roi.width >>= 1;
roi.height >>= 1;
ippiCopy_8u_C1R((Ipp8u*)pVideoDataIn->GetPlanePointer(1), pVideoDataIn->GetPlanePitch(1), pU, stepC, roi);
ippiCopy_8u_C1R((Ipp8u*)pVideoDataIn->GetPlanePointer(2), pVideoDataIn->GetPlanePitch(2), pV, stepC, roi);
if (pVideoDataIn->GetFrameType() == I_PICTURE) /* --------- line to be added --------- */
h263enc.mLastIPic = -h263enc.mIPicdist; /* --------- line to be added --------- */
}
Ipp32s sts = h263enc.EncodeFrame(pIn == NULL);
In this case before calling GetFrame(in, out), one shouldcall
in->Set FrameType(I_PICTURE) to force an I-Frame,
and
in->SetFrameType(NONE_PICTURE) or in->SetFrameType(P_PICTURE) to let the encoder decide on the frame type.
Thanks,
Timofei
0 Kudos
PaulF_IntelCorp
Employee
401 Views
As an FYI, the following information was provided by our engineering group, as it relates to this thread.

SetFrameType(I_PICTURE) should be called for input VideoData object, not for output. It should be enough for H264 encoder.

For MPEG4 it doesnt work. More complex modifications are required. The idea is to change somehow the result of

isIVOP = (mFrameCount - mLastIVOP >= mIVOPdist);

which can be found twice in ippVideoEncoderMPEG4::EncodeFrame. There is no place in the code where FrameType from VideoData can directly affect these protected counters. Probably simplest way is to add public flag to ippVideoEncoderMPEG4 and switch it on in GetFrame() when I-frame is requested, then set isIVOP to true if the flag is set.

The patch to H263 [above] can be trusted to the same extent as ipp-SAMPLES are. It is proposed by the sample developer.

0 Kudos
shyaki
Beginner
401 Views
As an FYI, the following information was provided by our engineering group, as it relates to this thread.

SetFrameType(I_PICTURE) should be called for input VideoData object, not for output. It should be enough for H264 encoder.

For MPEG4 it doesnt work. More complex modifications are required. The idea is to change somehow the result of

isIVOP = (mFrameCount - mLastIVOP >= mIVOPdist);

which can be found twice in ippVideoEncoderMPEG4::EncodeFrame. There is no place in the code where FrameType from VideoData can directly affect these protected counters. Probably simplest way is to add public flag to ippVideoEncoderMPEG4 and switch it on in GetFrame() when I-frame is requested, then set isIVOP to true if the flag is set.

The patch to H263 [above] can be trusted to the same extent as ipp-SAMPLES are. It is proposed by the sample developer.


As for H264 encoding, willSetFrameType(IFrame) force the encoder to encode next frame to IFrame or IDRFrame?
0 Kudos
Reply