[FFmpeg-devel] [PATCH] lavc/cfhd: added interlaced frame decoding

Carl Eugen Hoyos ceffmpeg at gmail.com
Sat Mar 17 13:30:18 EET 2018


2018-03-17 10:42 GMT+01:00, Gagandeep Singh <deepgagan231197 at gmail.com>:
> ticket #5522: interlaced frame required horizontal-temporal inverse
> transform. though the output is not satisfactory yet.

> diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
> index a064cd1599..b17c7c1dc5 100644
> --- a/libavcodec/cfhd.c
> +++ b/libavcodec/cfhd.c
> @@ -50,8 +50,11 @@ enum CFHDParam {
>      ChannelWidth     = 104,
>      ChannelHeight    = 105,
>      PrescaleShift    = 109,
> +    Progressive      =  68,

I suspect this can be ordered better.

>  };
>
> +
> +

Please do not add random cosmetic changes to your patch.

[...]

> +static inline void interlaced_vertical_filter(int16_t *output, int16_t
> *low, int16_t *high,
> +                         int width, int linesize, int plane)
> +{
> +    int i;

> +    int16_t even, odd;

Could the code be simplified by using an unsigned type?
Why not a standard type?

> +    for (i = 0; i < width; i++) {

> +
> +

Maybe you disagree, but these empty lines make
reading the code more difficult imo.

> +      even = (*low - *high)/2;
> +      odd  = (*low + *high)/2;
> +
> +      if (even > 1023) even = 1023;
> +      if (even < 0) even = 0;
> +      if (odd > 1023) odd = 1023;
> +      if (odd < 0) odd = 0;

FFMIN / FFMAX

[...]

> +      }
> +      else {

Please merge these lines.

Thank you, Carl Eugen


More information about the ffmpeg-devel mailing list