From patchwork Thu Oct 5 13:45:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Bradshaw X-Patchwork-Id: 5425 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.76 with SMTP id m12csp2054930jah; Thu, 5 Oct 2017 06:51:22 -0700 (PDT) X-Received: by 10.28.101.133 with SMTP id z127mr19593380wmb.123.1507211482506; Thu, 05 Oct 2017 06:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507211482; cv=none; d=google.com; s=arc-20160816; b=qZp/k7nH5Eqyeio4YVGe2oeZ88rjATE3uVQdj18imSe6ffBmPvmR6erF05aO8YT5uV aa1TT1OAMSgiCa6tIH3UrJp+hF+BbaW3e2jR2Q0R9yW4Z+pT8uIZWPd1nMbtexYT6+Kd AnFZbLo6XrdJiURc9H6Q85r2l/RXPGPnL3WORHUBuSvVQAVMrDE9Lev7eTIpoZY5i+Fi AHTK1DeovwR8mcGx5ZCXVU4LYpA3a62Hnlkf6doZtN7TGlDSuSFhI2V+i9LcZJVcuCRV RPFIBz7k09879mFVahk4035vVxoYimwWT6CidXXwdhhQgfNik9XdMbOMm5IxOH3dxLGg p/Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=6fLK6rEZZoi3nwdjgoHoNro6kovaWsB1wHbv9xFdUaw=; b=eESVzq2XjNa0rSHxldvezs5QNkjcTjW8pXh9HEb4oNtXgZPgPSqw6xICgd0NRL6ecW RLc5siAhu27RERoEidOMZ77w9g0vjZSJjOa9lW3VuiC0LA99qbrGcc32cRStyhiGXM2C ooyUUApbeurG1ZF4YLpSnWH3plJjbP/pFrmDskq8YQtsX2u3Ylsh3KJBr/1VtH1RwMEn nZUSbhaIhiWAE3NgvQ41bQt+bb3vUytxp+oKYL3yFu506zrOZKtQy1rWQHOMKcUxuZmk wMTzkqZgUiEtLJN3zW/wrVu9k91VF/W/I9TKpNMT3MOjLxa7Rn2at2NdCdUPHfzd/INR Ruxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=QH7h3aVj; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id n16si3693631wrb.385.2017.10.05.06.51.21; Thu, 05 Oct 2017 06:51:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=QH7h3aVj; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2D6EA68A21D; Thu, 5 Oct 2017 16:51:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5EC8768A21D for ; Thu, 5 Oct 2017 16:50:55 +0300 (EEST) Received: by mail-pg0-f68.google.com with SMTP id i195so7385548pgd.3 for ; Thu, 05 Oct 2017 06:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QKquq4UVPHvoND3Y+MANVXfP/3+N2Q7IP5wu2tEbZf8=; b=QH7h3aVjujrGt2y34IjUWLIJk4xucDfHLiq5BBA2GikZZZgkgfOkYMyy+U0CViu1/o dgQajg2xfodsPL484q7mWvtZzn2h2/K/fOyYmsb0XB9SXL00ifLBFgm9iCBI7AWE89Pk 4OqhbVprpzcSr2ZnELBLx5RlSJRW/ClV4ALycDrSyJBCdOj7afjWs0xD3zwEU5UzTsI4 +OdRXi3EFa0Xt4Z7Ub/VV5xBeV3ygUxY3IFBjZm5xtJ6sLvUnBDvpdHZyZy910snvSSP 8nyqbAlMeQT9bRj/6C0jtu58RbOVsIJZhO1iBGXBf4iedulewI0DtaNFyPQe5Gptajx7 iq+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QKquq4UVPHvoND3Y+MANVXfP/3+N2Q7IP5wu2tEbZf8=; b=aJWlaPhx89noL50GnIG6XXPUE3mqrQ6RpBfu9Tv1squy1rF70lsUnFa/6YoACjggTp WdA9Cbc3jsD22nZTNRGdjleloiZpM0MQrHpB4gyH3YGXlarVy0vz1XIbCePxbZU7o6BT WgWagFLICPINmicC+PhZiWSrEbcBVjznPs7IGh3I3k5NuMdj/tG+jkMxQSECcKBEAxSv 6VTmlsuYYzWXZn53xdhEI0WyLMBPjnGxtm9MJjwlM7MAsKSd19AFKZckx/3JqPEd5EcL EJhiHhma6dNKO4PKCEHoWf7y5pWLNqhyLzW5Arp7DmbgeWCb7yh8PBZ8DzDemLS2FV9x 4rSw== X-Gm-Message-State: AHPjjUj7terp7RPqmwQ9qxF2iLFZ5kmtX7pP1ZSp16HeyukJ8NbvAIeq JZJhWYyUh/yAk3iR2Dwp988Lxdgt X-Google-Smtp-Source: AOwi7QDwBLx2hq0remcJCDWkS4lx0TTae6VPw39kDZtP2LOeQWRUAT4HDmyePvExbPqABuPqkYZcRA== X-Received: by 10.84.129.1 with SMTP id 1mr22610966plb.241.1507211138334; Thu, 05 Oct 2017 06:45:38 -0700 (PDT) Received: from localhost.localdomain (c-73-189-103-209.hsd1.ca.comcast.net. [73.189.103.209]) by smtp.gmail.com with ESMTPSA id z26sm32065021pfa.49.2017.10.05.06.45.37 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 05 Oct 2017 06:45:37 -0700 (PDT) From: Michael Bradshaw To: ffmpeg-devel@ffmpeg.org Date: Thu, 5 Oct 2017 06:45:35 -0700 Message-Id: <20171005134535.13208-2-mjbshaw@gmail.com> X-Mailer: git-send-email 2.13.5 (Apple Git-94) In-Reply-To: <20171005134535.13208-1-mjbshaw@gmail.com> References: <20171005134535.13208-1-mjbshaw@gmail.com> Subject: [FFmpeg-devel] [PATCH 1/1] lavc: add support for OpenJPEG 2.3.0 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Michael Bradshaw MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Michael Bradshaw Signed-off-by: Michael Bradshaw --- configure | 5 ++++- libavcodec/libopenjpegdec.c | 8 +++++--- libavcodec/libopenjpegenc.c | 10 ++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/configure b/configure index 391c141e7a..77c9a18c3c 100755 --- a/configure +++ b/configure @@ -1930,6 +1930,7 @@ HEADERS_LIST=" machine_ioctl_meteor_h malloc_h opencv2_core_core_c_h + openjpeg_2_3_openjpeg_h openjpeg_2_2_openjpeg_h openjpeg_2_1_openjpeg_h openjpeg_2_0_openjpeg_h @@ -5950,7 +5951,9 @@ enabled libopencv && { check_header opencv2/core/core_c.h && require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } || require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; } enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion -enabled libopenjpeg && { { check_lib libopenjpeg openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || +enabled libopenjpeg && { { check_lib libopenjpeg openjpeg-2.3/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || + check_lib libopenjpeg openjpeg-2.3/openjpeg.h opj_version -lopenjp2 || + { check_lib libopenjpeg openjpeg-2.2/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || check_lib libopenjpeg openjpeg-2.2/openjpeg.h opj_version -lopenjp2 || { check_lib libopenjpeg openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || check_lib libopenjpeg openjpeg-2.1/openjpeg.h opj_version -lopenjp2 || diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 1210123265..67d47bd6a0 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -34,7 +34,9 @@ #include "internal.h" #include "thread.h" -#if HAVE_OPENJPEG_2_2_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H +# include +#elif HAVE_OPENJPEG_2_2_OPENJPEG_H # include #elif HAVE_OPENJPEG_2_1_OPENJPEG_H # include @@ -46,7 +48,7 @@ # include #endif -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H # define OPENJPEG_MAJOR_VERSION 2 # define OPJ(x) OPJ_##x #else @@ -431,7 +433,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, opj_stream_set_read_function(stream, stream_read); opj_stream_set_skip_function(stream, stream_skip); opj_stream_set_seek_function(stream, stream_seek); -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H opj_stream_set_user_data(stream, &reader, NULL); #elif HAVE_OPENJPEG_2_0_OPENJPEG_H opj_stream_set_user_data(stream, &reader); diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index b67e533d1d..92b4433b04 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -32,7 +32,9 @@ #include "avcodec.h" #include "internal.h" -#if HAVE_OPENJPEG_2_2_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H +# include +#elif HAVE_OPENJPEG_2_2_OPENJPEG_H # include #elif HAVE_OPENJPEG_2_1_OPENJPEG_H # include @@ -44,7 +46,7 @@ # include #endif -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H || HAVE_OPENJPEG_2_0_OPENJPEG_H # define OPENJPEG_MAJOR_VERSION 2 # define OPJ(x) OPJ_##x #else @@ -307,7 +309,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx) opj_set_default_encoder_parameters(&ctx->enc_params); -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H switch (ctx->cinema_mode) { case OPJ_CINEMA2K_24: ctx->enc_params.rsiz = OPJ_PROFILE_CINEMA_2K; @@ -771,7 +773,7 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, opj_stream_set_write_function(stream, stream_write); opj_stream_set_skip_function(stream, stream_skip); opj_stream_set_seek_function(stream, stream_seek); -#if HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H +#if HAVE_OPENJPEG_2_3_OPENJPEG_H || HAVE_OPENJPEG_2_2_OPENJPEG_H || HAVE_OPENJPEG_2_1_OPENJPEG_H opj_stream_set_user_data(stream, &writer, NULL); #elif HAVE_OPENJPEG_2_0_OPENJPEG_H opj_stream_set_user_data(stream, &writer);