From 9ab7482657aa6a5b968c894be37a2d16aa301293 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 3 Feb 2016 18:31:39 +1100 Subject: Imbuf: remove libredcode D1751, remove this library since its quite a specific - only supports an older version of this codec. Also ffmpeg has added support for recent versions of the codec. --- source/blender/imbuf/CMakeLists.txt | 7 -- source/blender/imbuf/intern/IMB_anim.h | 9 --- source/blender/imbuf/intern/anim_movie.c | 83 ---------------------- source/blender/imbuf/intern/util.c | 16 ----- source/blender/python/intern/CMakeLists.txt | 4 -- .../blender/python/intern/bpy_app_build_options.c | 7 -- 6 files changed, 126 deletions(-) (limited to 'source/blender') diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index abbc5a09040..b32f8c54cd6 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -123,13 +123,6 @@ if(WITH_IMAGE_OPENJPEG) add_definitions(-DWITH_OPENJPEG ${OPENJPEG_DEFINES}) endif() -if(WITH_IMAGE_REDCODE) - list(APPEND INC_SYS - ${REDCODE_INC} - ) - add_definitions(-DWITH_REDCODE) -endif() - if(WITH_CODEC_AVI) list(APPEND INC ../avi diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index 690ec813407..537cde9ac5c 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -78,10 +78,6 @@ # include #endif -#ifdef WITH_REDCODE -# include "libredcode/format.h" -#endif - #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -111,7 +107,6 @@ #define ANIM_AVI (1 << 6) #define ANIM_QTIME (1 << 7) #define ANIM_FFMPEG (1 << 8) -#define ANIM_REDCODE (1 << 9) #define MAXNUMSTREAMS 50 @@ -177,10 +172,6 @@ struct anim { AVPacket next_packet; #endif -#ifdef WITH_REDCODE - struct redcode_handle *redcodeCtx; -#endif - char index_dir[768]; int proxies_tried; diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 4ace72d9fa4..e2da2e46478 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -98,11 +98,6 @@ #endif //WITH_FFMPEG -#ifdef WITH_REDCODE -# include "libredcode/format.h" -# include "libredcode/codec.h" -#endif - #include "IMB_colormanagement.h" #include "IMB_colormanagement_intern.h" @@ -216,9 +211,6 @@ static void free_anim_avi(struct anim *anim) #ifdef WITH_FFMPEG static void free_anim_ffmpeg(struct anim *anim); #endif -#ifdef WITH_REDCODE -static void free_anim_redcode(struct anim *anim); -#endif void IMB_free_anim(struct anim *anim) { @@ -238,9 +230,6 @@ void IMB_free_anim(struct anim *anim) #endif #ifdef WITH_FFMPEG free_anim_ffmpeg(anim); -#endif -#ifdef WITH_REDCODE - free_anim_redcode(anim); #endif IMB_free_indices(anim); @@ -1164,62 +1153,6 @@ static void free_anim_ffmpeg(struct anim *anim) #endif -#ifdef WITH_REDCODE - -static int startredcode(struct anim *anim) -{ - anim->redcodeCtx = redcode_open(anim->name); - if (!anim->redcodeCtx) { - return -1; - } - anim->duration = redcode_get_length(anim->redcodeCtx); - - return 0; -} - -static ImBuf *redcode_fetchibuf(struct anim *anim, int position) -{ - struct ImBuf *ibuf; - struct redcode_frame *frame; - struct redcode_frame_raw *raw_frame; - - if (!anim->redcodeCtx) { - return NULL; - } - - frame = redcode_read_video_frame(anim->redcodeCtx, position); - - if (!frame) { - return NULL; - } - - raw_frame = redcode_decode_video_raw(frame, 1); - - redcode_free_frame(frame); - - if (!raw_frame) { - return NULL; - } - - ibuf = IMB_allocImBuf(raw_frame->width * 2, - raw_frame->height * 2, 32, IB_rectfloat); - - redcode_decode_video_float(raw_frame, ibuf->rect_float, 1); - - return ibuf; -} - -static void free_anim_redcode(struct anim *anim) -{ - if (anim->redcodeCtx) { - redcode_close(anim->redcodeCtx); - anim->redcodeCtx = 0; - } - anim->duration = 0; -} - -#endif - /* Try next picture to read */ /* No picture, try to open next animation */ /* Succeed, remove first image from animation */ @@ -1242,10 +1175,6 @@ static ImBuf *anim_getnew(struct anim *anim) #ifdef WITH_FFMPEG free_anim_ffmpeg(anim); #endif -#ifdef WITH_REDCODE - free_anim_redcode(anim); -#endif - if (anim->curtype != 0) return (NULL); anim->curtype = imb_get_anim_type(anim->name); @@ -1282,12 +1211,6 @@ static ImBuf *anim_getnew(struct anim *anim) if (startffmpeg(anim)) return (0); ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0); break; -#endif -#ifdef WITH_REDCODE - case ANIM_REDCODE: - if (startredcode(anim)) return (0); - ibuf = IMB_allocImBuf(8, 8, 32, 0); - break; #endif } return(ibuf); @@ -1394,12 +1317,6 @@ struct ImBuf *IMB_anim_absolute(struct anim *anim, int position, anim->curposition = position; filter_y = 0; /* done internally */ break; -#endif -#ifdef WITH_REDCODE - case ANIM_REDCODE: - ibuf = redcode_fetchibuf(anim, position); - if (ibuf) anim->curposition = position; - break; #endif } diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index ca793d04d9b..ba8480b636f 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -373,19 +373,6 @@ static int isffmpeg(const char *filename) } #endif -#ifdef WITH_REDCODE -static int isredcode(const char *filename) -{ - struct redcode_handle *h = redcode_open(filename); - if (!h) { - return 0; - } - redcode_close(h); - return 1; -} - -#endif - int imb_get_anim_type(const char *name) { int type; @@ -423,9 +410,6 @@ int imb_get_anim_type(const char *name) if (isavi(name)) return (ANIM_AVI); -#endif -#ifdef WITH_REDCODE - if (isredcode(name)) return (ANIM_REDCODE); #endif type = IMB_ispic(name); if (type) { diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index 5b39dbb062b..8ce94b8006f 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -199,10 +199,6 @@ if(WITH_IMAGE_OPENJPEG) add_definitions(-DWITH_OPENJPEG) endif() -if(WITH_IMAGE_REDCODE) - add_definitions(-DWITH_REDCODE) -endif() - if(WITH_IMAGE_TIFF) add_definitions(-DWITH_TIFF) endif() diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c index 692ebf552c7..4c186aab100 100644 --- a/source/blender/python/intern/bpy_app_build_options.c +++ b/source/blender/python/intern/bpy_app_build_options.c @@ -50,7 +50,6 @@ static PyStructSequence_Field app_builtopts_info_fields[] = { {(char *)"image_hdr", NULL}, {(char *)"image_openexr", NULL}, {(char *)"image_openjpeg", NULL}, - {(char *)"image_redcode", NULL}, {(char *)"image_tiff", NULL}, {(char *)"input_ndof", NULL}, {(char *)"audaspace", NULL}, @@ -190,12 +189,6 @@ static PyObject *make_builtopts_info(void) SetObjIncref(Py_False); #endif -#ifdef WITH_REDCODE - SetObjIncref(Py_True); -#else - SetObjIncref(Py_False); -#endif - #ifdef WITH_TIFF SetObjIncref(Py_True); #else -- cgit v1.2.3