[FFmpeg-devel] [FFmpeg][PATCH] lavc/cfhd: introduced interlaced using temporal horizontal transform

James Almer jamrial at gmail.com
Mon Mar 19 16:42:11 EET 2018


On 3/19/2018 6:47 AM, Gagandeep Singh wrote:
> interlaced files require horizontal-temporal transform that has been added.
> Output is not satisfactory yet!
> ---
>  libavcodec/cfhd.c | 137 +++++++++++++++++++++++++++++++++++++++++-------------
>  libavcodec/cfhd.h |   3 +-
>  2 files changed, 107 insertions(+), 33 deletions(-)
> 
> diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
> index a064cd1599..da0f0fadf6 100644
> --- a/libavcodec/cfhd.c
> +++ b/libavcodec/cfhd.c
> @@ -46,6 +46,7 @@ enum CFHDParam {
>      SubbandNumber    =  48,
>      Quantization     =  53,
>      ChannelNumber    =  62,
> +    Progressive      =  68,
>      BitsPerComponent = 101,
>      ChannelWidth     = 104,
>      ChannelHeight    = 105,
> @@ -83,6 +84,7 @@ static void init_frame_defaults(CFHDContext *s)
>      s->wavelet_depth     = 3;
>      s->pshift            = 1;
>      s->codebook          = 0;
> +    s->progressive       = 0;
>      init_plane_defaults(s);
>  }
>  
> @@ -137,6 +139,43 @@ static inline void filter(int16_t *output, ptrdiff_t out_stride,
>      }
>  }
>  
> +static inline void interlaced_vertical_filter(int16_t *output, int16_t *low, int16_t *high,
> +                         int width, int linesize, int plane)
> +{
> +    int i;
> +    int even, odd;
> +    for (i = 0; i < width; i++) {
> +      even = (*low - *high)/2;
> +      odd  = (*low + *high)/2;
> +
> +      even = FFMIN(even, 1023);
> +      even = FFMAX(even, 0);
> +      odd  = FFMIN(odd, 1023);
> +      odd  = FFMAX(odd, 0);

Use av_clip_uintp2() for both even and odd instead.


More information about the ffmpeg-devel mailing list