From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 90B5E4B5C9 for ; Sun, 9 Jun 2024 05:58:44 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D496468D712; Sun, 9 Jun 2024 08:58:42 +0300 (EEST) Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2996D68D6C2 for ; Sun, 9 Jun 2024 08:58:36 +0300 (EEST) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 839F4C006F for ; Sun, 9 Jun 2024 08:58:35 +0300 (EEST) From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 9 Jun 2024 08:58:34 +0300 Message-ID: <20240609055835.2488-1-remi@remlab.net> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240608200919.2362726-1-remi@remlab.net> References: <20240608200919.2362726-1-remi@remlab.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] =?utf-8?q?=5BPATCH_=CE=B5/2=5D_lavc/h263dsp=3A_ad?= =?utf-8?q?d_DCT_dequantisation_function?= X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --- libavcodec/h263dsp.c | 17 +++++++++++++++++ libavcodec/h263dsp.h | 2 ++ 2 files changed, 19 insertions(+) diff --git a/libavcodec/h263dsp.c b/libavcodec/h263dsp.c index 6a13353499..eb990f27bd 100644 --- a/libavcodec/h263dsp.c +++ b/libavcodec/h263dsp.c @@ -23,6 +23,22 @@ #include "config.h" #include "h263dsp.h" +static void h263_dct_unquantize_c(int16_t *block, size_t start, size_t end, + int qmul, int qadd) +{ + for (size_t i = start; i <= end; i++) { + int level = block[i]; + + if (level) { + if (level < 0) + level = level * qmul - qadd; + else + level = level * qmul + qadd; + block[i] = level; + } + } +} + const uint8_t ff_h263_loop_filter_strength[32] = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12 @@ -116,6 +132,7 @@ static void h263_v_loop_filter_c(uint8_t *src, int stride, int qscale) av_cold void ff_h263dsp_init(H263DSPContext *ctx) { + ctx->h263_dct_unquantize = h263_dct_unquantize_c; ctx->h263_h_loop_filter = h263_h_loop_filter_c; ctx->h263_v_loop_filter = h263_v_loop_filter_c; diff --git a/libavcodec/h263dsp.h b/libavcodec/h263dsp.h index 2dccd23392..93c128c9ac 100644 --- a/libavcodec/h263dsp.h +++ b/libavcodec/h263dsp.h @@ -24,6 +24,8 @@ extern const uint8_t ff_h263_loop_filter_strength[32]; typedef struct H263DSPContext { + void (*h263_dct_unquantize)(int16_t *block /* align 16 */, size_t offset, + size_t len, int mul, int add); void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale); void (*h263_v_loop_filter)(uint8_t *src, int stride, int qscale); } H263DSPContext; -- 2.45.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".