changeset 27307:b9af28b39daf

Add Dirac video support via libdirac and libschroedinger in libavcodec. patch by Anuradha Suraparaju, anuradha rd.bbc.co uk
author diego
date Tue, 22 Jul 2008 22:58:51 +0000
parents 7a650839fc10
children e0d8be9a3261
files configure etc/codecs.conf libmpcodecs/ve_lavc.c
diffstat 3 files changed, 106 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Tue Jul 22 18:46:07 2008 +0000
+++ b/configure	Tue Jul 22 22:58:51 2008 +0000
@@ -292,6 +292,9 @@
   --disable-xvid-lavc       disable Xvid in libavcodec [autodetect]
   --disable-x264            disable x264 [autodetect]
   --disable-x264-lavc       disable x264 in libavcodec [autodetect]
+  --disable-libdirac-lavc   disable Dirac in libavcodec [autodetect]
+  --disable-libschroedinger-lavc   disable Dirac in libavcodec (Schroedinger
+                                   decoder) [autodetect]
   --disable-libnut          disable libnut [autodetect]
   --disable-libavutil_a     disable static libavutil [autodetect]
   --disable-libavcodec_a    disable static libavcodec [autodetect]
@@ -633,6 +636,8 @@
 _xvid_lavc=auto
 _x264=auto
 _x264_lavc=auto
+_libdirac_lavc=auto
+_libschroedinger_lavc=auto
 _libnut=auto
 _lirc=auto
 _lircc=auto
@@ -1044,6 +1049,10 @@
   --disable-x264)       _x264=no        ;;
   --enable-x264-lavc)   _x264_lavc=yes  ;;
   --disable-x264-lavc)  _x264_lavc=no   ;;
+  --enable-libdirac-lavc)   _libdirac_lavc=yes  ;;
+  --disable-libdirac-lavc)  _libdirac_lavc=no   ;;
+  --enable-libschroedinger-lavc)   _libschroedinger_lavc=yes  ;;
+  --disable-libschroedinger-lavc)  _libschroedinger_lavc=no   ;;
   --enable-libnut)	_libnut=yes	;;
   --disable-libnut)	_libnut=no	;;
   --enable-libavutil_a)		_libavutil_a=yes	;;
@@ -6659,6 +6668,79 @@
 echores "$_x264"
 
 
+echocheck "libdirac"
+if test "$_libdirac_lavc" = auto; then
+  _libdirac_lavc=no
+  if test "$_libavcodec_a" != yes; then
+    _res_comment="libavcodec (static) is required by libdirac, sorry"
+  else
+    cat > $TMPC << EOF
+#include <libdirac_encoder/dirac_encoder.h>
+#include <libdirac_decoder/dirac_parser.h>
+int main(void)
+{
+    dirac_encoder_context_t enc_ctx;
+    dirac_decoder_t *dec_handle;
+    dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
+    dec_handle = dirac_decoder_init(0);
+    if (dec_handle)
+        dirac_decoder_close(dec_handle);
+    return 0;
+}
+EOF
+    if $_pkg_config --exists dirac ; then
+      _inc_dirac=`$_pkg_config --silence-errors --cflags dirac`
+      _ld_dirac=`$_pkg_config --silence-errors --libs dirac`
+      cc_check $_inc_dirac $_ld_dirac      &&
+      _libdirac_lavc=yes                   &&
+      _inc_extra="$_inc_extra $_inc_dirac" &&
+      _ld_extra="$_ld_extra $_ld_dirac"
+    fi
+  fi
+fi
+if test "$_libdirac_lavc" = yes ; then
+  _def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
+  _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
+  _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
+  _codecmodules="libdirac $_codecmodules"
+else
+  _def_libdirac_lavc='#undef CONFIG_LIBDIRAC'
+  _nocodecmodules="libdirac $_nocodecmodules"
+fi
+echores "$_libdirac_lavc"
+
+
+echocheck "libschroedinger"
+if test "$_libschroedinger_lavc" = auto ; then
+  _libschroedinger_lavc=no
+  if test "$_libavcodec_a" != yes; then
+    _res_comment="libavcodec (static) is required by libschroedinger, sorry"
+  else
+    cat > $TMPC << EOF
+#include <schroedinger/schro.h>
+int main(void) { schro_init(); return 0; }
+EOF
+    if $_pkg_config --exists schroedinger-1.0 ; then
+      _inc_schroedinger=`$_pkg_config --silence-errors --cflags schroedinger-1.0`
+      _ld_schroedinger=`$_pkg_config --silence-errors --libs schroedinger-1.0`
+      cc_check $_inc_schroedinger $_ld_schroedinger &&
+      _libschroedinger_lavc=yes                     &&
+      _inc_extra="$_inc_extra $_inc_schroedinger"   &&
+      _ld_extra="$_ld_extra $_ld_schroedinger"
+    fi
+  fi
+fi
+if test "$_libschroedinger_lavc" = yes ; then
+  _def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
+  _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
+  _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
+  _codecmodules="libschroedinger $_codecmodules"
+else
+  _def_libschroedinger_lavc='#undef CONFIG_LIBSCHROEDINGER'
+  _nocodecmodules="libschroedinger $_nocodecmodules"
+fi
+echores "$_libschroedinger_lavc"
+
 echocheck "libnut"
 if test "$_libnut" = auto ; then
   cat > $TMPC << EOF
@@ -7826,8 +7908,10 @@
 CONFIG_LIBAMR=$_libamr
 CONFIG_LIBAMR_NB=$_libamr_nb
 CONFIG_LIBAMR_WB=$_libamr_wb
+CONFIG_LIBDIRAC=$_libdirac_lavc
 CONFIG_LIBFAAC=$_faac_lavc
 CONFIG_LIBMP3LAME=$_mp3lame_lavc
+CONFIG_LIBSCHROEDINGER=$_libschroedinger_lavc
 CONFIG_LIBVORBIS=$_libvorbis
 CONFIG_LIBX264=$_x264_lavc
 CONFIG_LIBXVID=$_xvid_lavc
@@ -8223,8 +8307,10 @@
 `ff_config_enable "$_libavprotocols_all" "$_libavprotocols"`
 `ff_config_enable "$_libavbsfs_all" "$_libavbsfs"`
 
+$_def_libdirac_lavc
 $_def_faac_lavc
 $_def_mp3lame_lavc
+$_def_libschroedinger_lavc
 $_def_x264_lavc
 $_def_xvid_lavc
 
--- a/etc/codecs.conf	Tue Jul 22 18:46:07 2008 +0000
+++ b/etc/codecs.conf	Tue Jul 22 22:58:51 2008 +0000
@@ -708,6 +708,22 @@
   dll mpeg4
   out YV12,I420,IYUV flip
 
+videocodec fflibschroedinger
+  info "Dirac (through FFmpeg libschroedinger)"
+  status working
+  fourcc drac
+  driver ffmpeg
+  dll libschroedinger
+  out I420,IYUV,422P,444P
+
+videocodec fflibdirac
+  info "Dirac (through FFmpeg libdirac)"
+  status working
+  fourcc drac
+  driver ffmpeg
+  dll libdirac
+  out I420,IYUV,422P,444P
+
 videocodec xvid
   info "Xvid (MPEG-4)"
   status working
--- a/libmpcodecs/ve_lavc.c	Tue Jul 22 18:46:07 2008 +0000
+++ b/libmpcodecs/ve_lavc.c	Tue Jul 22 22:58:51 2008 +0000
@@ -1021,6 +1021,10 @@
 	mux_v->bih->biCompression = mmioFOURCC('d', 'v', 's', 'd');
     else if (!strcasecmp(lavc_param_vcodec, "libx264"))
 	mux_v->bih->biCompression = mmioFOURCC('h', '2', '6', '4');
+    else if (!strcasecmp(lavc_param_vcodec, "libschroedinger"))
+	mux_v->bih->biCompression = mmioFOURCC('d', 'r', 'a', 'c');
+    else if (!strcasecmp(lavc_param_vcodec, "libdirac"))
+	mux_v->bih->biCompression = mmioFOURCC('d', 'r', 'a', 'c');
     else
 	mux_v->bih->biCompression = mmioFOURCC(lavc_param_vcodec[0],
 		lavc_param_vcodec[1], lavc_param_vcodec[2], lavc_param_vcodec[3]); /* FIXME!!! */