From patchwork Sun Jan 31 20:21:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 25302 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 D442D449202 for ; Sun, 31 Jan 2021 22:21:40 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AE902689A01; Sun, 31 Jan 2021 22:21:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 20CB76818DB for ; Sun, 31 Jan 2021 22:21:34 +0200 (EET) Received: by mail-wm1-f41.google.com with SMTP id s24so10212030wmj.0 for ; Sun, 31 Jan 2021 12:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V+rF155frNf0YDxVFaE0CNpOyieqWLqdVQLqM15bA+M=; b=bORJ147p88hKxK3yZHc6haWuujdH9z4pxRBP90JLb79DJhH+m5J0Ge0EHGHys96Ji0 /4Cf3LTC80dB6MK2r4ad4XJB/IyKOUf2jF57DT+jM70mhbPUPHtL7JZUzrKJV2BGJViN tErFEXsEqYTkBpNbwqbULjC/F/AaynkqN4mPfyGwhnmI6bLOSa465CqEOC6aKVYk9pho 9E7AoNTi8din/cDX7N9Cdn57khc3jf91GHmYcs7oHbKg82vkpcDnIarhcDLDhBCei7Up sIp4vemoR/pAT0vPF/rYpxR3JTzDe/kRQ9liQCaa+fNkgscrRk+Gj/Ewdj9L17RCySEU FVjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V+rF155frNf0YDxVFaE0CNpOyieqWLqdVQLqM15bA+M=; b=Na0zkGchrj/xtRH48/Vqyx6wnOPtPaj9yvJnyJ3Fio+oKbmCpUxzrxLbNfMz07Zvdc t/Ckooz8LnqGAIQaog2rM53eZrFBnaPdcQGLcnkNvzt7Jzpc3OBvRq+eMdoCqOOgj0DA aKhLk9aYDT4hxnPH9jvq95KfCBBoMGcf2z/4LflEYwDuKePpAAZjA5ju1wymOHakjeFC 4KTjB35QIPCvKdmm3ZDHTHTNB87mh30yFARmfADKcqZsogRf9lAj4b/cZmkPMIYcyuPC TnjSL1dXeQecJybhj4OpGW7ybAld7mmagPmaK7y5POt+vwrcwYp8s2pRE3RXGIt30xxu JZaQ== X-Gm-Message-State: AOAM5311X3ONk/0Dflb1DZjwhKZh7q1SEnrxDkxq8r0j0Ns9XTopCFRP MGPAR5yR36UlB1yX54/AuywmyhLerEE= X-Google-Smtp-Source: ABdhPJwk058utvlkuB2nVYWeWkS9wfJPbIGKXma3JrtRk9ZPv2b8E6n2QyypZQxW12XqRuOtpOe6nA== X-Received: by 2002:a1c:620a:: with SMTP id w10mr11900627wmb.167.1612124492167; Sun, 31 Jan 2021 12:21:32 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id a16sm23549797wrr.89.2021.01.31.12.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jan 2021 12:21:31 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 31 Jan 2021 21:21:25 +0100 Message-Id: <20210131202125.14060-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210131100940.GC2396667@pb2> References: <20210131100940.GC2396667@pb2> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] swscale: Make nonstatic identifiers respect the naming conventions 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" swscale had several nonstatic functions and function pointers without the proper ff_-prefix; this has been fixed. Signed-off-by: Andreas Rheinhardt --- Thanks. I updated the declarations and definitions of rgbx_to_nv12_neon_16/32, but not the callers. libswscale/aarch64/rgb2rgb.c | 4 +- libswscale/arm/rgb2yuv_neon_common.S | 2 +- libswscale/arm/swscale_unscaled.c | 8 +- libswscale/ppc/yuv2yuv_altivec.c | 8 +- libswscale/rgb2rgb.c | 178 ++++++++++++------------ libswscale/rgb2rgb.h | 196 +++++++++++++-------------- libswscale/rgb2rgb_template.c | 92 ++++++------- libswscale/swscale_unscaled.c | 160 +++++++++++----------- libswscale/tests/colorspace.c | 72 +++++----- libswscale/utils.c | 2 +- libswscale/x86/rgb2rgb.c | 18 +-- libswscale/x86/rgb2rgb_template.c | 76 +++++------ tests/checkasm/sw_rgb.c | 16 +-- 13 files changed, 416 insertions(+), 416 deletions(-) diff --git a/libswscale/aarch64/rgb2rgb.c b/libswscale/aarch64/rgb2rgb.c index a9bf6ff9e0..62bf3c033c 100644 --- a/libswscale/aarch64/rgb2rgb.c +++ b/libswscale/aarch64/rgb2rgb.c @@ -31,11 +31,11 @@ void ff_interleave_bytes_neon(const uint8_t *src1, const uint8_t *src2, uint8_t *dest, int width, int height, int src1Stride, int src2Stride, int dstStride); -av_cold void rgb2rgb_init_aarch64(void) +av_cold void ff_rgb2rgb_init_aarch64(void) { int cpu_flags = av_get_cpu_flags(); if (have_neon(cpu_flags)) { - interleaveBytes = ff_interleave_bytes_neon; + ff_interleave_bytes = ff_interleave_bytes_neon; } } diff --git a/libswscale/arm/rgb2yuv_neon_common.S b/libswscale/arm/rgb2yuv_neon_common.S index 30bcecd5bb..2381652de3 100644 --- a/libswscale/arm/rgb2yuv_neon_common.S +++ b/libswscale/arm/rgb2yuv_neon_common.S @@ -97,7 +97,7 @@ alias_dw_all 0, 0, 1 .macro loop_420sp s_fmt, d_fmt, init, kernel, precision -function \s_fmt\()_to_\d_fmt\()_neon_\precision, export=1 +function ff_\s_fmt\()_to_\d_fmt\()_neon_\precision, export=1 prologue alias_loop_420sp diff --git a/libswscale/arm/swscale_unscaled.c b/libswscale/arm/swscale_unscaled.c index e41f294eac..50a247b5d7 100644 --- a/libswscale/arm/swscale_unscaled.c +++ b/libswscale/arm/swscale_unscaled.c @@ -24,12 +24,12 @@ #include "libavutil/arm/cpu.h" #if HAVE_AS_DN_DIRECTIVE -extern void rgbx_to_nv12_neon_32(const uint8_t *src, uint8_t *y, uint8_t *chroma, +extern void ff_rgbx_to_nv12_neon_32(const uint8_t *src, uint8_t *y, uint8_t *chroma, int width, int height, int y_stride, int c_stride, int src_stride, int32_t coeff_tbl[9]); -extern void rgbx_to_nv12_neon_16(const uint8_t *src, uint8_t *y, uint8_t *chroma, +extern void ff_rgbx_to_nv12_neon_16(const uint8_t *src, uint8_t *y, uint8_t *chroma, int width, int height, int y_stride, int c_stride, int src_stride, int32_t coeff_tbl[9]); @@ -38,7 +38,7 @@ static int rgbx_to_nv12_neon_32_wrapper(SwsContext *context, const uint8_t *src[ int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) { - rgbx_to_nv12_neon_32(src[0] + srcSliceY * srcStride[0], + ff_rgbx_to_nv12_neon_32(src[0] + srcSliceY * srcStride[0], dst[0] + srcSliceY * dstStride[0], dst[1] + (srcSliceY / 2) * dstStride[1], context->srcW, srcSliceH, @@ -52,7 +52,7 @@ static int rgbx_to_nv12_neon_16_wrapper(SwsContext *context, const uint8_t *src[ int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) { - rgbx_to_nv12_neon_16(src[0] + srcSliceY * srcStride[0], + ff_rgbx_to_nv12_neon_16(src[0] + srcSliceY * srcStride[0], dst[0] + srcSliceY * dstStride[0], dst[1] + (srcSliceY / 2) * dstStride[1], context->srcW, srcSliceH, diff --git a/libswscale/ppc/yuv2yuv_altivec.c b/libswscale/ppc/yuv2yuv_altivec.c index 2b1c5dd3b8..ebee7f38c4 100644 --- a/libswscale/ppc/yuv2yuv_altivec.c +++ b/libswscale/ppc/yuv2yuv_altivec.c @@ -37,8 +37,8 @@ static int yv12toyuy2_unscaled_altivec(SwsContext *c, const uint8_t *src[], int dstStride_a[]) { uint8_t *dst = dstParam[0] + dstStride_a[0] * srcSliceY; - // yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, - // srcStride[0], srcStride[1], dstStride[0]); + // ff_yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, + // srcStride[0], srcStride[1], dstStride[0]); const uint8_t *ysrc = src[0]; const uint8_t *usrc = src[1]; const uint8_t *vsrc = src[2]; @@ -113,8 +113,8 @@ static int yv12touyvy_unscaled_altivec(SwsContext *c, const uint8_t *src[], int dstStride_a[]) { uint8_t *dst = dstParam[0] + dstStride_a[0] * srcSliceY; - // yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, - // srcStride[0], srcStride[1], dstStride[0]); + // ff_yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, + // srcStride[0], srcStride[1], dstStride[0]); const uint8_t *ysrc = src[0]; const uint8_t *usrc = src[1]; const uint8_t *vsrc = src[2]; diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c index a7300f3ba4..4078c5cd1b 100644 --- a/libswscale/rgb2rgb.c +++ b/libswscale/rgb2rgb.c @@ -32,87 +32,87 @@ #include "swscale.h" #include "swscale_internal.h" -void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); - -void (*rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size); -void (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size); - -void (*shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size); -void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size); -void (*shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); -void (*shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); -void (*shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); - - -void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, - const uint8_t *vsrc, uint8_t *dst, - int width, int height, - int lumStride, int chromStride, int dstStride); -void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, - const uint8_t *vsrc, uint8_t *dst, - int width, int height, - int lumStride, int chromStride, int dstStride); -void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, +void (*ff_rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); + +void (*ff_rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size); + +void (*ff_shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); +void (*ff_shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); + + +void (*ff_yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride); -void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, +void (*ff_yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride); -void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, - uint8_t *udst, uint8_t *vdst, - int width, int height, - int lumStride, int chromStride, int srcStride); +void (*ff_yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, + const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); +void (*ff_yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, + const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); +void (*ff_yuy2toyv12)(const uint8_t *src, uint8_t *ydst, + uint8_t *udst, uint8_t *vdst, + int width, int height, + int lumStride, int chromStride, int srcStride); void (*ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride, int32_t *rgb2yuv); -void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, - int srcStride, int dstStride); -void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, - int width, int height, int src1Stride, - int src2Stride, int dstStride); -void (*deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, - int width, int height, int srcStride, - int dst1Stride, int dst2Stride); -void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, - uint8_t *dst1, uint8_t *dst2, - int width, int height, - int srcStride1, int srcStride2, - int dstStride1, int dstStride2); -void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, - const uint8_t *src3, uint8_t *dst, - int width, int height, - int srcStride1, int srcStride2, - int srcStride3, int dstStride); -void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - const uint8_t *src, int width, int height, - int lumStride, int chromStride, int srcStride); -void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - const uint8_t *src, int width, int height, - int lumStride, int chromStride, int srcStride); -void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - const uint8_t *src, int width, int height, - int lumStride, int chromStride, int srcStride); -void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - const uint8_t *src, int width, int height, - int lumStride, int chromStride, int srcStride); +void (*ff_planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, + int srcStride, int dstStride); +void (*ff_interleave_bytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, + int width, int height, int src1Stride, + int src2Stride, int dstStride); +void (*ff_deinterleave_bytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, + int width, int height, int srcStride, + int dst1Stride, int dst2Stride); +void (*ff_vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, + uint8_t *dst1, uint8_t *dst2, + int width, int height, + int srcStride1, int srcStride2, + int dstStride1, int dstStride2); +void (*ff_yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, + const uint8_t *src3, uint8_t *dst, + int width, int height, + int srcStride1, int srcStride2, + int srcStride3, int dstStride); +void (*ff_uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + const uint8_t *src, int width, int height, + int lumStride, int chromStride, int srcStride); +void (*ff_uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + const uint8_t *src, int width, int height, + int lumStride, int chromStride, int srcStride); +void (*ff_yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + const uint8_t *src, int width, int height, + int lumStride, int chromStride, int srcStride); +void (*ff_yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + const uint8_t *src, int width, int height, + int lumStride, int chromStride, int srcStride); #define BY ((int)( 0.098 * (1 << RGB2YUV_SHIFT) + 0.5)) #define BV ((int)(-0.071 * (1 << RGB2YUV_SHIFT) + 0.5)) @@ -138,12 +138,12 @@ av_cold void ff_sws_rgb2rgb_init(void) { rgb2rgb_init_c(); if (ARCH_AARCH64) - rgb2rgb_init_aarch64(); + ff_rgb2rgb_init_aarch64(); if (ARCH_X86) - rgb2rgb_init_x86(); + ff_rgb2rgb_init_x86(); } -void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb32to24(const uint8_t *src, uint8_t *dst, int src_size) { int i, num_pixels = src_size >> 2; @@ -161,7 +161,7 @@ void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb24to32(const uint8_t *src, uint8_t *dst, int src_size) { int i; @@ -181,7 +181,7 @@ void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size) { uint8_t *d = dst; const uint16_t *s = (const uint16_t *)src; @@ -203,7 +203,7 @@ void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb12to15(const uint8_t *src, uint8_t *dst, int src_size) { uint16_t rgb, r, g, b; uint16_t *d = (uint16_t *)dst; @@ -222,7 +222,7 @@ void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb16to24(const uint8_t *src, uint8_t *dst, int src_size) { uint8_t *d = dst; const uint16_t *s = (const uint16_t *)src; @@ -236,7 +236,7 @@ void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size) { int i, num_pixels = src_size >> 1; @@ -246,7 +246,7 @@ void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size) { int i, num_pixels = src_size >> 1; @@ -256,7 +256,7 @@ void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size) { uint8_t *d = dst; const uint16_t *s = (const uint16_t *)src; @@ -278,7 +278,7 @@ void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb15to24(const uint8_t *src, uint8_t *dst, int src_size) { uint8_t *d = dst; const uint16_t *s = (const uint16_t *)src; @@ -292,7 +292,7 @@ void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size) { int i, num_pixels = src_size >> 1; @@ -302,7 +302,7 @@ void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size) { int i, num_pixels = src_size >> 1; @@ -313,7 +313,7 @@ void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size) } } -void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size) +void ff_rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size) { uint16_t *d = (uint16_t *)dst; uint16_t *s = (uint16_t *)src; @@ -326,7 +326,7 @@ void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size) } #define DEFINE_RGB48TOBGR48(need_bswap, swap) \ -void rgb48tobgr48_ ## need_bswap(const uint8_t *src, \ +void ff_rgb48tobgr48_ ## need_bswap(const uint8_t *src, \ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ @@ -344,7 +344,7 @@ DEFINE_RGB48TOBGR48(nobswap, 0) DEFINE_RGB48TOBGR48(bswap, 1) #define DEFINE_RGB64TOBGR48(need_bswap, swap) \ -void rgb64tobgr48_ ## need_bswap(const uint8_t *src, \ +void ff_rgb64tobgr48_ ## need_bswap(const uint8_t *src, \ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ @@ -362,7 +362,7 @@ DEFINE_RGB64TOBGR48(nobswap, 0) DEFINE_RGB64TOBGR48(bswap, 1) #define DEFINE_RGB64TO48(need_bswap, swap) \ -void rgb64to48_ ## need_bswap(const uint8_t *src, \ +void ff_rgb64to48_ ## need_bswap(const uint8_t *src, \ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ @@ -380,7 +380,7 @@ DEFINE_RGB64TO48(nobswap, 0) DEFINE_RGB64TO48(bswap, 1) #define DEFINE_RGB48TOBGR64(need_bswap, swap) \ -void rgb48tobgr64_ ## need_bswap(const uint8_t *src, \ +void ff_rgb48tobgr64_ ## need_bswap(const uint8_t *src, \ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ @@ -399,7 +399,7 @@ DEFINE_RGB48TOBGR64(nobswap, 0) DEFINE_RGB48TOBGR64(bswap, 1) #define DEFINE_RGB48TO64(need_bswap, swap) \ -void rgb48to64_ ## need_bswap(const uint8_t *src, \ +void ff_rgb48to64_ ## need_bswap(const uint8_t *src, \ uint8_t *dst, int src_size) \ { \ uint16_t *d = (uint16_t *)dst; \ diff --git a/libswscale/rgb2rgb.h b/libswscale/rgb2rgb.h index 48bba1586a..f7c6c5f1a3 100644 --- a/libswscale/rgb2rgb.h +++ b/libswscale/rgb2rgb.h @@ -32,52 +32,52 @@ #include "swscale.h" /* A full collection of RGB to RGB(BGR) converters */ -extern void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); - -extern void (*shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); -extern void (*shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); - -void rgb64tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb64tobgr48_bswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb48tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb48tobgr48_bswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb64to48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb64to48_bswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb48tobgr64_nobswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb48tobgr64_bswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb48to64_nobswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb48to64_bswap(const uint8_t *src, uint8_t *dst, int src_size); -void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size); -void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size); -void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size); -void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size); -void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size); -void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size); -void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size); -void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size); -void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size); -void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size); -void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size); -void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); + +extern void (*ff_shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*ff_shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); + +void ff_rgb64tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb64tobgr48_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb48tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb48tobgr48_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb64to48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb64to48_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb48tobgr64_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb48tobgr64_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb48to64_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb48to64_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb24to32(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb32to24(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb16to24(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb15to24(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size); +void ff_rgb12to15(const uint8_t *src, uint8_t *dst, int src_size); void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, @@ -87,39 +87,39 @@ void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst, * Height should be a multiple of 2 and width should be a multiple of 16. * (If this is a problem for anyone then tell me, and I will fix it.) */ -extern void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, - int width, int height, - int lumStride, int chromStride, int dstStride); +extern void (*ff_yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); /** * Width should be a multiple of 16. */ -extern void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, - int width, int height, - int lumStride, int chromStride, int dstStride); +extern void (*ff_yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); /** * Height should be a multiple of 2 and width should be a multiple of 16. * (If this is a problem for anyone then tell me, and I will fix it.) */ -extern void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, - int width, int height, - int lumStride, int chromStride, int srcStride); +extern void (*ff_yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + int width, int height, + int lumStride, int chromStride, int srcStride); /** * Height should be a multiple of 2 and width should be a multiple of 16. * (If this is a problem for anyone then tell me, and I will fix it.) */ -extern void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, - int width, int height, - int lumStride, int chromStride, int dstStride); +extern void (*ff_yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); /** * Width should be a multiple of 16. */ -extern void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, - int width, int height, - int lumStride, int chromStride, int dstStride); +extern void (*ff_yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); /** * Height should be a multiple of 2 and width should be a multiple of 2. @@ -131,45 +131,45 @@ extern void (*ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, int width, int height, int lumStride, int chromStride, int srcStride, int32_t *rgb2yuv); -extern void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, - int srcStride, int dstStride); - -extern void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, - int width, int height, int src1Stride, - int src2Stride, int dstStride); - -extern void (*deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, - int width, int height, int srcStride, - int dst1Stride, int dst2Stride); - -extern void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, - uint8_t *dst1, uint8_t *dst2, - int width, int height, - int srcStride1, int srcStride2, - int dstStride1, int dstStride2); - -extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, - uint8_t *dst, - int width, int height, - int srcStride1, int srcStride2, - int srcStride3, int dstStride); - -extern void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, - int width, int height, - int lumStride, int chromStride, int srcStride); -extern void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, - int width, int height, - int lumStride, int chromStride, int srcStride); -extern void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, - int width, int height, - int lumStride, int chromStride, int srcStride); -extern void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, - int width, int height, - int lumStride, int chromStride, int srcStride); +extern void (*ff_planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, + int srcStride, int dstStride); + +extern void (*ff_interleave_bytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, + int width, int height, int src1Stride, + int src2Stride, int dstStride); + +extern void (*ff_deinterleave_bytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, + int width, int height, int srcStride, + int dst1Stride, int dst2Stride); + +extern void (*ff_vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, + uint8_t *dst1, uint8_t *dst2, + int width, int height, + int srcStride1, int srcStride2, + int dstStride1, int dstStride2); + +extern void (*ff_yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, + uint8_t *dst, + int width, int height, + int srcStride1, int srcStride2, + int srcStride3, int dstStride); + +extern void (*ff_uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride); +extern void (*ff_uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride); +extern void (*ff_yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride); +extern void (*ff_yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride); void ff_sws_rgb2rgb_init(void); -void rgb2rgb_init_aarch64(void); -void rgb2rgb_init_x86(void); +void ff_rgb2rgb_init_aarch64(void); +void ff_rgb2rgb_init_x86(void); #endif /* SWSCALE_RGB2RGB_H */ diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c index 42c69801ba..133928d32c 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -707,9 +707,9 @@ void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst, } } -static void interleaveBytes_c(const uint8_t *src1, const uint8_t *src2, - uint8_t *dest, int width, int height, - int src1Stride, int src2Stride, int dstStride) +static void interleave_bytes_c(const uint8_t *src1, const uint8_t *src2, + uint8_t *dest, int width, int height, + int src1Stride, int src2Stride, int dstStride) { int h; @@ -725,9 +725,9 @@ static void interleaveBytes_c(const uint8_t *src1, const uint8_t *src2, } } -static void deinterleaveBytes_c(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, - int width, int height, int srcStride, - int dst1Stride, int dst2Stride) +static void deinterleave_bytes_c(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, + int width, int height, int srcStride, + int dst1Stride, int dst2Stride) { int h; @@ -946,47 +946,47 @@ static void uyvytoyuv422_c(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, static av_cold void rgb2rgb_init_c(void) { - rgb15to16 = rgb15to16_c; - rgb15tobgr24 = rgb15tobgr24_c; - rgb15to32 = rgb15to32_c; - rgb16tobgr24 = rgb16tobgr24_c; - rgb16to32 = rgb16to32_c; - rgb16to15 = rgb16to15_c; - rgb24tobgr16 = rgb24tobgr16_c; - rgb24tobgr15 = rgb24tobgr15_c; - rgb24tobgr32 = rgb24tobgr32_c; - rgb32to16 = rgb32to16_c; - rgb32to15 = rgb32to15_c; - rgb32tobgr24 = rgb32tobgr24_c; - rgb24to15 = rgb24to15_c; - rgb24to16 = rgb24to16_c; - rgb24tobgr24 = rgb24tobgr24_c; + ff_rgb15to16 = rgb15to16_c; + ff_rgb15tobgr24 = rgb15tobgr24_c; + ff_rgb15to32 = rgb15to32_c; + ff_rgb16tobgr24 = rgb16tobgr24_c; + ff_rgb16to32 = rgb16to32_c; + ff_rgb16to15 = rgb16to15_c; + ff_rgb24tobgr16 = rgb24tobgr16_c; + ff_rgb24tobgr15 = rgb24tobgr15_c; + ff_rgb24tobgr32 = rgb24tobgr32_c; + ff_rgb32to16 = rgb32to16_c; + ff_rgb32to15 = rgb32to15_c; + ff_rgb32tobgr24 = rgb32tobgr24_c; + ff_rgb24to15 = rgb24to15_c; + ff_rgb24to16 = rgb24to16_c; + ff_rgb24tobgr24 = rgb24tobgr24_c; #if HAVE_BIGENDIAN - shuffle_bytes_0321 = shuffle_bytes_2103_c; - shuffle_bytes_2103 = shuffle_bytes_0321_c; + ff_shuffle_bytes_0321 = shuffle_bytes_2103_c; + ff_shuffle_bytes_2103 = shuffle_bytes_0321_c; #else - shuffle_bytes_0321 = shuffle_bytes_0321_c; - shuffle_bytes_2103 = shuffle_bytes_2103_c; + ff_shuffle_bytes_0321 = shuffle_bytes_0321_c; + ff_shuffle_bytes_2103 = shuffle_bytes_2103_c; #endif - shuffle_bytes_1230 = shuffle_bytes_1230_c; - shuffle_bytes_3012 = shuffle_bytes_3012_c; - shuffle_bytes_3210 = shuffle_bytes_3210_c; - rgb32tobgr16 = rgb32tobgr16_c; - rgb32tobgr15 = rgb32tobgr15_c; - yv12toyuy2 = yv12toyuy2_c; - yv12touyvy = yv12touyvy_c; - yuv422ptoyuy2 = yuv422ptoyuy2_c; - yuv422ptouyvy = yuv422ptouyvy_c; - yuy2toyv12 = yuy2toyv12_c; - planar2x = planar2x_c; - ff_rgb24toyv12 = ff_rgb24toyv12_c; - interleaveBytes = interleaveBytes_c; - deinterleaveBytes = deinterleaveBytes_c; - vu9_to_vu12 = vu9_to_vu12_c; - yvu9_to_yuy2 = yvu9_to_yuy2_c; - - uyvytoyuv420 = uyvytoyuv420_c; - uyvytoyuv422 = uyvytoyuv422_c; - yuyvtoyuv420 = yuyvtoyuv420_c; - yuyvtoyuv422 = yuyvtoyuv422_c; + ff_shuffle_bytes_1230 = shuffle_bytes_1230_c; + ff_shuffle_bytes_3012 = shuffle_bytes_3012_c; + ff_shuffle_bytes_3210 = shuffle_bytes_3210_c; + ff_rgb32tobgr16 = rgb32tobgr16_c; + ff_rgb32tobgr15 = rgb32tobgr15_c; + ff_yv12toyuy2 = yv12toyuy2_c; + ff_yv12touyvy = yv12touyvy_c; + ff_yuv422ptoyuy2 = yuv422ptoyuy2_c; + ff_yuv422ptouyvy = yuv422ptouyvy_c; + ff_yuy2toyv12 = yuy2toyv12_c; + ff_planar2x = planar2x_c; + ff_rgb24toyv12 = ff_rgb24toyv12_c; + ff_interleave_bytes = interleave_bytes_c; + ff_deinterleave_bytes = deinterleave_bytes_c; + ff_vu9_to_vu12 = vu9_to_vu12_c; + ff_yvu9_to_yuy2 = yvu9_to_yuy2_c; + + ff_uyvytoyuv420 = uyvytoyuv420_c; + ff_uyvytoyuv422 = uyvytoyuv422_c; + ff_yuyvtoyuv420 = yuyvtoyuv420_c; + ff_yuyvtoyuv422 = yuyvtoyuv422_c; } diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index c4dd8a4d83..9ae311c9b9 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -151,11 +151,11 @@ static int planarToNv12Wrapper(SwsContext *c, const uint8_t *src[], dstParam[0], dstStride[0]); if (c->dstFormat == AV_PIX_FMT_NV12) - interleaveBytes(src[1], src[2], dst, c->chrSrcW, (srcSliceH + 1) / 2, - srcStride[1], srcStride[2], dstStride[1]); + ff_interleave_bytes(src[1], src[2], dst, c->chrSrcW, (srcSliceH + 1) / 2, + srcStride[1], srcStride[2], dstStride[1]); else - interleaveBytes(src[2], src[1], dst, c->chrSrcW, (srcSliceH + 1) / 2, - srcStride[2], srcStride[1], dstStride[1]); + ff_interleave_bytes(src[2], src[1], dst, c->chrSrcW, (srcSliceH + 1) / 2, + srcStride[2], srcStride[1], dstStride[1]); return srcSliceH; } @@ -172,11 +172,11 @@ static int nv12ToPlanarWrapper(SwsContext *c, const uint8_t *src[], dstParam[0], dstStride[0]); if (c->srcFormat == AV_PIX_FMT_NV12) - deinterleaveBytes(src[1], dst1, dst2, c->chrSrcW, (srcSliceH + 1) / 2, - srcStride[1], dstStride[1], dstStride[2]); + ff_deinterleave_bytes(src[1], dst1, dst2, c->chrSrcW, (srcSliceH + 1) / 2, + srcStride[1], dstStride[1], dstStride[2]); else - deinterleaveBytes(src[1], dst2, dst1, c->chrSrcW, (srcSliceH + 1) / 2, - srcStride[1], dstStride[2], dstStride[1]); + ff_deinterleave_bytes(src[1], dst2, dst1, c->chrSrcW, (srcSliceH + 1) / 2, + srcStride[1], dstStride[2], dstStride[1]); return srcSliceH; } @@ -192,11 +192,11 @@ static int planarToNv24Wrapper(SwsContext *c, const uint8_t *src[], dstParam[0], dstStride[0]); if (c->dstFormat == AV_PIX_FMT_NV24) - interleaveBytes(src[1], src[2], dst, c->chrSrcW, srcSliceH, - srcStride[1], srcStride[2], dstStride[1]); + ff_interleave_bytes(src[1], src[2], dst, c->chrSrcW, srcSliceH, + srcStride[1], srcStride[2], dstStride[1]); else - interleaveBytes(src[2], src[1], dst, c->chrSrcW, srcSliceH, - srcStride[2], srcStride[1], dstStride[1]); + ff_interleave_bytes(src[2], src[1], dst, c->chrSrcW, srcSliceH, + srcStride[2], srcStride[1], dstStride[1]); return srcSliceH; } @@ -213,11 +213,11 @@ static int nv24ToPlanarWrapper(SwsContext *c, const uint8_t *src[], dstParam[0], dstStride[0]); if (c->srcFormat == AV_PIX_FMT_NV24) - deinterleaveBytes(src[1], dst1, dst2, c->chrSrcW, srcSliceH, - srcStride[1], dstStride[1], dstStride[2]); + ff_deinterleave_bytes(src[1], dst1, dst2, c->chrSrcW, srcSliceH, + srcStride[1], dstStride[1], dstStride[2]); else - deinterleaveBytes(src[1], dst2, dst1, c->chrSrcW, srcSliceH, - srcStride[1], dstStride[2], dstStride[1]); + ff_deinterleave_bytes(src[1], dst2, dst1, c->chrSrcW, srcSliceH, + srcStride[1], dstStride[2], dstStride[1]); return srcSliceH; } @@ -330,8 +330,8 @@ static int planarToYuy2Wrapper(SwsContext *c, const uint8_t *src[], { uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY; - yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0], - srcStride[1], dstStride[0]); + ff_yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, + srcStride[0], srcStride[1], dstStride[0]); return srcSliceH; } @@ -342,8 +342,8 @@ static int planarToUyvyWrapper(SwsContext *c, const uint8_t *src[], { uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY; - yv12touyvy(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0], - srcStride[1], dstStride[0]); + ff_yv12touyvy(src[0], src[1], src[2], dst, c->srcW, srcSliceH, + srcStride[0], srcStride[1], dstStride[0]); return srcSliceH; } @@ -354,8 +354,8 @@ static int yuv422pToYuy2Wrapper(SwsContext *c, const uint8_t *src[], { uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY; - yuv422ptoyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0], - srcStride[1], dstStride[0]); + ff_yuv422ptoyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH, + srcStride[0], srcStride[1], dstStride[0]); return srcSliceH; } @@ -366,8 +366,8 @@ static int yuv422pToUyvyWrapper(SwsContext *c, const uint8_t *src[], { uint8_t *dst = dstParam[0] + dstStride[0] * srcSliceY; - yuv422ptouyvy(src[0], src[1], src[2], dst, c->srcW, srcSliceH, srcStride[0], - srcStride[1], dstStride[0]); + ff_yuv422ptouyvy(src[0], src[1], src[2], dst, c->srcW, srcSliceH, + srcStride[0], srcStride[1], dstStride[0]); return srcSliceH; } @@ -380,8 +380,8 @@ static int yuyvToYuv420Wrapper(SwsContext *c, const uint8_t *src[], uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY / 2; uint8_t *vdst = dstParam[2] + dstStride[2] * srcSliceY / 2; - yuyvtoyuv420(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], - dstStride[1], srcStride[0]); + ff_yuyvtoyuv420(ydst, udst, vdst, src[0], c->srcW, srcSliceH, + dstStride[0], dstStride[1], srcStride[0]); if (dstParam[3]) fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); @@ -397,8 +397,8 @@ static int yuyvToYuv422Wrapper(SwsContext *c, const uint8_t *src[], uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY; uint8_t *vdst = dstParam[2] + dstStride[2] * srcSliceY; - yuyvtoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], - dstStride[1], srcStride[0]); + ff_yuyvtoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, + dstStride[0], dstStride[1], srcStride[0]); return srcSliceH; } @@ -411,8 +411,8 @@ static int uyvyToYuv420Wrapper(SwsContext *c, const uint8_t *src[], uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY / 2; uint8_t *vdst = dstParam[2] + dstStride[2] * srcSliceY / 2; - uyvytoyuv420(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], - dstStride[1], srcStride[0]); + ff_uyvytoyuv420(ydst, udst, vdst, src[0], c->srcW, srcSliceH, + dstStride[0], dstStride[1], srcStride[0]); if (dstParam[3]) fillPlane(dstParam[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); @@ -428,8 +428,8 @@ static int uyvyToYuv422Wrapper(SwsContext *c, const uint8_t *src[], uint8_t *udst = dstParam[1] + dstStride[1] * srcSliceY; uint8_t *vdst = dstParam[2] + dstStride[2] * srcSliceY; - uyvytoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, dstStride[0], - dstStride[1], srcStride[0]); + ff_uyvytoyuv422(ydst, udst, vdst, src[0], c->srcW, srcSliceH, + dstStride[0], dstStride[1], srcStride[0]); return srcSliceH; } @@ -1472,96 +1472,96 @@ static rgbConvFn findRgbConvFn(SwsContext *c) if ( CONV_IS(ABGR, RGBA) || CONV_IS(ARGB, BGRA) || CONV_IS(BGRA, ARGB) - || CONV_IS(RGBA, ABGR)) conv = shuffle_bytes_3210; + || CONV_IS(RGBA, ABGR)) conv = ff_shuffle_bytes_3210; else if (CONV_IS(ABGR, ARGB) - || CONV_IS(ARGB, ABGR)) conv = shuffle_bytes_0321; + || CONV_IS(ARGB, ABGR)) conv = ff_shuffle_bytes_0321; else if (CONV_IS(ABGR, BGRA) - || CONV_IS(ARGB, RGBA)) conv = shuffle_bytes_1230; + || CONV_IS(ARGB, RGBA)) conv = ff_shuffle_bytes_1230; else if (CONV_IS(BGRA, RGBA) - || CONV_IS(RGBA, BGRA)) conv = shuffle_bytes_2103; + || CONV_IS(RGBA, BGRA)) conv = ff_shuffle_bytes_2103; else if (CONV_IS(BGRA, ABGR) - || CONV_IS(RGBA, ARGB)) conv = shuffle_bytes_3012; + || CONV_IS(RGBA, ARGB)) conv = ff_shuffle_bytes_3012; } else if (isRGB48(srcFormat) && isRGB48(dstFormat)) { if (CONV_IS(RGB48LE, BGR48LE) || CONV_IS(BGR48LE, RGB48LE) || CONV_IS(RGB48BE, BGR48BE) - || CONV_IS(BGR48BE, RGB48BE)) conv = rgb48tobgr48_nobswap; + || CONV_IS(BGR48BE, RGB48BE)) conv = ff_rgb48tobgr48_nobswap; else if (CONV_IS(RGB48LE, BGR48BE) || CONV_IS(BGR48LE, RGB48BE) || CONV_IS(RGB48BE, BGR48LE) - || CONV_IS(BGR48BE, RGB48LE)) conv = rgb48tobgr48_bswap; + || CONV_IS(BGR48BE, RGB48LE)) conv = ff_rgb48tobgr48_bswap; } else if (isRGB48(srcFormat) && isRGBA64(dstFormat)) { if (CONV_IS(RGB48LE, BGRA64LE) || CONV_IS(BGR48LE, RGBA64LE) || CONV_IS(RGB48BE, BGRA64BE) - || CONV_IS(BGR48BE, RGBA64BE)) conv = rgb48tobgr64_nobswap; + || CONV_IS(BGR48BE, RGBA64BE)) conv = ff_rgb48tobgr64_nobswap; else if (CONV_IS(RGB48LE, BGRA64BE) || CONV_IS(BGR48LE, RGBA64BE) || CONV_IS(RGB48BE, BGRA64LE) - || CONV_IS(BGR48BE, RGBA64LE)) conv = rgb48tobgr64_bswap; + || CONV_IS(BGR48BE, RGBA64LE)) conv = ff_rgb48tobgr64_bswap; if (CONV_IS(RGB48LE, RGBA64LE) || CONV_IS(BGR48LE, BGRA64LE) || CONV_IS(RGB48BE, RGBA64BE) - || CONV_IS(BGR48BE, BGRA64BE)) conv = rgb48to64_nobswap; + || CONV_IS(BGR48BE, BGRA64BE)) conv = ff_rgb48to64_nobswap; else if (CONV_IS(RGB48LE, RGBA64BE) || CONV_IS(BGR48LE, BGRA64BE) || CONV_IS(RGB48BE, RGBA64LE) - || CONV_IS(BGR48BE, BGRA64LE)) conv = rgb48to64_bswap; + || CONV_IS(BGR48BE, BGRA64LE)) conv = ff_rgb48to64_bswap; } else if (isRGBA64(srcFormat) && isRGB48(dstFormat)) { if (CONV_IS(RGBA64LE, BGR48LE) || CONV_IS(BGRA64LE, RGB48LE) || CONV_IS(RGBA64BE, BGR48BE) - || CONV_IS(BGRA64BE, RGB48BE)) conv = rgb64tobgr48_nobswap; + || CONV_IS(BGRA64BE, RGB48BE)) conv = ff_rgb64tobgr48_nobswap; else if (CONV_IS(RGBA64LE, BGR48BE) || CONV_IS(BGRA64LE, RGB48BE) || CONV_IS(RGBA64BE, BGR48LE) - || CONV_IS(BGRA64BE, RGB48LE)) conv = rgb64tobgr48_bswap; + || CONV_IS(BGRA64BE, RGB48LE)) conv = ff_rgb64tobgr48_bswap; else if (CONV_IS(RGBA64LE, RGB48LE) || CONV_IS(BGRA64LE, BGR48LE) || CONV_IS(RGBA64BE, RGB48BE) - || CONV_IS(BGRA64BE, BGR48BE)) conv = rgb64to48_nobswap; + || CONV_IS(BGRA64BE, BGR48BE)) conv = ff_rgb64to48_nobswap; else if (CONV_IS(RGBA64LE, RGB48BE) || CONV_IS(BGRA64LE, BGR48BE) || CONV_IS(RGBA64BE, RGB48LE) - || CONV_IS(BGRA64BE, BGR48LE)) conv = rgb64to48_bswap; + || CONV_IS(BGRA64BE, BGR48LE)) conv = ff_rgb64to48_bswap; } else /* BGR -> BGR */ if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) || (isRGBinInt(srcFormat) && isRGBinInt(dstFormat))) { switch (srcId | (dstId << 16)) { - case 0x000F000C: conv = rgb12to15; break; - case 0x000F0010: conv = rgb16to15; break; - case 0x000F0018: conv = rgb24to15; break; - case 0x000F0020: conv = rgb32to15; break; - case 0x0010000F: conv = rgb15to16; break; - case 0x00100018: conv = rgb24to16; break; - case 0x00100020: conv = rgb32to16; break; - case 0x0018000F: conv = rgb15to24; break; - case 0x00180010: conv = rgb16to24; break; - case 0x00180020: conv = rgb32to24; break; - case 0x0020000F: conv = rgb15to32; break; - case 0x00200010: conv = rgb16to32; break; - case 0x00200018: conv = rgb24to32; break; + case 0x000F000C: conv = ff_rgb12to15; break; + case 0x000F0010: conv = ff_rgb16to15; break; + case 0x000F0018: conv = ff_rgb24to15; break; + case 0x000F0020: conv = ff_rgb32to15; break; + case 0x0010000F: conv = ff_rgb15to16; break; + case 0x00100018: conv = ff_rgb24to16; break; + case 0x00100020: conv = ff_rgb32to16; break; + case 0x0018000F: conv = ff_rgb15to24; break; + case 0x00180010: conv = ff_rgb16to24; break; + case 0x00180020: conv = ff_rgb32to24; break; + case 0x0020000F: conv = ff_rgb15to32; break; + case 0x00200010: conv = ff_rgb16to32; break; + case 0x00200018: conv = ff_rgb24to32; break; } } else if ((isBGRinInt(srcFormat) && isRGBinInt(dstFormat)) || (isRGBinInt(srcFormat) && isBGRinInt(dstFormat))) { switch (srcId | (dstId << 16)) { - case 0x000C000C: conv = rgb12tobgr12; break; - case 0x000F000F: conv = rgb15tobgr15; break; - case 0x000F0010: conv = rgb16tobgr15; break; - case 0x000F0018: conv = rgb24tobgr15; break; - case 0x000F0020: conv = rgb32tobgr15; break; - case 0x0010000F: conv = rgb15tobgr16; break; - case 0x00100010: conv = rgb16tobgr16; break; - case 0x00100018: conv = rgb24tobgr16; break; - case 0x00100020: conv = rgb32tobgr16; break; - case 0x0018000F: conv = rgb15tobgr24; break; - case 0x00180010: conv = rgb16tobgr24; break; - case 0x00180018: conv = rgb24tobgr24; break; - case 0x00180020: conv = rgb32tobgr24; break; - case 0x0020000F: conv = rgb15tobgr32; break; - case 0x00200010: conv = rgb16tobgr32; break; - case 0x00200018: conv = rgb24tobgr32; break; + case 0x000C000C: conv = ff_rgb12tobgr12; break; + case 0x000F000F: conv = ff_rgb15tobgr15; break; + case 0x000F0010: conv = ff_rgb16tobgr15; break; + case 0x000F0018: conv = ff_rgb24tobgr15; break; + case 0x000F0020: conv = ff_rgb32tobgr15; break; + case 0x0010000F: conv = ff_rgb15tobgr16; break; + case 0x00100010: conv = ff_rgb16tobgr16; break; + case 0x00100018: conv = ff_rgb24tobgr16; break; + case 0x00100020: conv = ff_rgb32tobgr16; break; + case 0x0018000F: conv = ff_rgb15tobgr24; break; + case 0x00180010: conv = ff_rgb16tobgr24; break; + case 0x00180018: conv = ff_rgb24tobgr24; break; + case 0x00180020: conv = ff_rgb32tobgr24; break; + case 0x0020000F: conv = ff_rgb15tobgr32; break; + case 0x00200010: conv = ff_rgb16tobgr32; break; + case 0x00200018: conv = ff_rgb24tobgr32; break; } } @@ -1662,10 +1662,10 @@ static int yvu9ToYv12Wrapper(SwsContext *c, const uint8_t *src[], copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW, dst[0], dstStride[0]); - planar2x(src[1], dst[1] + dstStride[1] * (srcSliceY >> 1), c->chrSrcW, - srcSliceH >> 2, srcStride[1], dstStride[1]); - planar2x(src[2], dst[2] + dstStride[2] * (srcSliceY >> 1), c->chrSrcW, - srcSliceH >> 2, srcStride[2], dstStride[2]); + ff_planar2x(src[1], dst[1] + dstStride[1] * (srcSliceY >> 1), c->chrSrcW, + srcSliceH >> 2, srcStride[1], dstStride[1]); + ff_planar2x(src[2], dst[2] + dstStride[2] * (srcSliceY >> 1), c->chrSrcW, + srcSliceH >> 2, srcStride[2], dstStride[2]); if (dst[3]) fillPlane(dst[3], dstStride[3], c->srcW, srcSliceH, srcSliceY, 255); return srcSliceH; diff --git a/libswscale/tests/colorspace.c b/libswscale/tests/colorspace.c index d1eddc82bf..589b2260b4 100644 --- a/libswscale/tests/colorspace.c +++ b/libswscale/tests/colorspace.c @@ -55,42 +55,42 @@ int main(int argc, char **argv) const char *name; void (*func)(const uint8_t *src, uint8_t *dst, int src_size); } func_info[] = { - FUNC(2, 2, rgb12to15), - FUNC(2, 2, rgb15to16), - FUNC(2, 3, rgb15to24), - FUNC(2, 4, rgb15to32), - FUNC(2, 3, rgb16to24), - FUNC(2, 4, rgb16to32), - FUNC(3, 2, rgb24to15), - FUNC(3, 2, rgb24to16), - FUNC(3, 4, rgb24to32), - FUNC(4, 2, rgb32to15), - FUNC(4, 2, rgb32to16), - FUNC(4, 3, rgb32to24), - FUNC(2, 2, rgb16to15), - FUNC(2, 2, rgb12tobgr12), - FUNC(2, 2, rgb15tobgr15), - FUNC(2, 2, rgb15tobgr16), - FUNC(2, 3, rgb15tobgr24), - FUNC(2, 4, rgb15tobgr32), - FUNC(2, 2, rgb16tobgr15), - FUNC(2, 2, rgb16tobgr16), - FUNC(2, 3, rgb16tobgr24), - FUNC(2, 4, rgb16tobgr32), - FUNC(3, 2, rgb24tobgr15), - FUNC(3, 2, rgb24tobgr16), - FUNC(3, 3, rgb24tobgr24), - FUNC(3, 4, rgb24tobgr32), - FUNC(4, 2, rgb32tobgr15), - FUNC(4, 2, rgb32tobgr16), - FUNC(4, 3, rgb32tobgr24), - FUNC(4, 4, shuffle_bytes_2103), /* rgb32tobgr32 */ - FUNC(6, 6, rgb48tobgr48_nobswap), - FUNC(6, 6, rgb48tobgr48_bswap), - FUNC(8, 6, rgb64to48_nobswap), - FUNC(8, 6, rgb64to48_bswap), - FUNC(8, 6, rgb64tobgr48_nobswap), - FUNC(8, 6, rgb64tobgr48_bswap), + FUNC(2, 2, ff_rgb12to15), + FUNC(2, 2, ff_rgb15to16), + FUNC(2, 3, ff_rgb15to24), + FUNC(2, 4, ff_rgb15to32), + FUNC(2, 3, ff_rgb16to24), + FUNC(2, 4, ff_rgb16to32), + FUNC(3, 2, ff_rgb24to15), + FUNC(3, 2, ff_rgb24to16), + FUNC(3, 4, ff_rgb24to32), + FUNC(4, 2, ff_rgb32to15), + FUNC(4, 2, ff_rgb32to16), + FUNC(4, 3, ff_rgb32to24), + FUNC(2, 2, ff_rgb16to15), + FUNC(2, 2, ff_rgb12tobgr12), + FUNC(2, 2, ff_rgb15tobgr15), + FUNC(2, 2, ff_rgb15tobgr16), + FUNC(2, 3, ff_rgb15tobgr24), + FUNC(2, 4, ff_rgb15tobgr32), + FUNC(2, 2, ff_rgb16tobgr15), + FUNC(2, 2, ff_rgb16tobgr16), + FUNC(2, 3, ff_rgb16tobgr24), + FUNC(2, 4, ff_rgb16tobgr32), + FUNC(3, 2, ff_rgb24tobgr15), + FUNC(3, 2, ff_rgb24tobgr16), + FUNC(3, 3, ff_rgb24tobgr24), + FUNC(3, 4, ff_rgb24tobgr32), + FUNC(4, 2, ff_rgb32tobgr15), + FUNC(4, 2, ff_rgb32tobgr16), + FUNC(4, 3, ff_rgb32tobgr24), + FUNC(4, 4, ff_shuffle_bytes_2103), /* rgb32tobgr32 */ + FUNC(6, 6, ff_rgb48tobgr48_nobswap), + FUNC(6, 6, ff_rgb48tobgr48_bswap), + FUNC(8, 6, ff_rgb64to48_nobswap), + FUNC(8, 6, ff_rgb64to48_bswap), + FUNC(8, 6, ff_rgb64tobgr48_nobswap), + FUNC(8, 6, ff_rgb64tobgr48_bswap), FUNC(0, 0, NULL) }; int width; diff --git a/libswscale/utils.c b/libswscale/utils.c index 352a8ed116..e85c3508c5 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1200,7 +1200,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, cpu_flags = av_get_cpu_flags(); flags = c->flags; emms_c(); - if (!rgb15to16) + if (!ff_rgb15to16) ff_sws_rgb2rgb_init(); unscaled = (srcW == dstW && srcH == dstH); diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index 4344b5f714..bd5c42e272 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -162,7 +162,7 @@ void ff_uyvytoyuv422_avx(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int lumStride, int chromStride, int srcStride); #endif -av_cold void rgb2rgb_init_x86(void) +av_cold void ff_rgb2rgb_init_x86(void) { int cpu_flags = av_get_cpu_flags(); @@ -180,23 +180,23 @@ av_cold void rgb2rgb_init_x86(void) #endif /* HAVE_INLINE_ASM */ if (EXTERNAL_MMXEXT(cpu_flags)) { - shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext; + ff_shuffle_bytes_2103 = ff_shuffle_bytes_2103_mmxext; } if (EXTERNAL_SSE2(cpu_flags)) { #if ARCH_X86_64 - uyvytoyuv422 = ff_uyvytoyuv422_sse2; + ff_uyvytoyuv422 = ff_uyvytoyuv422_sse2; #endif } if (EXTERNAL_SSSE3(cpu_flags)) { - shuffle_bytes_0321 = ff_shuffle_bytes_0321_ssse3; - shuffle_bytes_2103 = ff_shuffle_bytes_2103_ssse3; - shuffle_bytes_1230 = ff_shuffle_bytes_1230_ssse3; - shuffle_bytes_3012 = ff_shuffle_bytes_3012_ssse3; - shuffle_bytes_3210 = ff_shuffle_bytes_3210_ssse3; + ff_shuffle_bytes_0321 = ff_shuffle_bytes_0321_ssse3; + ff_shuffle_bytes_2103 = ff_shuffle_bytes_2103_ssse3; + ff_shuffle_bytes_1230 = ff_shuffle_bytes_1230_ssse3; + ff_shuffle_bytes_3012 = ff_shuffle_bytes_3012_ssse3; + ff_shuffle_bytes_3210 = ff_shuffle_bytes_3210_ssse3; } if (EXTERNAL_AVX(cpu_flags)) { #if ARCH_X86_64 - uyvytoyuv422 = ff_uyvytoyuv422_avx; + ff_uyvytoyuv422 = ff_uyvytoyuv422_avx; #endif } } diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c index ae2469e663..87f365cacf 100644 --- a/libswscale/x86/rgb2rgb_template.c +++ b/libswscale/x86/rgb2rgb_template.c @@ -1823,9 +1823,9 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_ #endif /* !COMPILE_TEMPLATE_SSE2 */ #if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX -static void RENAME(interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest, - int width, int height, int src1Stride, - int src2Stride, int dstStride) +static void RENAME(interleave_bytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dest, + int width, int height, int src1Stride, + int src2Stride, int dstStride) { int h; @@ -1906,9 +1906,9 @@ void RENAME(ff_nv12ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src2, int w, uint32_t *unused2); -static void RENAME(deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, - int width, int height, int srcStride, - int dst1Stride, int dst2Stride) +static void RENAME(deinterleave_bytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, + int width, int height, int srcStride, + int dst1Stride, int dst2Stride) { int h; @@ -2495,51 +2495,51 @@ static av_cold void RENAME(rgb2rgb_init)(void) { #if !COMPILE_TEMPLATE_SSE2 #if !COMPILE_TEMPLATE_AMD3DNOW - rgb15to16 = RENAME(rgb15to16); - rgb15tobgr24 = RENAME(rgb15tobgr24); - rgb15to32 = RENAME(rgb15to32); - rgb16tobgr24 = RENAME(rgb16tobgr24); - rgb16to32 = RENAME(rgb16to32); - rgb16to15 = RENAME(rgb16to15); - rgb24tobgr16 = RENAME(rgb24tobgr16); - rgb24tobgr15 = RENAME(rgb24tobgr15); - rgb24tobgr32 = RENAME(rgb24tobgr32); - rgb32to16 = RENAME(rgb32to16); - rgb32to15 = RENAME(rgb32to15); - rgb32tobgr24 = RENAME(rgb32tobgr24); - rgb24to15 = RENAME(rgb24to15); - rgb24to16 = RENAME(rgb24to16); - rgb24tobgr24 = RENAME(rgb24tobgr24); - rgb32tobgr16 = RENAME(rgb32tobgr16); - rgb32tobgr15 = RENAME(rgb32tobgr15); - yv12toyuy2 = RENAME(yv12toyuy2); - yv12touyvy = RENAME(yv12touyvy); - yuv422ptoyuy2 = RENAME(yuv422ptoyuy2); - yuv422ptouyvy = RENAME(yuv422ptouyvy); - yuy2toyv12 = RENAME(yuy2toyv12); - vu9_to_vu12 = RENAME(vu9_to_vu12); - yvu9_to_yuy2 = RENAME(yvu9_to_yuy2); - uyvytoyuv422 = RENAME(uyvytoyuv422); - yuyvtoyuv422 = RENAME(yuyvtoyuv422); + ff_rgb15to16 = RENAME(rgb15to16); + ff_rgb15tobgr24 = RENAME(rgb15tobgr24); + ff_rgb15to32 = RENAME(rgb15to32); + ff_rgb16tobgr24 = RENAME(rgb16tobgr24); + ff_rgb16to32 = RENAME(rgb16to32); + ff_rgb16to15 = RENAME(rgb16to15); + ff_rgb24tobgr16 = RENAME(rgb24tobgr16); + ff_rgb24tobgr15 = RENAME(rgb24tobgr15); + ff_rgb24tobgr32 = RENAME(rgb24tobgr32); + ff_rgb32to16 = RENAME(rgb32to16); + ff_rgb32to15 = RENAME(rgb32to15); + ff_rgb32tobgr24 = RENAME(rgb32tobgr24); + ff_rgb24to15 = RENAME(rgb24to15); + ff_rgb24to16 = RENAME(rgb24to16); + ff_rgb24tobgr24 = RENAME(rgb24tobgr24); + ff_rgb32tobgr16 = RENAME(rgb32tobgr16); + ff_rgb32tobgr15 = RENAME(rgb32tobgr15); + ff_yv12toyuy2 = RENAME(yv12toyuy2); + ff_yv12touyvy = RENAME(yv12touyvy); + ff_yuv422ptoyuy2 = RENAME(yuv422ptoyuy2); + ff_yuv422ptouyvy = RENAME(yuv422ptouyvy); + ff_yuy2toyv12 = RENAME(yuy2toyv12); + ff_vu9_to_vu12 = RENAME(vu9_to_vu12); + ff_yvu9_to_yuy2 = RENAME(yvu9_to_yuy2); + ff_uyvytoyuv422 = RENAME(uyvytoyuv422); + ff_yuyvtoyuv422 = RENAME(yuyvtoyuv422); #endif /* !COMPILE_TEMPLATE_AMD3DNOW */ #if COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW - planar2x = RENAME(planar2x); + ff_planar2x = RENAME(planar2x); #endif /* COMPILE_TEMPLATE_MMXEXT || COMPILE_TEMPLATE_AMD3DNOW */ #if HAVE_7REGS - ff_rgb24toyv12 = RENAME(rgb24toyv12); + ff_rgb24toyv12 = RENAME(rgb24toyv12); #endif /* HAVE_7REGS */ - yuyvtoyuv420 = RENAME(yuyvtoyuv420); - uyvytoyuv420 = RENAME(uyvytoyuv420); + ff_yuyvtoyuv420 = RENAME(yuyvtoyuv420); + ff_uyvytoyuv420 = RENAME(uyvytoyuv420); #endif /* !COMPILE_TEMPLATE_SSE2 */ #if !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX - interleaveBytes = RENAME(interleaveBytes); + ff_interleave_bytes = RENAME(interleave_bytes); #endif /* !COMPILE_TEMPLATE_AMD3DNOW && !COMPILE_TEMPLATE_AVX */ #if !COMPILE_TEMPLATE_AVX || HAVE_AVX_EXTERNAL #if !COMPILE_TEMPLATE_AMD3DNOW && (ARCH_X86_32 || COMPILE_TEMPLATE_SSE2) && COMPILE_TEMPLATE_MMXEXT == COMPILE_TEMPLATE_SSE2 && HAVE_X86ASM - deinterleaveBytes = RENAME(deinterleaveBytes); + ff_deinterleave_bytes = RENAME(deinterleave_bytes); #endif #endif } diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c index c29b75d09b..2ab5e7ea13 100644 --- a/tests/checkasm/sw_rgb.c +++ b/tests/checkasm/sw_rgb.c @@ -89,7 +89,7 @@ static void check_uyvy_to_422p(void) randomize_buffers(src0, MAX_STRIDE * MAX_HEIGHT * 2); memcpy(src1, src0, MAX_STRIDE * MAX_HEIGHT * 2); - if (check_func(uyvytoyuv422, "uyvytoyuv422")) { + if (check_func(ff_uyvytoyuv422, "uyvytoyuv422")) { for (i = 0; i < 6; i ++) { memset(dst_y_0, 0, MAX_STRIDE * MAX_HEIGHT); memset(dst_y_1, 0, MAX_STRIDE * MAX_HEIGHT); @@ -131,7 +131,7 @@ static void check_interleave_bytes(void) randomize_buffers(src0, MAX_STRIDE * MAX_HEIGHT); randomize_buffers(src1, MAX_STRIDE * MAX_HEIGHT); - if (check_func(interleaveBytes, "interleave_bytes")) { + if (check_func(ff_interleave_bytes, "ff_interleave_bytes")) { for (int i = 0; i <= 16; i++) { // Try all widths [1,16], and try one random width. @@ -172,7 +172,7 @@ static void check_interleave_bytes(void) bench_new(src0, src1, dst1, 127, MAX_HEIGHT, MAX_STRIDE, MAX_STRIDE, 2*MAX_STRIDE); } - if (check_func(interleaveBytes, "interleave_bytes_aligned")) { + if (check_func(ff_interleave_bytes, "interleave_bytes_aligned")) { // Bench the function in a more typical case, with aligned // buffers and widths. bench_new(src0_buf, src1_buf, dst1_buf, 128, MAX_HEIGHT, @@ -184,19 +184,19 @@ void checkasm_check_sw_rgb(void) { ff_sws_rgb2rgb_init(); - check_shuffle_bytes(shuffle_bytes_2103, "shuffle_bytes_2103"); + check_shuffle_bytes(ff_shuffle_bytes_2103, "shuffle_bytes_2103"); report("shuffle_bytes_2103"); - check_shuffle_bytes(shuffle_bytes_0321, "shuffle_bytes_0321"); + check_shuffle_bytes(ff_shuffle_bytes_0321, "shuffle_bytes_0321"); report("shuffle_bytes_0321"); - check_shuffle_bytes(shuffle_bytes_1230, "shuffle_bytes_1230"); + check_shuffle_bytes(ff_shuffle_bytes_1230, "shuffle_bytes_1230"); report("shuffle_bytes_1230"); - check_shuffle_bytes(shuffle_bytes_3012, "shuffle_bytes_3012"); + check_shuffle_bytes(ff_shuffle_bytes_3012, "shuffle_bytes_3012"); report("shuffle_bytes_3012"); - check_shuffle_bytes(shuffle_bytes_3210, "shuffle_bytes_3210"); + check_shuffle_bytes(ff_shuffle_bytes_3210, "shuffle_bytes_3210"); report("shuffle_bytes_3210"); check_uyvy_to_422p();