[FFmpeg-devel] [PATCH v5 1/3] [RFC] lavc: add FLIF decoding support

Anamitra Ghorui aghorui at teknik.io
Mon Aug 17 13:21:31 EEST 2020


On Sat, 15 Aug 2020 00:29:10 +0530
Anamitra Ghorui <aghorui at teknik.io> wrote:

> This patch fixes a few cosmetic errors mentioned in v3, an error in the
> ColorBuckets reading function and removes a few redundancies in the
> rangecoder initialisation.
> 
> Co-authored-by: Anamitra Ghorui <aghorui at teknik.io>
> Co-authored-by: Kartik K Khullar <kartikkhullar840 at gmail.com>
> 
> Signed-off-by: Anamitra Ghorui <aghorui at teknik.io>
> ---
>  libavcodec/Makefile            |    2 +
>  libavcodec/allcodecs.c         |    1 +
>  libavcodec/codec_desc.c        |    7 +
>  libavcodec/codec_id.h          |    1 +
>  libavcodec/flif16.c            |  191 ++
>  libavcodec/flif16.h            |  282 +++
>  libavcodec/flif16_parser.c     |  193 ++
>  libavcodec/flif16_rangecoder.c |  804 +++++++++
>  libavcodec/flif16_rangecoder.h |  397 +++++
>  libavcodec/flif16_transform.c  | 3009 ++++++++++++++++++++++++++++++++
>  libavcodec/flif16_transform.h  |  124 ++
>  libavcodec/flif16dec.c         | 1779 +++++++++++++++++++
>  libavcodec/parsers.c           |    1 +
>  libavcodec/version.h           |    2 +-
>  14 files changed, 6792 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/flif16.c
>  create mode 100644 libavcodec/flif16.h
>  create mode 100644 libavcodec/flif16_parser.c
>  create mode 100644 libavcodec/flif16_rangecoder.c
>  create mode 100644 libavcodec/flif16_rangecoder.h
>  create mode 100644 libavcodec/flif16_transform.c
>  create mode 100644 libavcodec/flif16_transform.h
>  create mode 100644 libavcodec/flif16dec.c

A few more things I have noticed since uploading this patch:

* In flif16_rangecoder.h, the variable left and the if statement at the
  end of the while loop of ff_flif16_rac_renorm is entirely redundant.

* The reverse transform loop has been written once in the main state
  loop of flif16_decode_frame, and once again in flif16_read_ni_image.
  This is entirely redundant.

* There is a case of strange spacing in ff_flif16_rac_init(), in
  flif16_rangecoder.h.

* GetByteContext is useless in FLIF16Context, and should be shifted to
  FLIF16DecoderContext instead.


All these corrections have been made by me locally, but I would like to
wait for some further review (self and otherwise) before posting again.

Regards,
Anamitra



More information about the ffmpeg-devel mailing list