[FFmpeg-devel] [PATCH 1/3] avfilter/vf_framerate: highbit depth support

James Almer jamrial at gmail.com
Fri Sep 11 17:51:14 CEST 2015


On 9/11/2015 12:24 PM, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavfilter/vf_framerate.c | 281 ++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 212 insertions(+), 69 deletions(-)
> 
> diff --git a/libavfilter/vf_framerate.c b/libavfilter/vf_framerate.c
> index 5c9da19..4d8ee16 100644
> --- a/libavfilter/vf_framerate.c
> +++ b/libavfilter/vf_framerate.c
> @@ -72,6 +72,12 @@ typedef struct FrameRateContext {
>      AVFrame *srce[N_SRCE];              ///< buffered source frames
>      int64_t srce_pts_dest[N_SRCE];      ///< pts for source frames scaled to output timebase
>      int64_t pts;                        ///< pts of frame we are working on
> +
> +    int (*blend_frames)(AVFilterContext *ctx, float interpolate,
> +                        AVFrame *copy_src1, AVFrame *copy_src2);
> +    int max;
> +    int bitdepth;
> +    AVFrame *work;
>  } FrameRateContext;
>  
>  #define OFFSET(x) offsetof(FrameRateContext, x)
> @@ -114,6 +120,59 @@ static void next_source(AVFilterContext *ctx)
>      s->srce[s->frst] = NULL;
>  }
>  
> +static av_always_inline int64_t sad_8x8_16(const uint16_t *src1, ptrdiff_t stride1,
> +                                           const uint16_t *src2, ptrdiff_t stride2)
> +{
> +    int sum = 0;
> +    int x, y;
> +
> +    for (y = 0; y < 8; y++) {
> +        for (x = 0; x < 8; x++)
> +            sum += FFABS(src1[x] - src2[x]);
> +        src1 += stride1;
> +        src2 += stride2;
> +    }
> +    return sum;
> +}

Use libavutil/pixelutils instead. It was made specifically for cases like this.


More information about the ffmpeg-devel mailing list