Re: [FFmpeg-devel] [PATCH] vf_blend: Reduce number of arguments for kernel function

2016-02-14 Thread Timothy Gu
On Sun, Feb 14, 2016 at 10:12:21AM +0100, Paul B Mahol wrote:
> On 2/14/16, Timothy Gu  wrote:
> > ---
> >  libavfilter/blend.h |  2 +-
> >  libavfilter/vf_blend.c  | 27 ++-
> >  libavfilter/x86/vf_blend.asm|  3 +--
> >  libavfilter/x86/vf_blend_init.c |  2 +-
> >  4 files changed, 17 insertions(+), 17 deletions(-)
> >
> 
> ok if it works

Pushed, thanks for the review.

Timothy
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vf_blend: Reduce number of arguments for kernel function

2016-02-14 Thread Paul B Mahol
On 2/14/16, Timothy Gu  wrote:
> ---
>  libavfilter/blend.h |  2 +-
>  libavfilter/vf_blend.c  | 27 ++-
>  libavfilter/x86/vf_blend.asm|  3 +--
>  libavfilter/x86/vf_blend_init.c |  2 +-
>  4 files changed, 17 insertions(+), 17 deletions(-)
>

ok if it works
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vf_blend: Reduce number of arguments for kernel function

2016-02-13 Thread Timothy Gu
---
 libavfilter/blend.h |  2 +-
 libavfilter/vf_blend.c  | 27 ++-
 libavfilter/x86/vf_blend.asm|  3 +--
 libavfilter/x86/vf_blend_init.c |  2 +-
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavfilter/blend.h b/libavfilter/blend.h
index 161055c..7003505 100644
--- a/libavfilter/blend.h
+++ b/libavfilter/blend.h
@@ -67,7 +67,7 @@ typedef struct FilterParams {
 void (*blend)(const uint8_t *top, ptrdiff_t top_linesize,
   const uint8_t *bottom, ptrdiff_t bottom_linesize,
   uint8_t *dst, ptrdiff_t dst_linesize,
-  ptrdiff_t width, ptrdiff_t start, ptrdiff_t end,
+  ptrdiff_t width, ptrdiff_t height,
   struct FilterParams *param, double *values);
 } FilterParams;
 
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 2b734b4..1c9924a 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -121,22 +121,22 @@ AVFILTER_DEFINE_CLASS(blend);
 static void blend_normal(const uint8_t *top, ptrdiff_t top_linesize,
  const uint8_t *bottom, ptrdiff_t bottom_linesize,
  uint8_t *dst, ptrdiff_t dst_linesize,
- ptrdiff_t width, ptrdiff_t start, ptrdiff_t end,
+ ptrdiff_t width, ptrdiff_t height,
  FilterParams *param, double *values)
 {
-av_image_copy_plane(dst, dst_linesize, top, top_linesize, width, end - 
start);
+av_image_copy_plane(dst, dst_linesize, top, top_linesize, width, height);
 }
 
 static void blend_normal_8bit(const uint8_t *top, ptrdiff_t top_linesize,
   const uint8_t *bottom, ptrdiff_t bottom_linesize,
   uint8_t *dst, ptrdiff_t dst_linesize,
-  ptrdiff_t width, ptrdiff_t start, ptrdiff_t end,
+  ptrdiff_t width, ptrdiff_t height,
   FilterParams *param, double *values)
 {
 const double opacity = param->opacity;
 int i, j;
 
-for (i = start; i < end; i++) {
+for (i = 0; i < height; i++) {
 for (j = 0; j < width; j++) {
 dst[j] = top[j] * opacity + bottom[j] * (1. - opacity);
 }
@@ -149,7 +149,7 @@ static void blend_normal_8bit(const uint8_t *top, ptrdiff_t 
top_linesize,
 static void blend_normal_16bit(const uint8_t *_top, ptrdiff_t top_linesize,
   const uint8_t *_bottom, ptrdiff_t 
bottom_linesize,
   uint8_t *_dst, ptrdiff_t dst_linesize,
-  ptrdiff_t width, ptrdiff_t start, ptrdiff_t 
end,
+  ptrdiff_t width, ptrdiff_t height,
   FilterParams *param, double *values)
 {
 const uint16_t *top = (uint16_t*)_top;
@@ -161,7 +161,7 @@ static void blend_normal_16bit(const uint8_t *_top, 
ptrdiff_t top_linesize,
 top_linesize /= 2;
 bottom_linesize /= 2;
 
-for (i = start; i < end; i++) {
+for (i = 0; i < height; i++) {
 for (j = 0; j < width; j++) {
 dst[j] = top[j] * opacity + bottom[j] * (1. - opacity);
 }
@@ -175,13 +175,13 @@ static void blend_normal_16bit(const uint8_t *_top, 
ptrdiff_t top_linesize,
 static void blend_## name##_8bit(const uint8_t *top, ptrdiff_t top_linesize,   
  \
  const uint8_t *bottom, ptrdiff_t 
bottom_linesize,   \
  uint8_t *dst, ptrdiff_t dst_linesize, 
  \
- ptrdiff_t width, ptrdiff_t start, ptrdiff_t 
end,\
+ ptrdiff_t width, ptrdiff_t height,
\
  FilterParams *param, double *values)  
\
 {  
\
 double opacity = param->opacity;   
\
 int i, j;  
\

\
-for (i = start; i < end; i++) {
\
+for (i = 0; i < height; i++) { 
\
 for (j = 0; j < width; j++) {  
\
 dst[j] = top[j] + ((expr) - top[j]) * opacity; 
\
 }  
\
@@ -195,7 +195,7 @@ static void blend_## name##_8bit(const uint8_t *top, 
ptrdiff_t top_linesize,
 static void blend_## name##_16bit(const uint8_t *_top, ptrdiff_t top_linesize, 
  \
   const uint8_t *_bottom, ptrdiff_t 
bottom_linesize, \
   uint8_t *_dst, ptrdiff_t dst_linesize,