From patchwork Mon Jun 26 21:55:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 4129 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp1324625vsb; Mon, 26 Jun 2017 14:55:53 -0700 (PDT) X-Received: by 10.223.153.114 with SMTP id x105mr15790285wrb.18.1498514153328; Mon, 26 Jun 2017 14:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498514153; cv=none; d=google.com; s=arc-20160816; b=znghijuH3rnwA8KJ+T7dfa7kPOD3jgkGU7c+y03lBCVZBQTFDnVfEar9nlUZs1lOFB 298OApWuRGBKbrGZ3lsyGfCwmtNc9iTmp7qn+fVoa70ocwzTTzXyKCda4l3wBMzg689n e4vnsCreCWwDtp5phVrftUPRmXe6ibLI5/XFzgOprSqJGLFb3wSUOcn5mRdo7yLYHwXU i4PhL0fnCdHshEI5xypoYZ4kaayEN6qc7bMzbSLJkS/4ftWFf3QJmUq91Jol9kX3Gkmg XJ+FrzgT/f6hy2Z95RiwG8mR2bp8XZ8I3VcoeEsOZIChNPTAoMvkuE69miaBVq3wuA0F WmJg== 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: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=6Q09FXE/f5m79/xMtXT3g6S3qNFZAsVfYkYSKcAQaZQ=; b=CENWh7I9YzEnwnGMQv8xf3kDUBW1ACq0fqg2SrWmaLh8euFp/wGluCn/XQXv4tqtiW YdQzOW1jKRtNwNV+qMsRPpivYf92sAohrhhyuUz6UuC+FuTcbyd8xjRQ4RrliboCyLMS +wlXkHLUcw9SEYIDtht3Xxw3HhyvRDjWnYCNNSxXOUlfhsqmoyQc86egtzLz46emyPNb otMLrnTJC8Sa1Q+J4lZSnyXUpmVFh/YEyPvSETdDoECWZ7+InAVUpaJVXmsdt9pJRzhf dpC8L0awBIcG4ggK/Z98si1mOlTTbHZkT3UAV6AlUuR92h5fUq53koZen2gTy6Msp51m RJnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.b=OWw96nMB; 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 o63si837060wme.171.2017.06.26.14.55.52; Mon, 26 Jun 2017 14:55:53 -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.b=OWw96nMB; 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 A2A7468A384; Tue, 27 Jun 2017 00:55:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 759F5689D45 for ; Tue, 27 Jun 2017 00:55:45 +0300 (EEST) Received: by mail-wm0-f67.google.com with SMTP id 131so2629116wmq.2 for ; Mon, 26 Jun 2017 14:55:47 -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=iXdeAdAK2AmBF9GdfVYwurwV80d7tVucjK/O1Qn7qrI=; b=OWw96nMBmGDCTtr63RlZGMJBsFac76MgZjeml8z6p+ULZp/VCbAWarjcf5rXIKg0Dc grYxMv5R/af2/wkUBz1hT6yz5fOv2J9SsKet6gmwpkQ1Us5QwC6f4yF7kTK0hFMJD/hi UOVGAJFgPqD+1ZR+n/MlEM/Vceo4h9lITUyjpXFCSqzmD6VXSYQFhgtmBiE0Myyl6AKl 1Ddcl3DsP6RGp4jcMEBhciznBIUGC+VOdCCaNoWQZpIiubZdza5IGNDL/g9MrvhuprK3 x2hszsfwLYQh6klz2MWLJN8UcCkxmthxqjbmqbA66Ow7XjFEwBjLwROYhzBoxXyLr1Sz mcTw== 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=iXdeAdAK2AmBF9GdfVYwurwV80d7tVucjK/O1Qn7qrI=; b=eWCPjY8M1N0LWReHchoUDDTFXfWd/bVsB4zX+DvW2u4/omGaWjLsdS1IjQUX2KZuAd MCLuJtb4NxthkmgAqztilKkaycd1Bl0XnRRsxtT2r7dA4Dt0cjFNeZj7IfMvECWnRDuU /6VtiNSsdN2EXCeyaw+GdJ7a+2AIlaHZYHqJH0nBzHPddtuOr+g/DU+jM+tqIm8ScizR OKb3TIqHVQ3K9pD7ON3zhLwEqFJi0uso1dY15G8ySzINLZ4c5G3cl/FpKSnbvfNyi/nt yCoORRwIMnLIkUcLjVz/+h5Yv7nMxIkDzk9zxyXDUZKyD9aHljsgSJk/rvHF0o1LuHIQ 3u7Q== X-Gm-Message-State: AKS2vOyaO/cHb1DtuRc9BZtieL4FNcwUwHtakgNrJV6AnpCgPMoYueAs WK3DMJKmvYmxZhm+ X-Received: by 10.28.229.80 with SMTP id c77mr1101016wmh.31.1498514146671; Mon, 26 Jun 2017 14:55:46 -0700 (PDT) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id 69sm32924wmm.33.2017.06.26.14.55.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Jun 2017 14:55:45 -0700 (PDT) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Jun 2017 23:55:35 +0200 Message-Id: <20170626215535.24530-1-onemda@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170626140958.2881-1-onemda@gmail.com> References: <20170626140958.2881-1-onemda@gmail.com> Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/proresenc: switch default prores encoder to prores_ks 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" Rationale: prores_ks have more features and is faster for qscale > 0 and gives better quality output. Signed-off-by: Paul B Mahol --- libavcodec/Makefile | 2 +- libavcodec/proresenc_anatoliy.c | 14 -------------- libavcodec/proresenc_kostya.c | 24 ++++++++++++++++++++++++ tests/fate/vcodec.mak | 1 + tests/ref/vsynth/vsynth1-prores | 8 ++++---- tests/ref/vsynth/vsynth2-prores | 8 ++++---- tests/ref/vsynth/vsynth3-prores | 8 ++++---- 7 files changed, 38 insertions(+), 27 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index f0cba88..16dce40 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -477,7 +477,7 @@ OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o proresdsp.o proresdata.o OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o proresdata.o -OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o +OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_kostya.o proresdata.o OBJS-$(CONFIG_PRORES_AW_ENCODER) += proresenc_anatoliy.o OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o OBJS-$(CONFIG_PSD_DECODER) += psd.o diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 0516066..7ff6ff7 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -614,17 +614,3 @@ AVCodec ff_prores_aw_encoder = { .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY, .profiles = profiles }; - -AVCodec ff_prores_encoder = { - .name = "prores", - .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_PRORES, - .priv_data_size = sizeof(ProresContext), - .init = prores_encode_init, - .close = prores_encode_close, - .encode2 = prores_encode_frame, - .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE}, - .capabilities = AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY, - .profiles = profiles -}; diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 09bb611..ad979c2 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -1341,6 +1341,13 @@ static const AVClass proresenc_class = { .version = LIBAVUTIL_VERSION_INT, }; +static const AVClass prores_class = { + .class_name = "ProRes", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + AVCodec ff_prores_ks_encoder = { .name = "prores_ks", .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), @@ -1357,3 +1364,20 @@ AVCodec ff_prores_ks_encoder = { }, .priv_class = &proresenc_class, }; + +AVCodec ff_prores_encoder = { + .name = "prores", + .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_PRORES, + .priv_data_size = sizeof(ProresContext), + .init = encode_init, + .close = encode_close, + .encode2 = encode_frame, + .capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_INTRA_ONLY, + .pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, + AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE + }, + .priv_class = &prores_class, +}; diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak index 8c24510..3e92f3c 100644 --- a/tests/fate/vcodec.mak +++ b/tests/fate/vcodec.mak @@ -329,6 +329,7 @@ fate-vsynth%-mpng: CODEC = png FATE_VCODEC-$(call ENCDEC, MSVIDEO1, AVI) += msvideo1 FATE_VCODEC-$(call ENCDEC, PRORES, MOV) += prores prores_ks +fate-vsynth%-prores: ENCOPTS = -qscale:v 1 fate-vsynth%-prores: FMT = mov fate-vsynth%-prores_ks: ENCOPTS = -profile hq diff --git a/tests/ref/vsynth/vsynth1-prores b/tests/ref/vsynth/vsynth1-prores index 14de8b9..bf7adaa 100644 --- a/tests/ref/vsynth/vsynth1-prores +++ b/tests/ref/vsynth/vsynth1-prores @@ -1,4 +1,4 @@ -7ca7d2f9f5d8ac2ead691b1b6a70d409 *tests/data/fate/vsynth1-prores.mov -5022821 tests/data/fate/vsynth1-prores.mov -fb4a9e025d12afc0dbbca8d82831858f *tests/data/fate/vsynth1-prores.out.rawvideo -stddev: 2.47 PSNR: 40.27 MAXDIFF: 31 bytes: 7603200/ 7603200 +58d0065f5a67a7fa70e7443ac82c336d *tests/data/fate/vsynth1-prores.mov +10690091 tests/data/fate/vsynth1-prores.mov +b059fbb85caccfb6e5ad7fe402e2539b *tests/data/fate/vsynth1-prores.out.rawvideo +stddev: 1.88 PSNR: 42.64 MAXDIFF: 29 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth2-prores b/tests/ref/vsynth/vsynth2-prores index a1b4bb7..6e9a397 100644 --- a/tests/ref/vsynth/vsynth2-prores +++ b/tests/ref/vsynth/vsynth2-prores @@ -1,4 +1,4 @@ -aa57fd1221b7eefaf1f34f9d57d6a7cb *tests/data/fate/vsynth2-prores.mov -3265056 tests/data/fate/vsynth2-prores.mov -537b0ff66d7c8c3c12faa89d042e6a49 *tests/data/fate/vsynth2-prores.out.rawvideo -stddev: 1.38 PSNR: 45.29 MAXDIFF: 12 bytes: 7603200/ 7603200 +4240da05dc68221a36071cbe3a846877 *tests/data/fate/vsynth2-prores.mov +8463884 tests/data/fate/vsynth2-prores.mov +0ed1c1b659beb23928388a34a988786b *tests/data/fate/vsynth2-prores.out.rawvideo +stddev: 0.47 PSNR: 54.57 MAXDIFF: 9 bytes: 7603200/ 7603200 diff --git a/tests/ref/vsynth/vsynth3-prores b/tests/ref/vsynth/vsynth3-prores index f63a7a7..f772805 100644 --- a/tests/ref/vsynth/vsynth3-prores +++ b/tests/ref/vsynth/vsynth3-prores @@ -1,4 +1,4 @@ -b060c59be88b4b089ece5ee8dc4f1c58 *tests/data/fate/vsynth3-prores.mov -105367 tests/data/fate/vsynth3-prores.mov -fff5e7ad21d78501c8fa4749bf4bf289 *tests/data/fate/vsynth3-prores.out.rawvideo -stddev: 2.80 PSNR: 39.17 MAXDIFF: 27 bytes: 86700/ 86700 +5919b3ca66dd7b5f37fd30e82e033fad *tests/data/fate/vsynth3-prores.mov +196893 tests/data/fate/vsynth3-prores.mov +81df91f1f0fd6693ff89c7743df631ea *tests/data/fate/vsynth3-prores.out.rawvideo +stddev: 2.15 PSNR: 41.46 MAXDIFF: 26 bytes: 86700/ 86700