[vlc-devel] Coder/decoder module implementation

Alex Vazquez alexvazquezfente at gmail.com
Sat Aug 11 16:42:22 CEST 2007


You can take a look to the file /modules/codec/rawvideo.c. It does similar
to what you need. In particular look to its DecodeFrame function (called by
DecodeBlock) which is similar to yours except the call to FillPicture
instead your wrong call to vout_CopyPicture(...).

All you have to do is your substitute for FillPicture function, the inverse
to what you did in the Encode function, that is, memcpy back the
p_block->p_buffer to p_pic->p_data.

Anyway, you should do all this with care, and you will probably need some
debug to make it work.

Regards,

2007/8/11, F. P.:
>
> Thanks Alex,
> So what should I do if I want to copy each raw picture pixel into a
> block (without image compression) and copy back each pixel from the raw
> block to an image ?
>
> Thanks,
> pflooo
>
> Alex Vazquez a écrit :
> > 2007/8/10, F. P.:
> >> Hi !
> >> I try to write a wavelet based coder/decoder. First I
> >> tried to make a simple coder/decoder that simply copy
> >> the image to a block and then copy the block back to a
> >> image.
> >>
> >> I wrote the attached code, the coder seems to work but
> >> the decoder still blocks. Help would be much
> >> appreciated !
> >>
> >> Thanks,
> >> pflooo
> >>
> >>
> > I am no expert but I think you have to distinguish beetwen block and
> > picture, you can't copy the picture just doing:
> >
> > vout_CopyPicture( p_dec, p_pic, p_block->p_buffer );
> >
> > That should give a BIG FAT WARNING BTW and all you'll get will be a seg
> > fault, since you are copying a uint8_t * (instead a picture_t *) into a
> > picture_t *.
> > First, you need to decode the block with a "real" decoder to get a
> picture.
> >
> >
> > Regards,
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > vlc-devel mailing list
> > vlc-devel at videolan.org
> > http://mailman.videolan.org/listinfo/vlc-devel
>
> _______________________________________________
> vlc-devel mailing list
> vlc-devel at videolan.org
> http://mailman.videolan.org/listinfo/vlc-devel
>



-- 
Alejandro Vazquez Fente
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070811/f76db90e/attachment.html>
-------------- next part --------------
_______________________________________________
vlc-devel mailing list
vlc-devel at videolan.org
http://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list