Community
cancel
Showing results for 
Search instead for 
Did you mean: 
David_S_13
Beginner
91 Views

H.263 Decoding corrupted areas

Hi,

I build a simple H.263 decoder based on the example code provided. I am receiving a H.263 stream from a Polycom codec (CIF resolution, 64Kbps). I do not get any errors, but the decoded video has several horizontal bands of macroblocks that are black. If there is motion in those black areas, they are correctly redrawn. Also, there are other macroblocks that periodically corrupt (blocks of corrupted video). Below is the code I use to initialize the decoder and decode theframes:

m_pDecoder = new UMC::H263VideoDecoder();
m_pDecoderParams = new UMC::VideoDecoderParams();
m_pDataIn = new UMC::MediaData();
m_pDataOut = new UMC::VideoData();

m_pDataIn->SetBufferPointer(pSrc,lInBuffSize);
m_pDataIn->SetDataSize(lInBuffSize);

m_pDecoderParams->m_pData = m_pDataIn;
m_pDecoderParams->lFlags=0;
m_pDecoderParams->numThreads=0;
UMC::Status umcSt = m_pDecoder->Init(m_pDecoderParams);
if (umcSt != UMC::UMC_OK)
OutputDebugString("Cannot initialize the H.263 Deocder libraries\r\n");

umcSt = m_pDecoder->GetInfo(m_pDecoderParams);
if (umcSt != UMC::UMC_OK)
{
OutputDebugString("Cannot get decoder info from the decoder\r\n");
}

//Initialize the output
m_imgWidth = m_pDecoderParams->info.clip_info.width;
m_imgHeight = m_pDecoderParams->info.clip_info.height;
m_pDataOut->Init(m_imgWidth,m_imgHeight,UMC::YV12,8);
m_pDataOut->Alloc();

.
.
.

m_pDataIn->SetBufferPointer(pSrc,lInBuffSize);
m_pDataIn->SetDataSize(lInBuffSize);

m_pDataOut->SetBufferPointer(pDst,m_imgWidth*m_imgHeight*3/2);

status = m_pDecoder->GetFrame(m_pDataIn, m_pDataOut);
//---------
This is actually in the ::FillBuffer member function of a DirectShow transform filter. I print the results of each RTP packet I receive. I strip off the RTP header and the H.263 header (though the 263 header is simply ignored if I leave it there). The marker bit in the RTP header indicates a "completed" frame. I use this to combine the RTP data into a single buffer containing a full frame, which I then feed to the decoder via GetFrame(). Does anyone have any thought as to why some of the macroblocks would be corrupted in my decoded video? Thanks for any input anyone can provide.

-Dave

(The output below shows the size of the RTP packet, followed by the first 32 bytes of the packet and then the last 16 bytes of the packet.

>>: size (1126) < 0 0 22 80 1c 80 1e 4 1 3b d7 58 86 66 10 18 0 0 0 0 0 0 80 66 2c 6 1e c2 c 0 7f 0 > --
>>: size (1042) < 1 0 22 80 1c 80 1e 4 1 3b d7 58 90 62 18 24 0 0 0 0 9e 80 c 7 98 30 60 c0 c4 7b 83 0 > -- <28 6e 4e 9a 5b d2 64 bb 4a eb 1c c 1c 99 23 a5 >
>>: size (1130) < 2 0 22 80 1c 80 1e 4 1 3b d7 58 81 64 20 30 0 0 0 0 7a 53 20 cd ff 84 ea 0 c0 75 9 40 > --
>>: size (1097) < 3 0 22 80 1c 80 1e 4 1 3b d7 58 be 66 28 3c 0 0 0 0 de 3e a5 1a e8 1f 64 c 85 89 7a 22 > --
>>: size (1134) < 4 0 22 80 1c 80 1e 4 1 3b d7 58 94 64 30 4c 0 0 0 0 1e a4 a5 5a de ef 1b a9 49 91 44 ae > -- <95 bf 75 57 e0 89 51 ea 33 86 66 94 76 e8 1f f0 >
>>: size (1115) < 5 0 22 80 1c 80 1e 4 1 3b d7 58 a3 64 38 50 0 0 0 0 f0 fe 69 58 f9 58 fb ea 14 7c 18 a0 > --
>>: size (1128) < 6 0 22 80 1c 80 1e 4 1 3b d7 58 a9 62 40 50 0 0 0 0 f8 fa fa a0 50 89 2 32 7 a7 3 3 > -- <98 36 5c 2d 2f 3c 58 98 16 a5 99 74 a4 59 2 ff >
>>: size (1104) < 7 0 22 80 1c 80 1e 4 1 3b d7 58 bc 66 48 38 0 0 0 0 ff 82 e3 c5 ca 1 fa ff 2b 2b 11 5a > -- <67 89 41 c 14 91 89 e0 62 ff b0 1c d0 2f f7 e5 >
>>: size (1092) < 8 0 22 80 1c 80 1e 4 1 3b d7 58 a4 66 50 30 0 0 0 0 e5 a0 2a be 12 a0 1e d9 cc 6e e6 c5 > -- <4a 4 af 40 2d 28 2a b8 59 f be 58 c9 3b f1 f5 >
>>: size (1122) < 9 0 22 80 1c 80 1e 4 1 3b d7 58 a4 62 58 50 0 0 0 0 f5 27 26 ed 40 c0 77 83 1 d8 1 e0 > -- <98 a0 a4 11 53 1d 28 6d 82 b1 34 1f 53 42 2f fe >
>>: size (1133) < a 0 22 80 1c 80 1e 4 1 3b d7 58 a1 64 68 4 0 0 0 0 fe 4f ac a6 f 5 85 5e 2f d0 52 84 > --
>>: size (1107) < b 0 22 80 1c 80 1e 4 1 3b d7 58 b8 66 70 10 0 0 0 0 66 f d7 79 57 a7 64 ea 6c 82 ea 70 > -- < e 30 62 f8 8 6a a0 29 46 c2 b7 2c c a2 f4 33 >
>>: size (1133) < c 0 22 80 1c 80 1e 4 1 3b d7 58 81 62 80 8 0 0 0 0 7a 50 30 3f 25 c0 a6 54 4 1c a4 a > -- <17 a4 13 75 35 35 35 21 db 27 a9 a9 a9 a9 e d8 >
>>: size (1122) < d 0 22 80 1c 80 1e 4 1 3b d7 58 b9 66 88 28 0 0 0 0 d8 1f e8 f8 de e 8f bc a8 7b f1 df > -- <25 7d f4 48 e 5f eb 1d 56 33 66 ff 9a 39 29 1e >
>>: size (1128) < e 0 22 80 1c 80 1e 4 1 3b d7 58 b8 62 90 50 0 0 0 0 1e f6 c0 f ff b5 54 ab 68 2a c0 2d > -- <94 46 79 c2 a1 a9 fa 8f d9 9 cd d5 43 30 2f 2f >
>>: size (58) < f 0 a2 80 1c 80 1e 4 1 3b d7 58 80 62 90 58 0 0 0 0 39 9c 28 17 98 7a d c a3 8b 7d e0 > -- <5e 83 dc 2 56 23 2 fc b2 ab e6 a2 18 40 bf 80 >
>>: A complete frame is build of size <16451>

>>: size (368) <10 0 a2 80 7c f7 1f 4 1 3b d7 58 80 68 90 58 80 0 0 0 0 0 80 de e 7 3d df fb 5a 51 7f > --
>>: A complete frame is build of size <348>
>>: size (91) <11 0 a2 80 37 3 20 4 1 3b d7 58 80 6a 90 58 80 0 0 0 0 0 80 e6 e 9 3f ff fe ef ff ff > --
>>: A complete frame is build of size <71>
>>: size (105) <12 0 a2 80 f2 e 20 4 1 3b d7 58 80 69 90 58 80 0 0 0 0 0 80 ee e 8 3f ff 75 ff ff ff > -- <8f df 1f bf ff f9 f5 7f ff fd ea f5 ff ff ff f8 >
>>: A complete frame is build of size <85>
>>: size (156) <13 0 a2 80 68 26 20 4 1 3b d7 58 80 68 90 58 80 0 0 0 0 0 80 f6 e 7 3f ff ff ff ff ff > --
>>: A complete frame is build of size <136>
>>: size (444) <14 0 a2 80 23 32 20 4 1 3b d7 58 80 67 90 58 80 0 0 0 0 0 80 fe e 6 18 cc 75 70 ac 64 > --
>>: A complete frame is build of size <424>
>>: size (759) <15 0 a2 80 99 49 20 4 1 3b d7 58 80 66 90 58 80 0 0 0 0 0 81 6 e 5 5 18 3f 7f e4 cd > -- <98 2b 44 e0 f5 0 8a 97 c8 41 36 d6 3 3e 3f 78 >
>>: A complete frame is build of size <739>
>>: size (1140) <16 0 22 80 f 61 20 4 1 3b d7 58 87 66 90 18 80 0 0 0 0 0 81 e e 5 1b c4 fb 78 22 b9 > -- <87 63 1a 7f ff 6b 21 67 7 dc 4 40 38 de 13 e1 >
>>: size (35) <17 0 a2 80 f 61 20 4 1 3b d7 58 88 66 90 58 80 0 0 0 e1 6b 1 e0 af 79 3b 58 a9 bc 8b da > -- < 0 e1 6b 1 e0 af 79 3b 58 a9 bc 8b da c0 47 e0 >
>>: A complete frame is build of size <1135>
>>: size (409) <18 0 a2 80 85 78 20 4 1 3b d7 58 80 66 90 58 80 0 0 0 0 0 81 16 e 5 1b c1 f8 1 17 93 > -- < a ad 6c 2 d6 b6 2 1b cd ba f8 bd c1 7d cf 80 >
>>: A complete frame is build of size <389>
>>: size (1140) <19 0 22 80 fb 8f 20 4 1 3b d7 58 85 66 90 10 80 0 0 0 0 0 81 1e e 5 1b c5 7d bc 2b db > --
>>: size (32) <1a 0 a2 80 fb 8f 20 4 1 3b d7 58 98 66 90 58 80 0 0 0 b6 b0 4f b1 80 cc 6d b2 12 92 ff f0 > -- <80 0 0 0 b6 b0 4f b1 80 cc 6d b2 12 92 ff f0 >
>>: A complete frame is build of size <1132>
>>: size (504) <1b 0 a2 80 71 a7 20 4 1 3b d7 58 80 66 90 58 80 0 0 0 0 0 81 26 e 5 3f fd b 5 a1 23 > -- <69 ff fb 38 b0 13 7e de d 50 8 c3 5b 14 ff c0 >
>>: A complete frame is build of size <484>
>>: size (1138) <1c 0 22 80 e7 be 20 4 1 3b d7 58 81 65 50 2c 80 0 0 0 0 0 81 2e e 4 6 78 b0 6c 2c 6 > -- <85 2b 60 f8 80 ec e4 40 fb 0 b1 89 aa e2 90 1a >
>>: size (357) <1d 0 a2 80 e7 be 20 4 1 3b d7 58 b8 65 90 58 80 0 0 0 1a ae 78 1e ff f5 b2 11 56 3 f f8 > -- <91 be 2 4a c9 5 6d e5 4 a2 ac 11 fa 34 3d f8 >
>>: A complete frame is build of size <1455>
>>: size (241) <1e 0 a2 80 5d d6 20 4 1 3b d7 58 80 66 90 58 80 0 0 0 0 0 81 36 e 5 3f ff fd 8c 9b ff > --
>>: A complete frame is build of size <221>
>>: size (990) <1f 0 a2 80 d3 ed 20 4 1 3b d7 58 80 65 90 58 80 0 0 0 0 0 81 3e e 4 5 78 3e 40 29 16 > --
>>: A complete frame is build of size <970>
>>: size (926) <20 0 a2 80 4 11 21 4 1 3b d7 58 80 65 90 58 80 0 0 0 0 0 81 46 e 4 5 e2 6f 6b 14 58 > -- <6d e2 6a 1e 28 c 5b c9 1b d2 1b 6b 7 e3 ff f0 >
>>: A complete frame is build of size <906>
>>: size (765) <69 0 a2 80 f1 84 26 4 1 3b d7 58 80 66 90 58 80 0 0 0 0 0 83 26 e 5 1b cc 74 f5 c5 64 > -- <63 30 12 b6 65 f 30 74 5e 2a 5f 19 9 96 ce ff >
>>: A complete frame is build of size <745>
>>: size (1140) <6a 0 22 80 22 a8 26 4 1 3b d7 58 83 66 68 8 80 0 0 0 0 0 83 2e e 5 18 c1 fb ff ed e1 > -- <61 de b 63 df ff b7 83 f7 ff ff fe be 29 5 da >
>>: size (116) <6b 0 a2 80 22 a8 26 4 1 3b d7 58 a8 66 90 58 80 0 0 0 da d8 2c fb 58 5e d6 15 a 33 67 fa > -- <78 a1 8c 96 d6 3 d8 c0 52 b9 80 92 de 9 3f f0 >
>>: A complete frame is build of size <1216>
>>: size (351) <6c 0 a2 80 dd b3 26 4 1 3b d7 58 80 66 90 58 80 0 0 0 0 0 83 36 e 5 3d ac 67 5b 26 fa > --
>>: A complete frame is build of size <331>
>>: size (900) <6d 0 a2 80 53 cb 26 4 1 3b d7 58 80 66 90 58 80 0 0 0 0 0 83 3e e 5 3f 1f 8a 7e b6 3 > -- <5a a1 af 5b 18 ff ec 60 b6 b5 84 ff b1 85 df e0 >
>>: A complete frame is build of size <880>
>>: size (979) <6e 0 a2 80 84 ee 26 4 1 3b d7 58 80 65 90 58 80 0 0 0 0 0 83 46 e 4 2 9e 38 78 a8 1e > --
>>: A complete frame is build of size <959>
>>: size (743) <6f 0 a2 80 3f fa 26 4 1 3b d7 58 80 65 90 58 80 0 0 0 0 0 83 4e e 4 1a cf 75 f1 aa 60 > --
>>: A complete frame is build of size <723>
>>: size (1140) <70 0 22 80 b5 11 27 4 1 3b d7 58 81 64 40 28 80 0 0 0 0 0 83 56 e 4 4 d8 8 48 40 de > -- <98 28 b3 78 a f5 ca 29 2e 8 5 89 45 6b bc 64 >
>>: size (537) <71 0 a2 80 b5 11 27 4 1 3b d7 58 b8 65 90 58 80 0 0 0 64 14 f6 1 5a db 2f 64 b7 8d 86 1d > --
>>: A complete frame is build of size <1637>
>>: size (183) <72 0 a2 80 e6 34 27 4 1 3b d7 58 80 66 90 58 80 0 0 0 0 0 83 5e e 5 3f ff fd bc 51 ff > -- <19 33 79 41 7 eb 67 7f ff ff ff ff ff ff ff ff >
>>: A complete frame is build of size <163>
>>: size (729) <73 0 a2 80 a1 40 27 4 1 3b d7 58 80 65 90 58 80 0 0 0 0 0 83 66 e 4 3b 58 ad b a a > -- <51 82 ec f2 d8 2d c5 e2 9e de 44 d6 88 17 5f 80 >
>>: A complete frame is build of size <709>
>>: size (1139) <74 0 22 80 17 58 27 4 1 3b d7 58 86 64 68 20 80 0 0 0 0 0 83 6e e 4 3b 19 95 32 a1 88 > --
>>: size (136) <75 0 a2 80 17 58 27 4 1 3b d7 58 90 65 90 58 80 0 0 0 d1 e0 9a 9 cc 25 2a ad 1e d7 c1 9d > -- <20 1d 6c 1e d0 1b 18 62 d6 7d d5 ac 1f 8f ff c0 >
>>: A complete frame is build of size <1235>

0 Kudos
1 Reply
Chao_Y_Intel
Employee
91 Views


Hello,
do you have a bitstream that can be tested? Do this stream contain any corrupted data?

Thanks,
Chao
Reply