diff mbox

[FFmpeg-devel,v2] swscale: Remove duplicated code

Message ID 20190326085834.f59d563f90d83535a8c59684@gmx.com
State New
Headers show

Commit Message

Lauri Kasanen March 26, 2019, 6:58 a.m. UTC
In this function, the exact same clamping happens both in the if and unconditionally.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
---
 libswscale/output.c | 10 ----------
 1 file changed, 10 deletions(-)

v2: Remove the unconditional instead of the if'd clipping.
I'll leave changing the bit pattern to others, there's so many funcs using 0x100.

--
2.6.2

Comments

Michael Niedermayer March 26, 2019, 9 p.m. UTC | #1
On Tue, Mar 26, 2019 at 08:58:34AM +0200, Lauri Kasanen wrote:
> In this function, the exact same clamping happens both in the if and unconditionally.
> 
> Signed-off-by: Lauri Kasanen <cand@gmx.com>
> ---
>  libswscale/output.c | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> v2: Remove the unconditional instead of the if'd clipping.
> I'll leave changing the bit pattern to others, there's so many funcs using 0x100.
> 
> diff --git a/libswscale/output.c b/libswscale/output.c
> index d7c53e6..d3401f0 100644
> --- a/libswscale/output.c
> +++ b/libswscale/output.c

should be ok

thanks

[...]
Lauri Kasanen March 27, 2019, 6:59 a.m. UTC | #2
On Tue, 26 Mar 2019 22:00:54 +0100
Michael Niedermayer <michael@niedermayer.cc> wrote:

> On Tue, Mar 26, 2019 at 08:58:34AM +0200, Lauri Kasanen wrote:
> > In this function, the exact same clamping happens both in the if and unconditionally.
> >
> > Signed-off-by: Lauri Kasanen <cand@gmx.com>
> > ---
> >  libswscale/output.c | 10 ----------
> >  1 file changed, 10 deletions(-)
> >
> > v2: Remove the unconditional instead of the if'd clipping.
> > I'll leave changing the bit pattern to others, there's so many funcs using 0x100.
> >
> > diff --git a/libswscale/output.c b/libswscale/output.c
> > index d7c53e6..d3401f0 100644
> > --- a/libswscale/output.c
> > +++ b/libswscale/output.c
>
> should be ok
>
> thanks

Applying.

- Lauri
diff mbox

Patch

diff --git a/libswscale/output.c b/libswscale/output.c
index d7c53e6..d3401f0 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -853,11 +853,6 @@  yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
                 V  = av_clip_uint8(V);
             }

-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-            U  = av_clip_uint8(U);
-            V  = av_clip_uint8(V);
-
             output_pixels(i * 4, Y1, U, Y2, V);
         }
     } else {
@@ -875,11 +870,6 @@  yuv2422_1_c_template(SwsContext *c, const int16_t *buf0,
                 V  = av_clip_uint8(V);
             }

-            Y1 = av_clip_uint8(Y1);
-            Y2 = av_clip_uint8(Y2);
-            U  = av_clip_uint8(U);
-            V  = av_clip_uint8(V);
-
             output_pixels(i * 4, Y1, U, Y2, V);
         }
     }