From patchwork Fri Nov 2 19:35:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vittorio Giovara X-Patchwork-Id: 10903 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9AA5B44E2C7 for ; Fri, 2 Nov 2018 21:42:26 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F2B668A9FE; Fri, 2 Nov 2018 21:41:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D01BD68A991 for ; Fri, 2 Nov 2018 21:41:51 +0200 (EET) Received: by mail-qk1-f195.google.com with SMTP id o89so4951828qko.0 for ; Fri, 02 Nov 2018 12:42:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=2iORQh20oal/ijyOI0tAy0KPM1PIvSAGc8+U+6BGIE0=; b=t0GCF0P9QXiEZWv0eNQgnbe3uYLOucTzEiwqTLYkaJ+8pLmnSB4k19+/qArVcgQlAj FTBh1E8OvJz4oV86k4qdi5FMxtq/2z4YxlrC8ULauK7oQL9BeW5zxHFgIBkU6tn4p8WH dVdrNFGYpvu2Vcm07CJ4/+IYsIVrRqR+qN3HgkhDupxpVu+GJwitW5M/4vL04CNpp/s7 4BsMgoaLNrzJPF4TI223DegCrNUP96WqOjZ/Ow0oxNaKLBpmUXAavOsJxk38Y4HBIxYb O40P4hOCWzKOMCC6yeEn05xKg1Xc5h/sed0Uy3ushm4ueohQd6MGYlhrlELq2FjNW2cB WxpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=2iORQh20oal/ijyOI0tAy0KPM1PIvSAGc8+U+6BGIE0=; b=WakrPaT5DRnnDMT3tH15/upIHkyrp+Vx2CuxBdFxe8LhIwWEUq2BzJI+A20dvFpYXJ T27u/wEfCpnGEoTpjdYNIObRqeHS35NXMIGAQU9/GWdjyW7uMzs5qE05IQJVEfAV8P5O iKhxABsj2YM+jXmjy0VnnyUc8dMx24P+H++XVJpaIQybuyr/04mcn/Y5FoHwyY1Cq3Wg aa04BSzjbvVwyPyLjgw8iq0WSLwu9WjQ+nADXmOUtTONN6VcBSpYH91hkndiIWLkw+Fz iD8nvvAejCRdzfr2ewjxjLhTLzdaCjz20mZlo2AhY2i/sNUTRpDPhYB8j9QZ0q7fUwxX XlPg== X-Gm-Message-State: AGRZ1gI6d0w+/QvuS1LL/tqhupBmN7a0cipN91Q1whG4eAKRCgHL65Jx ec5jBbWkTnvd63PtuzD7t6Vx3Hls X-Google-Smtp-Source: AJdET5fnG73hB/qk18VFPtNYIc3bHvHuzsTcbqnLDj5hXZZlopeCuYbVFp2TB2QDMYhyryPoCbxTLQ== X-Received: by 2002:aed:220f:: with SMTP id n15-v6mr11713815qtc.288.1541187350215; Fri, 02 Nov 2018 12:35:50 -0700 (PDT) Received: from vimacnew.iac.corp ([8.40.92.161]) by smtp.gmail.com with ESMTPSA id s21-v6sm27318555qth.11.2018.11.02.12.35.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 12:35:49 -0700 (PDT) From: Vittorio Giovara To: ffmpeg-devel@ffmpeg.org Date: Fri, 2 Nov 2018 15:35:38 -0400 Message-Id: <20181102193540.64694-2-vittorio.giovara@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181102193540.64694-1-vittorio.giovara@gmail.com> References: <20181102193540.64694-1-vittorio.giovara@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/4] prores: Use profile names in the various encoders and decoders 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Export FF_PROFILE_PRORES_* symbols to the public header. --- libavcodec/avcodec.h | 7 +++++++ libavcodec/codec_desc.c | 1 + libavcodec/profiles.c | 10 ++++++++++ libavcodec/profiles.h | 1 + libavcodec/proresdec2.c | 2 ++ libavcodec/proresenc_anatoliy.c | 11 +++-------- libavcodec/proresenc_kostya.c | 2 ++ libavcodec/version.h | 4 ++-- 8 files changed, 28 insertions(+), 10 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 705a3ce4f3..cff821c3d4 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2960,6 +2960,13 @@ typedef struct AVCodecContext { #define FF_PROFILE_SBC_MSBC 1 +#define FF_PROFILE_PRORES_PROXY 0 +#define FF_PROFILE_PRORES_LT 1 +#define FF_PROFILE_PRORES_STANDARD 2 +#define FF_PROFILE_PRORES_HQ 3 +#define FF_PROFILE_PRORES_4444 4 +#define FF_PROFILE_PRORES_XQ 5 + /** * level * - encoding: Set by user. diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index 67a30542d1..ce6d265d13 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -1077,6 +1077,7 @@ static const AVCodecDescriptor codec_descriptors[] = { .name = "prores", .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), }, { .id = AV_CODEC_ID_JV, diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c index c31399f83e..8a4447e438 100644 --- a/libavcodec/profiles.c +++ b/libavcodec/profiles.c @@ -151,4 +151,14 @@ const AVProfile ff_sbc_profiles[] = { { FF_PROFILE_UNKNOWN }, }; +const AVProfile ff_prores_profiles[] = { + { FF_PROFILE_PRORES_PROXY, "Proxy" }, + { FF_PROFILE_PRORES_LT, "LT" }, + { FF_PROFILE_PRORES_STANDARD, "Standard" }, + { FF_PROFILE_PRORES_HQ, "HQ" }, + { FF_PROFILE_PRORES_4444, "4444" }, + { FF_PROFILE_PRORES_XQ, "XQ" }, + { FF_PROFILE_UNKNOWN } +}; + #endif /* !CONFIG_SMALL */ diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h index 9d7e211e15..4669dad8d5 100644 --- a/libavcodec/profiles.h +++ b/libavcodec/profiles.h @@ -33,5 +33,6 @@ extern const AVProfile ff_vc1_profiles[]; extern const AVProfile ff_vp9_profiles[]; extern const AVProfile ff_av1_profiles[]; extern const AVProfile ff_sbc_profiles[]; +extern const AVProfile ff_prores_profiles[]; #endif /* AVCODEC_PROFILES_H */ diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index d818e5d8da..6b3021bdfa 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -33,6 +33,7 @@ #include "get_bits.h" #include "idctdsp.h" #include "internal.h" +#include "profiles.h" #include "simple_idct.h" #include "proresdec.h" #include "proresdata.h" @@ -730,4 +731,5 @@ AVCodec ff_prores_decoder = { .close = decode_close, .decode = decode_frame, .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS, + .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), }; diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index dbbf13f4c0..f35f049a78 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "dct.h" #include "internal.h" +#include "profiles.h" #include "proresdata.h" #include "put_bits.h" #include "bytestream.h" @@ -37,12 +38,6 @@ #define DEFAULT_SLICE_MB_WIDTH 8 -#define FF_PROFILE_PRORES_PROXY 0 -#define FF_PROFILE_PRORES_LT 1 -#define FF_PROFILE_PRORES_STANDARD 2 -#define FF_PROFILE_PRORES_HQ 3 -#define FF_PROFILE_PRORES_4444 4 - static const AVProfile profiles[] = { { FF_PROFILE_PRORES_PROXY, "apco"}, { FF_PROFILE_PRORES_LT, "apcs"}, @@ -679,7 +674,7 @@ AVCodec ff_prores_aw_encoder = { .encode2 = prores_encode_frame, .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE}, .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY, - .profiles = profiles + .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), }; AVCodec ff_prores_encoder = { @@ -693,5 +688,5 @@ AVCodec ff_prores_encoder = { .encode2 = prores_encode_frame, .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE}, .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY, - .profiles = profiles + .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), }; diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 81f3865ea6..9a77d24fb6 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -28,6 +28,7 @@ #include "avcodec.h" #include "fdctdsp.h" #include "put_bits.h" +#include "profiles.h" #include "bytestream.h" #include "internal.h" #include "proresdata.h" @@ -1431,4 +1432,5 @@ AVCodec ff_prores_ks_encoder = { AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE }, .priv_class = &proresenc_class, + .profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), }; diff --git a/libavcodec/version.h b/libavcodec/version.h index 9098882f47..91809641b4 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -28,8 +28,8 @@ #include "libavutil/version.h" #define LIBAVCODEC_VERSION_MAJOR 58 -#define LIBAVCODEC_VERSION_MINOR 33 -#define LIBAVCODEC_VERSION_MICRO 102 +#define LIBAVCODEC_VERSION_MINOR 34 +#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \