[FFmpeg-devel] [PATCH] swscale: fix To{Y, UV} extern prototypes.

Clément Bœsch ubitux at gmail.com
Sun Sep 30 20:48:23 CEST 2012


On Sun, Sep 30, 2012 at 05:04:20PM +0200, Michael Niedermayer wrote:
> On Sun, Sep 30, 2012 at 10:54:02AM +0200, Clément Bœsch wrote:
> > This fix a bunch of "assignment from incompatible pointer type" warnings
> > with GCC.
> > ---
> > What I'm afraid of is that the prototypes don't seem to match what's in
> > sws/x86/input.asm (based on the comments) in comparison to the C versions in
> > sws/swscale.c.
> 
> i think the comments are wrong 

OK, see attached patch then.

> following is the difference of the input.asm "prototypes" to libav
> 
> -cglobal %2 %+ 24ToY, 3, 3, %1, dst, src, w
> +cglobal %2 %+ 24ToY, 6, 6, %1, dst, src, u1, u2, w, u3
> -cglobal %2 %+ 24ToUV, 3, 4, %1, dstU, dstV, src, w
> +cglobal %2 %+ 24ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, u3
> -cglobal %2%3%4%5 %+ ToY, 3, 3, %1, dst, src, w
> +cglobal %2%3%4%5 %+ ToY, 6, 6, %1, dst, src, u1, u2, w, u3
> -cglobal %2%3%4%5 %+ ToUV, 3, 4, %1, dstU, dstV, src, w
> +cglobal %2%3%4%5 %+ ToUV, 7, 7, %1, dstU, dstV, u1, src, u2, w, u3
> -cglobal %2ToY, 3, 3, %1, dst, src, w
> +cglobal %2ToY, 5, 5, %1, dst, unused0, unused1, src, w
> -cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w
> +cglobal %2ToUV, 4, 5, %1, dstU, dstV, unused, src, w
> -cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w
> +cglobal %2ToUV, 4, 5, %1, dstU, dstV, unused, src, w
> 

Right, OK

> 
> > 
> > AFAIU, those prototypes were simplified by libav but it seems they were kept
> > unchanged in FFmpeg (because of a bug? because the prototypes could be shared
> > with the others functions?). Though, it might be important to check the if the
> 
> the prototypes where the same originally, the additional fields
> where added by me to support planar RGB (packed was fine with 1 pointer
> but planar needed 3)
> libav later reimplemented planar rgb support by adding a seperate
> function pointer that takes 3, leaving the existing with 1 and adding
> a if() to all calls

Wouldn't it make sense to keep them in sync?

> 
> [...]
> 
> the patch should be ok
> 

Applied, thanks.

-- 
Clément B.
-------------- next part --------------
From 9fb77f0cbb8ac45f9888b9bd65b3689f434a33cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
Date: Sun, 30 Sep 2012 20:51:37 +0200
Subject: [PATCH] sws/x86: keep comments in sync with real prototypes.

---
 libswscale/x86/input.asm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libswscale/x86/input.asm b/libswscale/x86/input.asm
index 0124c66..ae6ead3 100644
--- a/libswscale/x86/input.asm
+++ b/libswscale/x86/input.asm
@@ -74,10 +74,15 @@ SECTION .text
 ;-----------------------------------------------------------------------------
 ; RGB to Y/UV.
 ;
-; void <fmt>ToY_<opt>(uint8_t *dst, const uint8_t *src, int w);
+; void <fmt>ToY_<opt>(uint8_t *dst, const uint8_t *src,
+;                     const uint8_t *unused1, const uint8_t *unused2,
+;                     int w, uint32_t *unused);
 ; and
-; void <fmt>toUV_<opt>(uint8_t *dstU, uint8_t *dstV, const uint8_t *src,
-;                      const uint8_t *unused, int w);
+; void <fmt>toUV_<opt>(uint8_t *dstU, uint8_t *dstV,
+;                      const uint8_t *unused0,
+;                      const uint8_t *src1,
+;                      const uint8_t *src2,
+;                      int w, uint32_t *unused)
 ;-----------------------------------------------------------------------------
 
 ; %1 = nr. of XMM registers
-- 
1.7.12.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120930/443fdb48/attachment.asc>


More information about the ffmpeg-devel mailing list