[FFmpeg-devel] [GSOC][PATCH 1/3] lavc/cfhd:3d transform decoding for both progressive and interlaced

Michael Niedermayer michael at niedermayer.cc
Wed Aug 15 00:42:42 EEST 2018


On Tue, Aug 14, 2018 at 01:12:37PM +0530, Gagandeep Singh wrote:
> IP sample decoding patch attached herein.
> 
> Gagandeep Singh

>  cfhd.c |  511 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------
>  cfhd.h |   13 +
>  2 files changed, 454 insertions(+), 70 deletions(-)
> a155a004ae249d84063d9c49effb87a8f98b0fe7  patchip.patch
> From 6cc5636c48bca4e802ccca5f53560e31360760cb Mon Sep 17 00:00:00 2001
> From: Gagandeep Singh <deepgagan231197 at gmail.com>
> Date: Tue, 14 Aug 2018 00:07:45 +0530
> Subject: [GSOC][FFmpeg-devel][PATCH 1/3] lavc/cfhd:3d transform decoding for both progressive and
>  interlaced
> 
[...]
> @@ -420,9 +486,15 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
>              s->prescale_shift[1] = (data >> 3) & 0x7;
>              s->prescale_shift[2] = (data >> 6) & 0x7;
>              av_log(avctx, AV_LOG_DEBUG, "Prescale shift (VC-5): %x\n", data);
> +        } else if (tag == EncodingMethod) {
> +            s->encode_method = data;
> +            av_log(avctx, AV_LOG_DEBUG, "Encode Method for Subband %d : %x\n",s->subband_num_actual, data);

>          } else if (tag == 27) {
>              av_log(avctx, AV_LOG_DEBUG, "Lowpass width %"PRIu16"\n", data);
> -            if (data < 3 || data > s->plane[s->channel_num].band[0][0].a_width) {
> +            if (s->coded_width == 0){
> +                s->coded_width = data << 3;
> +              }
> +                if (data < 3) {
>                  av_log(avctx, AV_LOG_ERROR, "Invalid lowpass width\n");
>                  ret = AVERROR(EINVAL);

any checks should be done before the variable is used.
also teh indention looks rather odd here


[...]
> @@ -664,9 +742,14 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
>                          if (count > expected)
>                              break;
>  
> -                        coeff = dequant_and_decompand(level, s->quantisation, 0);
> +                        coeff = dequant_and_decompand(level, s->quantisation, 0, (s->sample_type == 2 || s->sample_type == 3) && s->pframe && s->subband_num_actual == 7 && s->encode_method == 5);
>                          for (i = 0; i < run; i++)
> -                            *coeff_data++ = coeff;
> +                            if (tag != 82)

what is tag 82 ?
i think instead of litteral numbers named identifers should be used



[...]
> @@ -726,14 +814,15 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
>              }
>          }
>      }
> -
> -    if (!s->a_width || !s->a_height || s->a_format == AV_PIX_FMT_NONE ||
> -        s->coded_width || s->coded_height || s->coded_format != AV_PIX_FMT_NONE) {

> +    //disabled to run mountain sample file
> +#if 0
> +    if ((!s->a_width || !s->a_height || s->a_format == AV_PIX_FMT_NONE ||
> +        s->coded_width || s->coded_height || s->coded_format != AV_PIX_FMT_NONE) && s->sample_type != 1) {
>          av_log(avctx, AV_LOG_ERROR, "Invalid dimensions\n");
>          ret = AVERROR(EINVAL);
>          goto end;
>      }
> -
> +#endif

please elaborate why this needs to be disabled
i presume this code was needed for something

also this decoder with the patches should be tested with a fuzzer to reduce 
the chance of bugs

also i saw on the IRC log after you logged off
<gagandeepsingh> also how do i send the 3 samples i have
<kierank> ask michaelni 
<kierank> michaelni: can you help gagandeepsingh 

i didnt follow the whole discussion but to submit samples, you can upload them
somewhere and post a link. Someone developer will upload them.
Note, please clearly specify what any samples are for (fatesamples / bug reports / other /...)

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180814/418f4154/attachment.sig>


More information about the ffmpeg-devel mailing list