From patchwork Fri Nov 2 19:35:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vittorio Giovara X-Patchwork-Id: 10901 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 14E5F44E1E4 for ; Fri, 2 Nov 2018 21:35:57 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8864F68AA03; Fri, 2 Nov 2018 21:35:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5E59768A9C4 for ; Fri, 2 Nov 2018 21:35:20 +0200 (EET) Received: by mail-qk1-f172.google.com with SMTP id o89so4923248qko.0 for ; Fri, 02 Nov 2018 12:35:53 -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=lXJOrwEO4J5v674KxB/ObRRUDvd6Att+X2n/Yh/KJK0=; b=CYbNd6yChxEA4p+lqqTWcQTpaWUcv8TGLyhni2jGr1u+Ahq01WnV+TX5lh68YFFOUc ueQMmzIEI3rlxbV7+Wl3KnqdIs7iRhv19/av9KKDa2n4FGk+QV9uRPhYZITSCyOGf8w/ gc4ABkWO1zphIhkLBBoQ3fOM3w3tx6HE2MY61siJsx9ZbjPT9LM7D1AkCyPq9P2YfXgq jhRqfhpyzj3c++AdU9lC50akls46wEWE7fK9GWjXBBKQSI6alQL1XK7PMmcd3UW4BiuO QCvxo9Xv69Ip/mceG1J4fo87PkZqSt+rt0vnx84aS0199nM4yVmWuAhjAQknsP+GDnM2 QUgA== 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=lXJOrwEO4J5v674KxB/ObRRUDvd6Att+X2n/Yh/KJK0=; b=TKEwbx9fehBz1ZKuggJmGv/xNQ0NDyrvcnSW2R/Ohgve7jLt0r40isnissGdxP70wN XH/zsGIaWpZnaSc0RtCkj1WKZBInvS87K0BaWos6UXljuaC0gtZvkjmoKkZBwj54uhkw 0kITYJwoYIBeplUpFnw+e9078NAxCAcTW6rulHus/4PKsC4+/gFE5QWnyGmJKw+fcErQ y7i4tt4ushMxz3T7Nh8F/0rmv42HTkwqphez8JIlk14tk+af32Gi/1zcDFjapBo93wpk c/DnLHYjvN9uc1ojYGIeTqpapEjZqfnwnnKScOiUXITTuPaOFebUlqZqEElSfoylQxNA H2CQ== X-Gm-Message-State: AGRZ1gJwLW+MoM8ncgWpRa0qtJzAO+EL3TgFD9IjZt7Ogt+y1x/0ygb2 0qR2PZSZkeMqprzZINrK+cDmFNfO X-Google-Smtp-Source: AJdET5d3xjCGuVpwWLO7CZzkeXX3bmFj48w4xf1iTt4XqqoMGPW4JtePGxY2ZvF16rDesmqIHTksag== X-Received: by 2002:aed:3a29:: with SMTP id n38-v6mr11845156qte.111.1541187351955; Fri, 02 Nov 2018 12:35:51 -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.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 12:35:51 -0700 (PDT) From: Vittorio Giovara To: ffmpeg-devel@ffmpeg.org Date: Fri, 2 Nov 2018 15:35:40 -0400 Message-Id: <20181102193540.64694-4-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 4/4] mjpeg: Use profile names in the encoder and decoder 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" --- libavcodec/codec_desc.c | 1 + libavcodec/mjpegdec.c | 2 ++ libavcodec/profiles.c | 9 +++++++++ libavcodec/profiles.h | 1 + libavcodec/version.h | 2 +- 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c index ce6d265d13..7bf39862d2 100644 --- a/libavcodec/codec_desc.c +++ b/libavcodec/codec_desc.c @@ -81,6 +81,7 @@ static const AVCodecDescriptor codec_descriptors[] = { .long_name = NULL_IF_CONFIG_SMALL("Motion JPEG"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, .mime_types= MT("image/jpeg"), + .profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles), }, { .id = AV_CODEC_ID_MJPEGB, diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index b0cb3ffc83..96c425515a 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -43,6 +43,7 @@ #include "mjpeg.h" #include "mjpegdec.h" #include "jpeglsdec.h" +#include "profiles.h" #include "put_bits.h" #include "tiff.h" #include "exif.h" @@ -2796,6 +2797,7 @@ AVCodec ff_mjpeg_decoder = { .capabilities = AV_CODEC_CAP_DR1, .max_lowres = 3, .priv_class = &mjpegdec_class, + .profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles), .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM, .hw_configs = (const AVCodecHWConfigInternal*[]) { diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c index 8a4447e438..e6f937fdb4 100644 --- a/libavcodec/profiles.c +++ b/libavcodec/profiles.c @@ -161,4 +161,13 @@ const AVProfile ff_prores_profiles[] = { { FF_PROFILE_UNKNOWN } }; +const AVProfile ff_mjpeg_profiles[] = { + { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" }, + { FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" }, + { FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" }, + { FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" }, + { FF_PROFILE_MJPEG_JPEG_LS, "JPEG LS" }, + { FF_PROFILE_UNKNOWN } +}; + #endif /* !CONFIG_SMALL */ diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h index 4669dad8d5..ab61e03e15 100644 --- a/libavcodec/profiles.h +++ b/libavcodec/profiles.h @@ -34,5 +34,6 @@ extern const AVProfile ff_vp9_profiles[]; extern const AVProfile ff_av1_profiles[]; extern const AVProfile ff_sbc_profiles[]; extern const AVProfile ff_prores_profiles[]; +extern const AVProfile ff_mjpeg_profiles[]; #endif /* AVCODEC_PROFILES_H */ diff --git a/libavcodec/version.h b/libavcodec/version.h index d2ac30d4a8..068004ac9d 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 34 -#define LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MICRO 102 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \