Re: [FFmpeg-devel] [PATCH 1/2] avfilter: vf_minterpolate: rename chroma log vars

2016-09-02 Thread Paul B Mahol
On 8/30/16, Davinder Singh  wrote:
> On Mon, Aug 29, 2016 at 8:59 PM Paul B Mahol  wrote:
> [...]
>
> And using avcodec* stuff is in lavfi is not needed.
>
> uses AVPixFmtDesc now. should I also not use libavcodec/mathops.h? median
> of 3 function is shared. can it be moved?
>
> updated patch attached.
>

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


Re: [FFmpeg-devel] [PATCH 1/2] avfilter: vf_minterpolate: rename chroma log vars

2016-08-29 Thread Paul B Mahol
On Tuesday, August 30, 2016, Davinder Singh  wrote:

> On Mon, Aug 29, 2016 at 8:59 PM Paul B Mahol  > wrote:
> [...]
>
> And using avcodec* stuff is in lavfi is not needed.
>
> uses AVPixFmtDesc now. should I also not use libavcodec/mathops.h? median
> of 3 function is shared. can it be moved?


They appear to be inlined, so not needed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avfilter: vf_minterpolate: rename chroma log vars

2016-08-29 Thread Davinder Singh
On Mon, Aug 29, 2016 at 8:59 PM Paul B Mahol  wrote:
[...]

And using avcodec* stuff is in lavfi is not needed.

uses AVPixFmtDesc now. should I also not use libavcodec/mathops.h? median
of 3 function is shared. can it be moved?

updated patch attached.


0001-avfilter-vf_minterpolate-rename-chroma-log-vars.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avfilter: vf_minterpolate: rename chroma log vars

2016-08-28 Thread Paul B Mahol
On Sun, Aug 28, 2016 at 10:47 PM, Michael Niedermayer <
mich...@niedermayer.cc> wrote:

> On Sun, Aug 28, 2016 at 06:24:14PM +, Davinder Singh wrote:
> > hi,
> >
> > this rename confusing chroma variables to one used in AVPixFmtDescriptor.
> > more consistent.
> > also removed some useless vars from context.
> >
> > thanks
> > DSM_
>
> [...]
>
> > @@ -900,6 +894,8 @@ static void bidirectional_obmc(MIContext *mi_ctx,
> int alpha)
> >  }
> >  }
> >
> > +
> > +
> >  static void set_frame_data(MIContext *mi_ctx, int alpha, AVFrame
> *avf_out)
> >  {
> >  int x, y, plane;
>
> stray change
>
>
> > @@ -936,8 +932,8 @@ static void set_frame_data(MIContext *mi_ctx, int
> alpha, AVFrame *avf_out)
> >  for (i = 0; i < pixel->nb; i++) {
> >  Frame *frame = _ctx->frames[pixel->refs[i]];
> >  if (chroma) {
> > -x_mv = (x >> mi_ctx->chroma_h_shift) +
> (pixel->mvs[i][0] >> mi_ctx->chroma_h_shift);
> > -y_mv = (y >> mi_ctx->chroma_v_shift) +
> (pixel->mvs[i][1] >> mi_ctx->chroma_v_shift);
> > +x_mv = (x >> mi_ctx->log2_chroma_w) +
> (pixel->mvs[i][0] >> mi_ctx->log2_chroma_w);
> > +y_mv = (y >> mi_ctx->log2_chroma_h) +
> (pixel->mvs[i][1] >> mi_ctx->log2_chroma_h);
> >  } else {
> >  x_mv = x + pixel->mvs[i][0];
> >  y_mv = y + pixel->mvs[i][1];
> > @@ -949,7 +945,7 @@ static void set_frame_data(MIContext *mi_ctx, int
> alpha, AVFrame *avf_out)
> >  val = ROUNDED_DIV(val, weight_sum);
> >
> >  if (chroma)
> > -avf_out->data[plane][(x >> mi_ctx->chroma_h_shift)
> + (y >> mi_ctx->chroma_v_shift) * avf_out->linesize[plane]] = val;
> > +avf_out->data[plane][(x >> mi_ctx->log2_chroma_w) +
> (y >> mi_ctx->log2_chroma_h) * avf_out->linesize[plane]] = val;
> >  else
> >  avf_out->data[plane][x + y *
> avf_out->linesize[plane]] = val;
> >  }
> > @@ -1092,8 +1088,8 @@ static void interpolate(AVFilterLink *inlink,
> AVFrame *avf_out)
> >  int height = avf_out->height;
> >
> >  if (plane == 1 || plane == 2) {
> > -width = mi_ctx->chroma_width;
> > -height = mi_ctx->chroma_height;
> > +width = width >> mi_ctx->log2_chroma_w;
> > +height = height >> mi_ctx->log2_chroma_h;
>
> this is rounded differntly if wdith / height is odd,
> is that intended ?
>

It should use AV_CEIL_RSHIFT
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avfilter: vf_minterpolate: rename chroma log vars

2016-08-28 Thread Michael Niedermayer
On Sun, Aug 28, 2016 at 06:24:14PM +, Davinder Singh wrote:
> hi,
> 
> this rename confusing chroma variables to one used in AVPixFmtDescriptor.
> more consistent.
> also removed some useless vars from context.
> 
> thanks
> DSM_

[...]

> @@ -900,6 +894,8 @@ static void bidirectional_obmc(MIContext *mi_ctx, int 
> alpha)
>  }
>  }
>  
> +
> +
>  static void set_frame_data(MIContext *mi_ctx, int alpha, AVFrame *avf_out)
>  {
>  int x, y, plane;

stray change


> @@ -936,8 +932,8 @@ static void set_frame_data(MIContext *mi_ctx, int alpha, 
> AVFrame *avf_out)
>  for (i = 0; i < pixel->nb; i++) {
>  Frame *frame = _ctx->frames[pixel->refs[i]];
>  if (chroma) {
> -x_mv = (x >> mi_ctx->chroma_h_shift) + 
> (pixel->mvs[i][0] >> mi_ctx->chroma_h_shift);
> -y_mv = (y >> mi_ctx->chroma_v_shift) + 
> (pixel->mvs[i][1] >> mi_ctx->chroma_v_shift);
> +x_mv = (x >> mi_ctx->log2_chroma_w) + 
> (pixel->mvs[i][0] >> mi_ctx->log2_chroma_w);
> +y_mv = (y >> mi_ctx->log2_chroma_h) + 
> (pixel->mvs[i][1] >> mi_ctx->log2_chroma_h);
>  } else {
>  x_mv = x + pixel->mvs[i][0];
>  y_mv = y + pixel->mvs[i][1];
> @@ -949,7 +945,7 @@ static void set_frame_data(MIContext *mi_ctx, int alpha, 
> AVFrame *avf_out)
>  val = ROUNDED_DIV(val, weight_sum);
>  
>  if (chroma)
> -avf_out->data[plane][(x >> mi_ctx->chroma_h_shift) + (y 
> >> mi_ctx->chroma_v_shift) * avf_out->linesize[plane]] = val;
> +avf_out->data[plane][(x >> mi_ctx->log2_chroma_w) + (y 
> >> mi_ctx->log2_chroma_h) * avf_out->linesize[plane]] = val;
>  else
>  avf_out->data[plane][x + y * avf_out->linesize[plane]] = 
> val;
>  }
> @@ -1092,8 +1088,8 @@ static void interpolate(AVFilterLink *inlink, AVFrame 
> *avf_out)
>  int height = avf_out->height;
>  
>  if (plane == 1 || plane == 2) {
> -width = mi_ctx->chroma_width;
> -height = mi_ctx->chroma_height;
> +width = width >> mi_ctx->log2_chroma_w;
> +height = height >> mi_ctx->log2_chroma_h;

this is rounded differntly if wdith / height is odd,
is that intended ?

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] avfilter: vf_minterpolate: rename chroma log vars

2016-08-28 Thread Davinder Singh
hi,

this rename confusing chroma variables to one used in AVPixFmtDescriptor.
more consistent.
also removed some useless vars from context.

thanks
DSM_


0001-avfilter-vf_minterpolate-rename-chroma-log-vars.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel