From patchwork Mon Apr 20 17:12:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Birkbeck X-Patchwork-Id: 19106 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 278AC44BC24 for ; Mon, 20 Apr 2020 20:12:49 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 072A668B75D; Mon, 20 Apr 2020 20:12:49 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C53EA68B6B3 for ; Mon, 20 Apr 2020 20:12:41 +0300 (EEST) Received: by mail-pf1-f169.google.com with SMTP id u9so5237168pfm.10 for ; Mon, 20 Apr 2020 10:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=YlMCeq4Nn0WaMZCO/b5hLtLfM4YlNyx8s47mfyeCSLs=; b=JDBYKq5//pE4scWam7cxA0yTjTONJTiYiwyzlM2mNj6cZsJbBN5PzdnAC5hLPe7GU8 +oOyC1rSB4ZiQ/zVDaHrUllHhP++QZRShUdwvjQNKTIHn84R9S9N00yXRjV9R4i1A+mY YqtRv0uupduq5AjLj8GbzJVPBQB+3il90GsoGdG03q8hjjlcpDQMFjmQiXg3W/RpyaoF eL8AlFCbhc70a7RnXHslcr4HRANYIkN4eiKS5Pf2et7wxJh2PMST6Lmq/a6dlOziResS Ibc1Tb26zYhvjYZmsXTdQE32ulSrlLZOnYFbuiQmmda7ePBGDdfJXdRn6Dy991Regp7F RhCA== 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:mime-version :content-transfer-encoding; bh=YlMCeq4Nn0WaMZCO/b5hLtLfM4YlNyx8s47mfyeCSLs=; b=W60e6fWDUolJ40OprdQjAoZ4G8R5Txdo41ns6tXC3kV+wvZAcgaPwpBByMkjZF74Fr VhC3mx9623R7e3Z1AIf54zPocymdWnpn1y7htaUWSgluzqQpSbREScvZwp1vPjEoG3nJ 4nvNQiQxg+fmHXH2NkRtDZSYJItlsM+gSUugzXhoZVxqdO12lNnoGrb37brRysRCSnF5 Z/Uwg2phnGpkHmgiVFb2zrIJ4gJwVmi0qfkiGFFi6i09PkHAmwW28wlc/rEXJOAL6W6a pMCDA/PTdn9TSXJIPRbdlyLzHnEPaB8OZY9U0mTrlTaAGkLiRmuXqP1cUZnJzMYmn91K 0V+g== X-Gm-Message-State: AGi0PuaYx4QO0e35DippmHlBEyMii2w8CHO//JLiygWQ7vmdV7F7nFoh Nh4Ie7R1I5KntAffFlLBsziNX9nX X-Google-Smtp-Source: APiQypJtyK/Z52DkchW8EAL96EnXohLg/8ehwkmFz6g3aqBuaGzSkiJ2ld7bEeV4RekURH/k8iYdfg== X-Received: by 2002:a62:b40e:: with SMTP id h14mr764992pfn.88.1587402759503; Mon, 20 Apr 2020 10:12:39 -0700 (PDT) Received: from birkbeck-glaptop2.roam.corp.google.com (c-73-189-189-30.hsd1.ca.comcast.net. [73.189.189.30]) by smtp.gmail.com with ESMTPSA id a9sm1644412pgv.18.2020.04.20.10.12.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2020 10:12:39 -0700 (PDT) From: Neil Birkbeck To: ffmpeg-devel@ffmpeg.org Date: Mon, 20 Apr 2020 10:12:32 -0700 Message-Id: <20200420171232.15135-1-neil.birkbeck@gmail.com> X-Mailer: git-send-email 2.26.1.301.g55bc3eb7cb9-goog MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavcodec/dnxhddata.c: Fix quantization weights for id 1271 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From the ST 2019-1:2016 standard, https://ieeexplore.ieee.org/abstract/document/7513364 in Table D.1, compression ID 1235, 1271 use the same weights. This fixes what looks like a slight sharpening when decoding samples encoded as DNxHR HQX 10- or 12-bit from other encoders (e.g., like from DaVinci Resolve). Signed-off-by: Neil Birkbeck --- libavcodec/dnxhddata.c | 10 +++++----- tests/ref/fate/dnxhr-12bit | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c index 154be89860..73260eadba 100644 --- a/libavcodec/dnxhddata.c +++ b/libavcodec/dnxhddata.c @@ -25,7 +25,7 @@ /* The quantization tables below are in zigzag order! */ -/* Used in CID 1235, 1256, 1270 */ +/* Used in CID 1235, 1256, 1270, 1271 */ static const uint8_t dnxhd_1235_luma_weight[] = { 0, 32, 32, 32, 33, 32, 32, 32, 32, 31, 32, 33, 33, 33, 33, 35, @@ -37,7 +37,7 @@ static const uint8_t dnxhd_1235_luma_weight[] = { 50, 50, 53, 55, 55, 56, 60, 60, }; -/* Used in CID 1235, 1256 */ +/* Used in CID 1235, 1256, 1271 */ static const uint8_t dnxhd_1235_chroma_weight[] = { 0, 32, 33, 34, 34, 33, 34, 35, 37, 40, 43, 42, 39, 38, 39, 41, @@ -97,7 +97,7 @@ static const uint8_t dnxhd_1238_chroma_weight[] = { 82, 77, 80, 86, 84, 82, 82, 82, }; -/* Used in CID 1241, 1271 */ +/* Used in CID 1241 */ static const uint8_t dnxhd_1241_luma_weight[] = { 0, 32, 33, 34, 34, 35, 36, 37, 36, 37, 38, 38, 38, 39, 39, 40, @@ -109,7 +109,7 @@ static const uint8_t dnxhd_1241_luma_weight[] = { 48, 46, 47, 48, 48, 49, 49, 49, }; -/* Used in CID 1241, 1271 */ +/* Used in CID 1241 */ static const uint8_t dnxhd_1241_chroma_weight[] = { 0, 32, 36, 38, 37, 37, 40, 41, 40, 40, 42, 42, 41, 41, 41, 41, @@ -1047,7 +1047,7 @@ const CIDEntry ff_dnxhd_cid_table[] = { { 0 }, { 57344, 255} }, { 1271, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, 0, 6, DNXHD_VARIABLE, 4, - dnxhd_1241_luma_weight, dnxhd_1241_chroma_weight, + dnxhd_1235_luma_weight, dnxhd_1235_chroma_weight, dnxhd_1235_dc_codes, dnxhd_1235_dc_bits, dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_info, dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run, diff --git a/tests/ref/fate/dnxhr-12bit b/tests/ref/fate/dnxhr-12bit index eb5716780c..c6e8fd99ae 100644 --- a/tests/ref/fate/dnxhr-12bit +++ b/tests/ref/fate/dnxhr-12bit @@ -3,4 +3,4 @@ #codec_id 0: rawvideo #dimensions 0: 1920x1080 #sar 0: 1/1 -0, 0, 0, 1, 8294400, 0x31bfa8f1 +0, 0, 0, 1, 8294400, 0xbe1dc546