[vlc-devel] [PATCH] avcodec: add handling of JPEG2000 codec

Nicolas Bertrand nicoinattendu at gmail.com
Mon Apr 29 17:18:08 CEST 2013


Added also option  avcodec-lowres
---
 modules/codec/avcodec/avcodec.c |    4 ++++
 modules/codec/avcodec/avcodec.h |    3 +++
 modules/codec/avcodec/chroma.c  |    6 +++++-
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index b126d7a..8927621 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -133,6 +133,8 @@ vlc_module_begin ()
         true )
 #endif
 
+    add_integer("avcodec-lowres", 0, LOWRES_TEXT, LOWRES_LONG_TEXT, true);
+
     add_obsolete_integer( "ffmpeg-debug" ) /* removed since 2.1.0 */
     add_integer( "avcodec-debug", 0, DEBUG_TEXT, DEBUG_LONGTEXT,
                  true )
@@ -301,6 +303,8 @@ static int OpenDecoder( vlc_object_t *p_this )
     p_context->debug = var_InheritInteger( p_dec, "avcodec-debug" );
     p_context->opaque = (void *)p_this;
 
+    p_context->lowres  = var_InheritInteger( p_dec, "avcodec-lowres" );
+
     /* set CPU capabilities */
 #if LIBAVUTIL_VERSION_CHECK(51, 25, 0, 42, 100)
     av_set_cpu_flags_mask( INT_MAX & ~GetVlcDspMask() );
diff --git a/modules/codec/avcodec/avcodec.h b/modules/codec/avcodec/avcodec.h
index 1716733..bf0b4a1 100644
--- a/modules/codec/avcodec/avcodec.h
+++ b/modules/codec/avcodec/avcodec.h
@@ -144,6 +144,9 @@ int ffmpeg_OpenCodec( decoder_t *p_dec );
 #define THREADS_TEXT N_( "Threads" )
 #define THREADS_LONGTEXT N_( "Number of threads used for decoding, 0 meaning auto" )
 
+#define LOWRES_TEXT N_("Video in low resolutions")
+#define LOWRES_LONG_TEXT N_( \
+     "Decode at 1 = 1/2, 2 = 1/4, 3 = 1/8, ...,of original resolution size" )
 /*
  * Encoder options
  */
diff --git a/modules/codec/avcodec/chroma.c b/modules/codec/avcodec/chroma.c
index 8d439a3..e366ae6 100644
--- a/modules/codec/avcodec/chroma.c
+++ b/modules/codec/avcodec/chroma.c
@@ -31,6 +31,7 @@
 
 #include <libavutil/avutil.h>
 #include <libavutil/pixfmt.h>
+#include <libavcodec/version.h>
 #include "chroma.h"
 
 /*****************************************************************************
@@ -120,7 +121,10 @@ static const struct
      /* Paletized RGB */
     {VLC_CODEC_RGBP, PIX_FMT_PAL8, 0, 0, 0},
 
-
+    /* XYZ */
+#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT( 52, 27, 0 )
+    {VLC_CODEC_XYZ12, AV_PIX_FMT_XYZ12, 0xfff0, 0xfff0, 0xfff0},
+#endif
     { 0, 0, 0, 0, 0 }
 };
 
-- 
1.7.9.5




More information about the vlc-devel mailing list