[FFmpeg-devel] [PATCH]Add Dirac support to ffmpeg via libdirac_* and Schroedinger libraries]

Anuradha Suraparaju anuradha
Fri Apr 4 12:17:57 CEST 2008


On Fri, 2008-04-04 at 09:13 +0200, Luca Barbato wrote:
> Anuradha Suraparaju wrote:
> > Sorry. Forgot to mention that the message is a patch in my earlier
> > email.
> 
> Nevermind, it happens from time to time. Thank you for the patches, it 
> will take a bit review properly but at least will prompt 
> *certain*people* to start working back on updating&integrating ffdirac 
> to the main ffmpeg and will provide an unified access to all the dirac 
> implementations (so we can easily spot bugs and address them).

> 
> Would be possible split the schro part from the dirac one? That would 
> speed up merging it.
OK. I'll go ahead and do it. But some patches will be dependent on
other. E.g. the patch for MPEG-2 TS and AVI support for Dirac will
depend on the avcodec.h changes in the Dirac and Schro patches. Or
should I have an avcodec.h with each patch with the necessary codec ids?
> 
> Now some quick review.
> 
> @@ -845,6 +855,8 @@
>   bktr_demuxer_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h 
> dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
>   dv1394_demuxer_deps="dv1394 dv_demuxer"
>   libdc1394_demuxer_deps="libdc1394"
> +dirac_demuxer_deps="dirac"
> +dirac_muxer_deps="dirac"
>   libnut_demuxer_deps="libnut"
>   libnut_muxer_deps="libnut"
>   mp3_demuxer_deps="mpegaudio_parser"
> @@ -853,6 +865,8 @@
>   redir_demuxer_deps="network"
>   rtp_muxer_deps="network rtp_protocol"
>   rtsp_demuxer_deps="sdp_demuxer"
> +schro_muxer_deps="schro"
> +schro_demuxer_deps="schro"
>   sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
>   v4l_demuxer_deps="linux_videodev_h"
>   v4l2_demuxer_deps="linux_videodev2_h"
> @@ -861,6 +875,10 @@
>   x11_grab_device_demuxer_deps="x11grab XShmCreateImage"
>   x11_grab_device_demuxer_extralibs="-lX11 -lXext"
> 
> +# parsers
> +dirac_parser_deps="dirac"
> +schro_parser_deps="schro"
> +
>   # protocols
>   http_protocol_deps="network"
>   rtp_protocol_deps="udp_protocol"
> 
> We have already a demuxer and a parser for drc, would be possible using it?
I couldn't find it in the trunk. Are the demuxer and parser for drc a
result of the GSoC project? If they already exist and do the job, I'll
be glad to use them.
> 
> +enabled dirac  && add_extralibs `pkg-config --libs dirac` "-lstdc++" && 
> extraincs="$extraincs `pkg-config --cflags dirac`"
> 
> -lstdc++ sounds strange, but I guess that's due the fact you are using a 
> C wrapper to libdirac
Yes.
> 
> --- ffmpegsvn_trunk/libavcodec/avcodec.h	2008-04-01 09:14:03.000000000 +1000
> +++ ffmpegsvn_trunk_dirac_schro/libavcodec/avcodec.h	2008-04-01 
> 09:15:43.000000000 +1000
> @@ -182,6 +182,8 @@
>       CODEC_ID_8SVX_EXP,
>       CODEC_ID_8SVX_FIB,
>       CODEC_ID_ESCAPE124,
> +    CODEC_ID_SCHRO = 0xFFFE,
> +    CODEC_ID_DIRAC = 0xFFFF,
> 
> why this?
While I was writing the code and testing it I didn't want the CODEC id's
to interfere with ones that were being included. I'll remove the numbers
associated with codec ids for Schroedinger and Dirac.
> 
> diff --exclude=.svn -ruN ffmpegsvn_trunk/libavcodec/dirac.c 
> ffmpegsvn_trunk_dirac_schro/libavcodec/dirac.c
> --- ffmpegsvn_trunk/libavcodec/dirac.c	1970-01-01 10:00:00.000000000 +1000
> +++ ffmpegsvn_trunk_dirac_schro/libavcodec/dirac.c	2008-04-04 
> 11:28:12.000000000 +1000
> @@ -0,0 +1,514 @@
> +/*
> 
> some comments aren't doxy while should be.
> 
> + /*
> + * returns Ffmppeg chroma format
> + */
> 
> typo and not doxy.
Will fix this.
> 
> diff --exclude=.svn -ruN ffmpegsvn_trunk/libavcodec/dirac_parser.c 
> ffmpegsvn_trunk_dirac_schro/libavcodec/dirac_parser.c
> --- ffmpegsvn_trunk/libavcodec/dirac_parser.c	1970-01-01 
> 10:00:00.000000000 +1000
> +++ ffmpegsvn_trunk_dirac_schro/libavcodec/dirac_parser.c	2008-04-04 
> 11:28:33.000000000 +1000
> 
> +#include "dirac_schro_parser.h"
> +
> +AVCodecParser dirac_parser = {
> +    { CODEC_ID_DIRAC },
> +    sizeof(FfmpegDiracSchroParseContext),
> +    dirac_schro_parse_open,
> +    dirac_schro_parse,
> +    dirac_schro_parse_close,
> +};
> 
> Why not using just one?
OK. Will have just one parser for all implementations of Dirac.
> 
> diff --exclude=.svn -ruN ffmpegsvn_trunk/libavformat/mpegtsenc.c 
> ffmpegsvn_trunk_dirac_schro/libavformat/mpegtsenc.c
> --- ffmpegsvn_trunk/libavformat/mpegtsenc.c	2008-01-10 
> 10:47:05.000000000 +1100
> +++ ffmpegsvn_trunk_dirac_schro/libavformat/mpegtsenc.c	2008-04-03 
> 14:39:26.000000000 +1000
> 
> this should be yet another separate patch.
OK.
> 
> diff --exclude=.svn -ruN ffmpegsvn_trunk/libavformat/riff.c 
> ffmpegsvn_trunk_dirac_schro/libavformat/riff.c
> --- ffmpegsvn_trunk/libavformat/riff.c	2008-03-10 13:21:27.000000000 +1100
> +++ ffmpegsvn_trunk_dirac_schro/libavformat/riff.c	2008-04-03 
> 14:53:42.000000000 +1000
> @@ -160,6 +160,8 @@
>       { CODEC_ID_VMNC,         MKTAG('V', 'M', 'n', 'c') },
>       { CODEC_ID_TARGA,        MKTAG('t', 'g', 'a', ' ') },
>       { CODEC_ID_CLJR,         MKTAG('c', 'l', 'j', 'r') },
> +    { CODEC_ID_SCHRO,        MKTAG('d', 'r', 'a', 'c') },
> +    { CODEC_ID_DIRAC,        MKTAG('d', 'r', 'a', 'c') },
>       { CODEC_ID_NONE,         0 }
>   };
> 
> yet another.
OK
> 
> 
> that's all for now, Michael will tell more soonish probably.
> 
> 
> 
Thanks for the feedback.

Regards,
Anuradha





More information about the ffmpeg-devel mailing list