From patchwork Wed Sep 21 01:34:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 663 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp705172vsd; Tue, 20 Sep 2016 18:35:04 -0700 (PDT) X-Received: by 10.28.221.5 with SMTP id u5mr621575wmg.118.1474421704336; Tue, 20 Sep 2016 18:35:04 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id kq1si33087365wjb.150.2016.09.20.18.35.02; Tue, 20 Sep 2016 18:35:04 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C1F40689A73; Wed, 21 Sep 2016 04:34:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-1.mx.upcmail.net (vie01a-dmta-pe02-1.mx.upcmail.net [62.179.121.157]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67B1B689A68 for ; Wed, 21 Sep 2016 04:34:39 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1bmWR4-0008WU-0U for ffmpeg-devel@ffmpeg.org; Wed, 21 Sep 2016 03:34:54 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id m1as1t00R0S5wYM011atvl; Wed, 21 Sep 2016 03:34:53 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 21 Sep 2016 03:34:51 +0200 Message-Id: <20160921013451.3228-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.9.3 Subject: [FFmpeg-devel] [PATCH] avcodec/h264: Use ptrdiff_t for (bi)width functions 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" Might fix some mysterious asm related issues like Ticket5579 Signed-off-by: Michael Niedermayer --- libavcodec/h264dsp.h | 5 +++-- libavcodec/h264dsp_template.c | 4 ++-- libavcodec/mips/h264dsp_mips.h | 26 +++++++++++++------------- libavcodec/mips/h264dsp_mmi.c | 12 ++++++------ libavcodec/x86/h264dsp_init.c | 8 ++++---- 5 files changed, 28 insertions(+), 27 deletions(-) diff --git a/libavcodec/h264dsp.h b/libavcodec/h264dsp.h index 7f24376..bcd76ab 100644 --- a/libavcodec/h264dsp.h +++ b/libavcodec/h264dsp.h @@ -28,11 +28,12 @@ #define AVCODEC_H264DSP_H #include +#include -typedef void (*h264_weight_func)(uint8_t *block, int stride, int height, +typedef void (*h264_weight_func)(uint8_t *block, ptrdiff_t stride, int height, int log2_denom, int weight, int offset); typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, - int stride, int height, int log2_denom, + ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset); /** diff --git a/libavcodec/h264dsp_template.c b/libavcodec/h264dsp_template.c index d9dcf6b..0288cc7 100644 --- a/libavcodec/h264dsp_template.c +++ b/libavcodec/h264dsp_template.c @@ -30,7 +30,7 @@ #define op_scale1(x) block[x] = av_clip_pixel( (block[x]*weight + offset) >> log2_denom ) #define op_scale2(x) dst[x] = av_clip_pixel( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1)) #define H264_WEIGHT(W) \ -static void FUNCC(weight_h264_pixels ## W)(uint8_t *_block, int stride, int height, \ +static void FUNCC(weight_h264_pixels ## W)(uint8_t *_block, ptrdiff_t stride, int height, \ int log2_denom, int weight, int offset) \ { \ int y; \ @@ -60,7 +60,7 @@ static void FUNCC(weight_h264_pixels ## W)(uint8_t *_block, int stride, int heig op_scale1(15); \ } \ } \ -static void FUNCC(biweight_h264_pixels ## W)(uint8_t *_dst, uint8_t *_src, int stride, int height, \ +static void FUNCC(biweight_h264_pixels ## W)(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride, int height, \ int log2_denom, int weightd, int weights, int offset) \ { \ int y; \ diff --git a/libavcodec/mips/h264dsp_mips.h b/libavcodec/mips/h264dsp_mips.h index a578457..21b7de0 100644 --- a/libavcodec/mips/h264dsp_mips.h +++ b/libavcodec/mips/h264dsp_mips.h @@ -79,19 +79,19 @@ void ff_h264_h_loop_filter_luma_mbaff_intra_msa(uint8_t *src, int stride, int alpha, int beta); void ff_biweight_h264_pixels16_8_msa(uint8_t *dst, uint8_t *src, - int stride, int height, int log2_denom, + ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset); void ff_biweight_h264_pixels8_8_msa(uint8_t *dst, uint8_t *src, - int stride, int height, int log2_denom, + ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset); void ff_biweight_h264_pixels4_8_msa(uint8_t *dst, uint8_t *src, - int stride, int height, int log2_denom, + ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset); -void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride, int height, +void ff_weight_h264_pixels16_8_msa(uint8_t *src, ptrdiff_t stride, int height, int log2_denom, int weight, int offset); -void ff_weight_h264_pixels8_8_msa(uint8_t *src, int stride, int height, +void ff_weight_h264_pixels8_8_msa(uint8_t *src, ptrdiff_t stride, int height, int log2_denom, int weight, int offset); -void ff_weight_h264_pixels4_8_msa(uint8_t *src, int stride, int height, +void ff_weight_h264_pixels4_8_msa(uint8_t *src, ptrdiff_t stride, int height, int log2_denom, int weight, int offset); void ff_put_h264_qpel16_mc00_msa(uint8_t *dst, const uint8_t *src, @@ -339,23 +339,23 @@ void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, int16_t *input, void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul); void ff_h264_chroma422_dc_dequant_idct_8_mmi(int16_t *block, int qmul); -void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height, +void ff_h264_weight_pixels16_8_mmi(uint8_t *block, ptrdiff_t stride, int height, int log2_denom, int weight, int offset); void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, - int stride, int height, int log2_denom, int weightd, int weights, + ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset); -void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height, +void ff_h264_weight_pixels8_8_mmi(uint8_t *block, ptrdiff_t stride, int height, int log2_denom, int weight, int offset); void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, - int stride, int height, int log2_denom, int weightd, int weights, + ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset); -void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height, +void ff_h264_weight_pixels4_8_mmi(uint8_t *block, ptrdiff_t stride, int height, int log2_denom, int weight, int offset); void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src, - int stride, int height, int log2_denom, int weightd, int weights, + ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset); -void ff_deblock_v_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta, +void ff_deblock_v_chroma_8_mmi(uint8_t *pix, ptrdiff_t stride, int alpha, int beta, int8_t *tc0); void ff_deblock_v_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha, int beta); diff --git a/libavcodec/mips/h264dsp_mmi.c b/libavcodec/mips/h264dsp_mmi.c index a62bbab..a550eee 100644 --- a/libavcodec/mips/h264dsp_mmi.c +++ b/libavcodec/mips/h264dsp_mmi.c @@ -1152,7 +1152,7 @@ void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul) block[48]= ((d-b)*qmul) >> 7; } -void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height, +void ff_h264_weight_pixels16_8_mmi(uint8_t *block, ptrdiff_t stride, int height, int log2_denom, int weight, int offset) { int y; @@ -1205,7 +1205,7 @@ void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height, } } -void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, int stride, +void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset) { int y; @@ -1273,7 +1273,7 @@ void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, int stride, } } -void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height, +void ff_h264_weight_pixels8_8_mmi(uint8_t *block, ptrdiff_t stride, int height, int log2_denom, int weight, int offset) { int y; @@ -1313,7 +1313,7 @@ void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height, } } -void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, int stride, +void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset) { int y; @@ -1362,7 +1362,7 @@ void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, int stride, } } -void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height, +void ff_h264_weight_pixels4_8_mmi(uint8_t *block, ptrdiff_t stride, int height, int log2_denom, int weight, int offset) { int y; @@ -1402,7 +1402,7 @@ void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height, } } -void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src, int stride, +void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int height, int log2_denom, int weightd, int weights, int offset) { int y; diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c index c8cd065..d2452c7 100644 --- a/libavcodec/x86/h264dsp_init.c +++ b/libavcodec/x86/h264dsp_init.c @@ -157,13 +157,13 @@ LF_IFUNC(v, luma_intra, 10, mmxext) /* weighted prediction */ #define H264_WEIGHT(W, OPT) \ -void ff_h264_weight_ ## W ## _ ## OPT(uint8_t *dst, int stride, \ +void ff_h264_weight_ ## W ## _ ## OPT(uint8_t *dst, ptrdiff_t stride, \ int height, int log2_denom, \ int weight, int offset); #define H264_BIWEIGHT(W, OPT) \ void ff_h264_biweight_ ## W ## _ ## OPT(uint8_t *dst, uint8_t *src, \ - int stride, int height, \ + ptrdiff_t stride, int height, \ int log2_denom, int weightd, \ int weights, int offset); @@ -183,7 +183,7 @@ H264_BIWEIGHT_MMX(4) #define H264_WEIGHT_10(W, DEPTH, OPT) \ void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \ - int stride, \ + ptrdiff_t stride, \ int height, \ int log2_denom, \ int weight, \ @@ -192,7 +192,7 @@ void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \ #define H264_BIWEIGHT_10(W, DEPTH, OPT) \ void ff_h264_biweight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \ uint8_t *src, \ - int stride, \ + ptrdiff_t stride, \ int height, \ int log2_denom, \ int weightd, \