[XviD-devel] Using XVID_CSP_INTERNAL

pete pross at xvid.org
Mon Oct 30 12:53:11 CET 2006


On Sat, 28 Oct 2006 21:21:30 -0700 (PDT) Kyle Meadows <darktyco at yahoo.com> wrote:
> I have a question about decoding a stream using XVID_CSP_INTERNAL. I wrote a program that used XVID_CSP_YV12 to decode video in the planar format and display it to the screen. Everything was working normally- every time I called the decoder new video data was put into the buffer I provided and the plane strides were all reported correctly (1774, 1774/2, and 1774/2 for my test stream.)
> 
> I wanted to start using XVID_CSP_INTERNAL to gain performance, so I tried to decipher how it worked from the XVID source and I have it running, but with weird results. The first time the decoder is called the pointer at xvid_dec_frame_t.output pointer is NULL and the plane strides are all reported as 0. The next two times the decoder is called the pointers won't be NULL and will actually point to the decoded video data, but the strides are reported incorrectly (1904, 1904/2, and 1904/2 instead of the values I gave as an example above.) So while the video is being decoded and I can display it, it is being stretched out in the X dimension. Then the sequence repeats itself, a NULL pointer being returned once and the stretched out data being returned twice, repeat again and again.

> Am I using the decoder properly? I used basically the same code when I was using XVID_CSP_YV12 and all was happy. Any help would be greatly appreciated. Thanks!

no. XVID_CSP_INTERNAL causes the decoder to populate the plane  *and* 
stride fields of xvid_dec_frame_t with values corresponding to the
decoder's internal buffer.

to access the video frame after calling xvid_decore you must use the
pointers and strides returned. e.g.

;
;    xvid_dec_frame.output.csp         = XVID_CSP_INTERNAL;
;    out = xvid_decore(decoder_handle, XVID_DEC_DECODE, &xvid_dec_frame,
decoder_stats);
;
;    y_plane_buffer = (unsigned char*) xvid_dec_frame.output.plane[0];
;    y_plane_stride = xvid_dec_frame.output.stride[0];

-- pete



More information about the XviD-devel mailing list