From patchwork Mon Aug 26 13:59:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramiro Polla X-Patchwork-Id: 51148 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:b3c7:0:b0:48e:c0f8:d0de with SMTP id g7csp1791490vqt; Mon, 26 Aug 2024 07:10:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV4pVvbJMwqjwhKzU0lOrSPvU68K4J+TqiteXKLKGEUQZ8YKvV2nl9hIiMn3z7HDLVy5Ubhigh1CNfRSzxfuOsc@gmail.com X-Google-Smtp-Source: AGHT+IGb/J0Zt3j4f5phviLPAvES2wJvGM2H9GpPMi3qqIt3PsfXoQ/hqF6kIkUcwwX+NGOuxqff X-Received: by 2002:a05:6512:3d20:b0:52c:d7d9:9ba6 with SMTP id 2adb3069b0e04-534387bf210mr6433074e87.50.1724681408736; Mon, 26 Aug 2024 07:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724681408; cv=none; d=google.com; s=arc-20240605; b=h7W4XofK4UY5TZTmg3cv+kxYLvmU8t6rtFkNfLCpz0CF0hUuSRby5i+8TOSNCTLTw1 VjsqgwVjqa3um1BItUW+C/HyOE03spiUyGUaanEVyZX9c3kjo0poJqpRszj5QqyGH+sI 52UzJV6aGqdaP36NG+bniRk0Zh//ZvYYMOXpQN944/PJEdyosk04WDOfDUpDAoOyktkE vbQN9Lubns5afpQcQEK0H4eOntFlR83UC5N/OYTAhIqJbGanFRXUFNV9+suMyDdkQda7 L8blr6I4PNjwQlMZKQ6uk2qkclME19Ha5LseLS7RrhlyHmt39EP+wWDvYY7S3cdjI9KS Tacg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=jcI1AaIUZmLc93Mf5nMKevmdhsTadtEd+2jxphQJGXU=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Rgowz+mTUmUXzV1yJuHFq2k6pyqvdDjIbNsMGC7HV7vsS+uNmwfLp5QmhA8SlrLT7e FKayp0lk74SzVXgZbr/rEAKbcUMIRYe4r1EBrye31B3rYOOg/w7TYKN3SgHLrJpN2dzS wcev4XWh1M4onJKhs6YprBkQqGc/iBo0rgCE57EqImfOcZqE6nncWWuiOg9JviNDhxVg Y3vaSLijxKapSvDn51RFbpWFDil5g4lg6PAm71xi1xmqoh1PcFA7Cp4jwgF4NxVBcYVE 6RZPsK4HYcySJI+A789j4YYu7HN40EIs/QhEiiSOoKQ34Ut0rwmJDKOQzJ8ze9u2giel STkQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=LjXiALfH; 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=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@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 2adb3069b0e04-5334ea858cesi3548291e87.446.2024.08.26.07.10.07; Mon, 26 Aug 2024 07:10:08 -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.s=20230601 header.b=LjXiALfH; 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=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6118E68DD69; Mon, 26 Aug 2024 16:59:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D122268C2C3 for ; Mon, 26 Aug 2024 16:59:49 +0300 (EEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-428243f928cso38908115e9.3 for ; Mon, 26 Aug 2024 06:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724680788; x=1725285588; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=P9BDk1mVAxr6nUy9vEHHfHXyZMD8t/fj3T8BMoRalR0=; b=LjXiALfHnZ3qNb/c/FoRZqFa8w5lO+qFH9MwK925jwTCfh7BFyLORTgCKKDbY1vzaN WydIXcvf1hSGyvnsrGc3VjfdYBMPHk0+V58efgZ3JmwQ+z30Xmq1PGMwtGeMWr6C3EY7 aY6gYboV5qS4S7THjxcFR6Md28WaQo7UQqzbtYnSvvH+fnXp3kVlCFt9mS79m5KKwEvK 3NBw7hTDBJZCVp4/AF9ofm4qm9cwhc4nL2wx30XT+2exKacSZ3pMhfetGXo6twA2CiOC dcZnJdhVJX6Cq2O6+qgLRa40DvHMCBkFkHUnhgR6c7ZbXCG6XVh0roNes0/geb9jHE7a 839g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724680788; x=1725285588; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=P9BDk1mVAxr6nUy9vEHHfHXyZMD8t/fj3T8BMoRalR0=; b=o/hQTEYuyH0bu2a7rswwG/+8vwrQQr5dUWLKxuYTIbqoPT1wDsWFAvWtVqcwe3ChCH flYd8QdrwB4tUy9C4e15Xx8zTgIKFeRRHTmh2Jyzu8E3411itK00Lnj9RtMcOlG90/HL EZqowd/sYfwGneAZz+GqTgax43ea56k2kyNly569/rR+cyL42GlpwQMKzMtQKFagnSq3 bYn6qcsqVt1cmKUwwWuHdbPUvVWguR2+wrQ26qM/opV6qzMCPIy/br3oeVhdP2qcq9+6 agK1nkCOTAEmRkm9f/mKZAVcMPOKh8Pzq5rvQnSCfAFWGJ9wKgDPBQiFZxDpI8vx9iyT bi8g== X-Gm-Message-State: AOJu0YxSdv9P1icfX3R0uolM15SmKg+mOYfr3iSKZSOPzMoCo8+ADmHw wix/rfWNOXnmkfaf4fAA05Xg8T7LfUOi0b/tE2L9Ao/ydGfMVzHXmKd9VA== X-Received: by 2002:a05:600c:3d0e:b0:426:63b8:2cce with SMTP id 5b1f17b1804b1-42acc8d52b6mr63768535e9.7.1724680787933; Mon, 26 Aug 2024 06:59:47 -0700 (PDT) Received: from localhost.localdomain ([109.138.158.185]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-373081ff5dbsm10774078f8f.86.2024.08.26.06.59.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 06:59:47 -0700 (PDT) From: Ramiro Polla To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Aug 2024 15:59:45 +0200 Message-Id: <20240826135945.4233-1-ramiro.polla@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/mpegvideoencdsp: convert stride parameters from int to ptrdiff_t 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: DO52nPl1oNoC --- libavcodec/aarch64/mpegvideoencdsp_init.c | 6 ++--- libavcodec/aarch64/mpegvideoencdsp_neon.S | 9 +++---- libavcodec/arm/mpegvideoencdsp_init_arm.c | 4 +-- libavcodec/mips/h263dsp_mips.h | 2 +- libavcodec/mips/mpegvideoencdsp_msa.c | 2 +- libavcodec/mpegvideoencdsp.c | 31 +++++++++++++++-------- libavcodec/mpegvideoencdsp.h | 10 ++++---- libavcodec/ppc/mpegvideoencdsp.c | 8 +++--- libavcodec/riscv/mpegvideoencdsp_init.c | 4 +-- libavcodec/x86/mpegvideoencdsp.asm | 6 ++--- libavcodec/x86/mpegvideoencdsp_init.c | 8 +++--- tests/checkasm/mpegvideoencdsp.c | 12 ++++----- 12 files changed, 53 insertions(+), 49 deletions(-) diff --git a/libavcodec/aarch64/mpegvideoencdsp_init.c b/libavcodec/aarch64/mpegvideoencdsp_init.c index d0ce07e178..0402ac9e82 100644 --- a/libavcodec/aarch64/mpegvideoencdsp_init.c +++ b/libavcodec/aarch64/mpegvideoencdsp_init.c @@ -24,11 +24,11 @@ #include "libavcodec/mpegvideoencdsp.h" #include "config.h" -int ff_pix_sum16_neon(const uint8_t *pix, int line_size); -int ff_pix_norm1_neon(const uint8_t *pix, int line_size); +int ff_pix_sum16_neon(const uint8_t *pix, ptrdiff_t line_size); +int ff_pix_norm1_neon(const uint8_t *pix, ptrdiff_t line_size); #if HAVE_DOTPROD -int ff_pix_norm1_neon_dotprod(const uint8_t *pix, int line_size); +int ff_pix_norm1_neon_dotprod(const uint8_t *pix, ptrdiff_t line_size); #endif av_cold void ff_mpegvideoencdsp_init_aarch64(MpegvideoEncDSPContext *c, diff --git a/libavcodec/aarch64/mpegvideoencdsp_neon.S b/libavcodec/aarch64/mpegvideoencdsp_neon.S index 4944e7b7f4..8175d8975e 100644 --- a/libavcodec/aarch64/mpegvideoencdsp_neon.S +++ b/libavcodec/aarch64/mpegvideoencdsp_neon.S @@ -22,9 +22,8 @@ function ff_pix_sum16_neon, export=1 // x0 const uint8_t *pix -// x1 int line_size +// x1 ptrdiff_t line_size - sxtw x1, w1 add x2, x0, x1 lsl x1, x1, #1 movi v0.16b, #0 @@ -46,9 +45,8 @@ endfunc function ff_pix_norm1_neon, export=1 // x0 const uint8_t *pix -// x1 int line_size +// x1 ptrdiff_t line_size - sxtw x1, w1 movi v0.16b, #0 mov w2, #16 @@ -72,9 +70,8 @@ ENABLE_DOTPROD function ff_pix_norm1_neon_dotprod, export=1 // x0 const uint8_t *pix -// x1 int line_size +// x1 ptrdiff_t line_size - sxtw x1, w1 movi v0.16b, #0 mov w2, #16 diff --git a/libavcodec/arm/mpegvideoencdsp_init_arm.c b/libavcodec/arm/mpegvideoencdsp_init_arm.c index a95b5bebe9..74c5964f74 100644 --- a/libavcodec/arm/mpegvideoencdsp_init_arm.c +++ b/libavcodec/arm/mpegvideoencdsp_init_arm.c @@ -24,8 +24,8 @@ #include "libavcodec/avcodec.h" #include "libavcodec/mpegvideoencdsp.h" -int ff_pix_norm1_armv6(const uint8_t *pix, int line_size); -int ff_pix_sum_armv6(const uint8_t *pix, int line_size); +int ff_pix_norm1_armv6(const uint8_t *pix, ptrdiff_t line_size); +int ff_pix_sum_armv6(const uint8_t *pix, ptrdiff_t line_size); av_cold void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, AVCodecContext *avctx) diff --git a/libavcodec/mips/h263dsp_mips.h b/libavcodec/mips/h263dsp_mips.h index f225ee563e..d4de2233a7 100644 --- a/libavcodec/mips/h263dsp_mips.h +++ b/libavcodec/mips/h263dsp_mips.h @@ -31,6 +31,6 @@ void ff_dct_unquantize_h263_inter_msa(MpegEncContext *s, int16_t *block, int32_t index, int32_t q_scale); void ff_dct_unquantize_h263_intra_msa(MpegEncContext *s, int16_t *block, int32_t index, int32_t q_scale); -int ff_pix_sum_msa(const uint8_t *pix, int line_size); +int ff_pix_sum_msa(const uint8_t *pix, ptrdiff_t line_size); #endif // #ifndef AVCODEC_MIPS_H263DSP_MIPS_H diff --git a/libavcodec/mips/mpegvideoencdsp_msa.c b/libavcodec/mips/mpegvideoencdsp_msa.c index 9043730cd7..91e0f00686 100644 --- a/libavcodec/mips/mpegvideoencdsp_msa.c +++ b/libavcodec/mips/mpegvideoencdsp_msa.c @@ -56,7 +56,7 @@ static int32_t sum_u8src_16width_msa(const uint8_t *src, int32_t stride) return sum; } -int ff_pix_sum_msa(const uint8_t *pix, int line_size) +int ff_pix_sum_msa(const uint8_t *pix, ptrdiff_t line_size) { return sum_u8src_16width_msa(pix, line_size); } diff --git a/libavcodec/mpegvideoencdsp.c b/libavcodec/mpegvideoencdsp.c index 00a2c4ba71..5e4c446d99 100644 --- a/libavcodec/mpegvideoencdsp.c +++ b/libavcodec/mpegvideoencdsp.c @@ -57,7 +57,7 @@ static void add_8x8basis_c(int16_t rem[64], const int16_t basis[64], int scale) (BASIS_SHIFT - RECON_SHIFT); } -static int pix_sum_c(const uint8_t *pix, int line_size) +static int pix_sum_c(const uint8_t *pix, ptrdiff_t line_size) { int s = 0, i, j; @@ -78,7 +78,7 @@ static int pix_sum_c(const uint8_t *pix, int line_size) return s; } -static int pix_norm1_c(const uint8_t *pix, int line_size) +static int pix_norm1_c(const uint8_t *pix, ptrdiff_t line_size) { int s = 0, i, j; const uint32_t *sq = ff_square_tab + 256; @@ -114,7 +114,7 @@ static int pix_norm1_c(const uint8_t *pix, int line_size) return s; } -static av_always_inline void draw_edges_lr(uint8_t *ptr, int wrap, int width, int height, int w) +static av_always_inline void draw_edges_lr(uint8_t *ptr, ptrdiff_t wrap, int width, int height, int w) { for (int i = 0; i < height; i++) { memset(ptr - w, ptr[0], w); @@ -125,7 +125,7 @@ static av_always_inline void draw_edges_lr(uint8_t *ptr, int wrap, int width, in /* draw the edges of width 'w' of an image of size width, height */ // FIXME: Check that this is OK for MPEG-4 interlaced. -static void draw_edges_8_c(uint8_t *buf, int wrap, int width, int height, +static void draw_edges_8_c(uint8_t *buf, ptrdiff_t wrap, int width, int height, int w, int h, int sides) { uint8_t *last_line; @@ -154,9 +154,18 @@ static void draw_edges_8_c(uint8_t *buf, int wrap, int width, int height, memcpy(last_line + (i + 1) * wrap, last_line, width + w + w); } +/* This wrapper function only serves to convert the stride parameters + * from ptrdiff_t to int for av_image_copy_plane(). */ +static void copy_plane_wrapper(uint8_t *dst, ptrdiff_t dst_wrap, + const uint8_t *src, ptrdiff_t src_wrap, + int width, int height) +{ + av_image_copy_plane(dst, dst_wrap, src, src_wrap, width, height); +} + /* 2x2 -> 1x1 */ -static void shrink22(uint8_t *dst, int dst_wrap, - const uint8_t *src, int src_wrap, +static void shrink22(uint8_t *dst, ptrdiff_t dst_wrap, + const uint8_t *src, ptrdiff_t src_wrap, int width, int height) { int w; @@ -188,8 +197,8 @@ static void shrink22(uint8_t *dst, int dst_wrap, } /* 4x4 -> 1x1 */ -static void shrink44(uint8_t *dst, int dst_wrap, - const uint8_t *src, int src_wrap, +static void shrink44(uint8_t *dst, ptrdiff_t dst_wrap, + const uint8_t *src, ptrdiff_t src_wrap, int width, int height) { int w; @@ -219,8 +228,8 @@ static void shrink44(uint8_t *dst, int dst_wrap, } /* 8x8 -> 1x1 */ -static void shrink88(uint8_t *dst, int dst_wrap, - const uint8_t *src, int src_wrap, +static void shrink88(uint8_t *dst, ptrdiff_t dst_wrap, + const uint8_t *src, ptrdiff_t src_wrap, int width, int height) { int w, i; @@ -247,7 +256,7 @@ av_cold void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, c->try_8x8basis = try_8x8basis_c; c->add_8x8basis = add_8x8basis_c; - c->shrink[0] = av_image_copy_plane; + c->shrink[0] = copy_plane_wrapper; c->shrink[1] = shrink22; c->shrink[2] = shrink44; c->shrink[3] = shrink88; diff --git a/libavcodec/mpegvideoencdsp.h b/libavcodec/mpegvideoencdsp.h index f437bc4e4e..6ec665677b 100644 --- a/libavcodec/mpegvideoencdsp.h +++ b/libavcodec/mpegvideoencdsp.h @@ -34,13 +34,13 @@ typedef struct MpegvideoEncDSPContext { const int16_t basis[64], int scale); void (*add_8x8basis)(int16_t rem[64], const int16_t basis[64], int scale); - int (*pix_sum)(const uint8_t *pix, int line_size); - int (*pix_norm1)(const uint8_t *pix, int line_size); + int (*pix_sum)(const uint8_t *pix, ptrdiff_t line_size); + int (*pix_norm1)(const uint8_t *pix, ptrdiff_t line_size); - void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, - int src_wrap, int width, int height); + void (*shrink[4])(uint8_t *dst, ptrdiff_t dst_wrap, const uint8_t *src, + ptrdiff_t src_wrap, int width, int height); - void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, + void (*draw_edges)(uint8_t *buf, ptrdiff_t wrap, int width, int height, int w, int h, int sides); } MpegvideoEncDSPContext; diff --git a/libavcodec/ppc/mpegvideoencdsp.c b/libavcodec/ppc/mpegvideoencdsp.c index 07d3e76ee0..bd0c7fb15d 100644 --- a/libavcodec/ppc/mpegvideoencdsp.c +++ b/libavcodec/ppc/mpegvideoencdsp.c @@ -30,7 +30,7 @@ #if HAVE_ALTIVEC #if HAVE_VSX -static int pix_norm1_altivec(const uint8_t *pix, int line_size) +static int pix_norm1_altivec(const uint8_t *pix, ptrdiff_t line_size) { int i, s = 0; const vector unsigned int zero = @@ -57,7 +57,7 @@ static int pix_norm1_altivec(const uint8_t *pix, int line_size) return s; } #else -static int pix_norm1_altivec(const uint8_t *pix, int line_size) +static int pix_norm1_altivec(const uint8_t *pix, ptrdiff_t line_size) { int i, s = 0; const vector unsigned int zero = @@ -87,7 +87,7 @@ static int pix_norm1_altivec(const uint8_t *pix, int line_size) #endif /* HAVE_VSX */ #if HAVE_VSX -static int pix_sum_altivec(const uint8_t *pix, int line_size) +static int pix_sum_altivec(const uint8_t *pix, ptrdiff_t line_size) { int i, s; const vector unsigned int zero = @@ -115,7 +115,7 @@ static int pix_sum_altivec(const uint8_t *pix, int line_size) return s; } #else -static int pix_sum_altivec(const uint8_t *pix, int line_size) +static int pix_sum_altivec(const uint8_t *pix, ptrdiff_t line_size) { int i, s; const vector unsigned int zero = diff --git a/libavcodec/riscv/mpegvideoencdsp_init.c b/libavcodec/riscv/mpegvideoencdsp_init.c index 1ac808af16..3ae38cf927 100644 --- a/libavcodec/riscv/mpegvideoencdsp_init.c +++ b/libavcodec/riscv/mpegvideoencdsp_init.c @@ -26,8 +26,8 @@ int ff_try_8x8basis_rvv(const int16_t rem[64], const int16_t weight[64], const int16_t basis[16], int scale); void ff_add_8x8basis_rvv(int16_t rem[64], const int16_t basis[16], int scale); -int ff_pix_sum_rvv(const uint8_t *pix, int line_size); -int ff_pix_norm1_rvv(const uint8_t *pix, int line_size); +int ff_pix_sum_rvv(const uint8_t *pix, ptrdiff_t line_size); +int ff_pix_norm1_rvv(const uint8_t *pix, ptrdiff_t line_size); av_cold void ff_mpegvideoencdsp_init_riscv(MpegvideoEncDSPContext *c, AVCodecContext *avctx) diff --git a/libavcodec/x86/mpegvideoencdsp.asm b/libavcodec/x86/mpegvideoencdsp.asm index 3cbe7b4d4b..c73b359c42 100644 --- a/libavcodec/x86/mpegvideoencdsp.asm +++ b/libavcodec/x86/mpegvideoencdsp.asm @@ -24,12 +24,11 @@ %include "libavutil/x86/x86util.asm" SECTION .text -; int ff_pix_sum16(const uint8_t *pix, int line_size) +; int ff_pix_sum16(const uint8_t *pix, ptrdiff_t line_size) ; %1 = number of loops ; %2 = number of GPRs used %macro PIX_SUM16 3 cglobal pix_sum16, 2, %2, 6 - movsxdifnidn r1, r1d mov r2, %1 lea r3, [r1*3] %if notcpuflag(xop) @@ -72,12 +71,11 @@ INIT_XMM xop PIX_SUM16 4, 4, 4 %endif -; int ff_pix_norm1(const uint8_t *pix, int line_size) +; int ff_pix_norm1(const uint8_t *pix, ptrdiff_t line_size) ; %1 = number of xmm registers used ; %2 = number of loops %macro PIX_NORM1 2 cglobal pix_norm1, 2, 3, %1 - movsxdifnidn r1, r1d mov r2, %2 pxor m0, m0 pxor m5, m5 diff --git a/libavcodec/x86/mpegvideoencdsp_init.c b/libavcodec/x86/mpegvideoencdsp_init.c index 5d23169450..d39091a5c9 100644 --- a/libavcodec/x86/mpegvideoencdsp_init.c +++ b/libavcodec/x86/mpegvideoencdsp_init.c @@ -23,9 +23,9 @@ #include "libavcodec/avcodec.h" #include "libavcodec/mpegvideoencdsp.h" -int ff_pix_sum16_sse2(const uint8_t *pix, int line_size); -int ff_pix_sum16_xop(const uint8_t *pix, int line_size); -int ff_pix_norm1_sse2(const uint8_t *pix, int line_size); +int ff_pix_sum16_sse2(const uint8_t *pix, ptrdiff_t line_size); +int ff_pix_sum16_xop(const uint8_t *pix, ptrdiff_t line_size); +int ff_pix_norm1_sse2(const uint8_t *pix, ptrdiff_t line_size); #if HAVE_INLINE_ASM @@ -96,7 +96,7 @@ int ff_pix_norm1_sse2(const uint8_t *pix, int line_size); #endif /* HAVE_SSSE3_INLINE */ /* Draw the edges of width 'w' of an image of size width, height */ -static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height, +static void draw_edges_mmx(uint8_t *buf, ptrdiff_t wrap, int width, int height, int w, int h, int sides) { uint8_t *ptr, *last_line; diff --git a/tests/checkasm/mpegvideoencdsp.c b/tests/checkasm/mpegvideoencdsp.c index 9d000b93a6..24791d113d 100644 --- a/tests/checkasm/mpegvideoencdsp.c +++ b/tests/checkasm/mpegvideoencdsp.c @@ -34,7 +34,7 @@ static void check_pix_sum(MpegvideoEncDSPContext *c) { LOCAL_ALIGNED_16(uint8_t, src, [16 * 16]); - declare_func(int, const uint8_t *pix, int line_size); + declare_func(int, const uint8_t *pix, ptrdiff_t line_size); randomize_buffers(src, 16 * 16); @@ -43,7 +43,7 @@ static void check_pix_sum(MpegvideoEncDSPContext *c) if (check_func(c->pix_sum, "pix_sum%s", negstride_str)) { int sum0, sum1; const uint8_t *pix = src + (n ? (15 * 16) : 0); - int line_size = 16 * (n ? -1 : 1); + ptrdiff_t line_size = 16 * (n ? -1 : 1); sum0 = call_ref(pix, line_size); sum1 = call_new(pix, line_size); if (sum0 != sum1) @@ -57,7 +57,7 @@ static void check_pix_norm1(MpegvideoEncDSPContext *c) { LOCAL_ALIGNED_16(uint8_t, src, [16 * 16]); - declare_func(int, const uint8_t *pix, int line_size); + declare_func(int, const uint8_t *pix, ptrdiff_t line_size); randomize_buffers(src, 16 * 16); @@ -66,7 +66,7 @@ static void check_pix_norm1(MpegvideoEncDSPContext *c) if (check_func(c->pix_norm1, "pix_norm1%s", negstride_str)) { int sum0, sum1; const uint8_t *pix = src + (n ? (15 * 16) : 0); - int line_size = 16 * (n ? -1 : 1); + ptrdiff_t line_size = 16 * (n ? -1 : 1); sum0 = call_ref(pix, line_size); sum1 = call_new(pix, line_size); if (sum0 != sum1) @@ -88,7 +88,7 @@ static void check_draw_edges(MpegvideoEncDSPContext *c) LOCAL_ALIGNED_16(uint8_t, buf0, [BUFSIZE]); LOCAL_ALIGNED_16(uint8_t, buf1, [BUFSIZE]); - declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *buf, int wrap, int width, int height, + declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *buf, ptrdiff_t wrap, int width, int height, int w, int h, int sides); for (int isi = 0; isi < FF_ARRAY_ELEMS(input_sizes); isi++) { @@ -96,7 +96,7 @@ static void check_draw_edges(MpegvideoEncDSPContext *c) int negstride = input_size < 0; const char *negstride_str = negstride ? "_negstride" : ""; int width = FFABS(input_size); - int linesize = EDGE_WIDTH + width + EDGE_WIDTH; + ptrdiff_t linesize = EDGE_WIDTH + width + EDGE_WIDTH; /* calculate height based on specified width to use the entire buffer. */ int height = (BUFSIZE / linesize) - (2 * EDGE_WIDTH); uint8_t *dst0 = buf0 + EDGE_WIDTH * linesize + EDGE_WIDTH;