[FFmpeg-devel] Support master branch of OpenJPEG and Grok J2K codecs

Tobias Rapp t.rapp at noa-archive.com
Mon Apr 4 09:39:26 CEST 2016


On 04.04.2016 02:36, Aaron Boxer wrote:
> [...]
 >
> Thanks, Michael. Here is an updated patch with the bpp change removed.
>
> Aaron
>
> From fb7551a8f9fe6a5317f01c9f33a76f8ae67ad979 Mon Sep 17 00:00:00 2001
> From: Aaron Boxer <boxerab at gmail.com>
> Date: Sun, 3 Apr 2016 20:30:04 -0400
> Subject: [PATCH] Support the following jpeg 2000 codecs:
>
> a) latest release of openjpeg (2.1)
> b) master branch of openjpeg
> c) grok (https://github.com/GrokImageCompression/grok)
>
> The following changes were made:
>
> 1. Removed OPJ_STATIC flag in configure: in master branch of openjpeg and in grok, this flag indicates a static build, so codec API functions are marked as hidden. This prevents FFmpeg from using a dynamic build of these codecs.
> 2. link to libdl. This is needed by grok, as it supports a plugin architecture that allows plugins to be dynamically loaded at runtime.
>
> I have tested these changes with openjpeg 2.1, openjpeg master, and grok master.Test was to make sure ./configure and make showed no errors, and then to decompress a J2K file.  Everything worked for all three configurations, with no errors.
> ---
>  configure                   | 2 +-
>  libavcodec/libopenjpegdec.c | 2 +-
>  libavcodec/libopenjpegenc.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 94a66d8..4e81385 100755
> --- a/configure
> +++ b/configure
> @@ -5561,7 +5561,7 @@ enabled libopencv         && { check_header opencv2/core/core_c.h &&
>                                   require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
>                                 require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
>  enabled libopenh264       && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
> -enabled libopenjpeg       && { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
> +enabled libopenjpeg       && { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -ldl ||

This breaks (cross-)compilation of FFmpeg and OpenJpeg-2.1 with mingw-64 
on my machine.

>                                 check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
>                                 check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
>                                 check_lib openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
> diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c
> index 65167e6..f116c8b 100644
> --- a/libavcodec/libopenjpegdec.c
> +++ b/libavcodec/libopenjpegdec.c
> @@ -24,7 +24,7 @@
>   * JPEG 2000 decoder using libopenjpeg
>   */
>
> -#define  OPJ_STATIC
> +
>
>  #include "libavutil/common.h"
>  #include "libavutil/imgutils.h"
> diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c
> index 56c8219..e544445 100644
> --- a/libavcodec/libopenjpegenc.c
> +++ b/libavcodec/libopenjpegenc.c
> @@ -24,7 +24,7 @@
>   * JPEG 2000 encoder using libopenjpeg
>   */
>
> -#define  OPJ_STATIC
> +
>
>  #include "libavutil/avassert.h"
>  #include "libavutil/common.h"
> --
> 2.6.3.windows.1
>

Regards,
Tobias



More information about the ffmpeg-devel mailing list