On Fri, Mar 24, 2017 at 4:10 PM, Diego Biurrun <[email protected]> wrote:
> From: Paul B Mahol <[email protected]>
>
> Signed-off-by: Paul B Mahol <[email protected]>
> Signed-off-by: Diego Biurrun <[email protected]>
> ---
>
> decode_type2() is, ummm, interesting ..
>
>  Changelog               |   1 +
>  doc/general.texi        |   1 +
>  libavcodec/Makefile     |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/avcodec.h    |   1 +
>  libavcodec/codec_desc.c |   7 +
>  libavcodec/fmvc.c       | 634 
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  libavcodec/version.h    |   2 +-
>  libavformat/riff.c      |   1 +
>  9 files changed, 648 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/fmvc.c
>
> diff --git a/Changelog b/Changelog
> index 0497239..ed507f8 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -12,6 +12,7 @@ version <next>:
>  - The x86 assembler default switched from yasm to nasm, pass
>    --x86asmexe=yasm to configure to restore the old behavior.
>  - Cineform HD decoder
> +- FM Screen Capture Codec decoder

FM is a tad short, would you mind using the full name Fox Magic in the
commit too?

>
>  version 12:
> diff --git a/doc/general.texi b/doc/general.texi
> index b21195b..b1a42c5 100644
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -667,6 +667,7 @@ following image formats are supported:
>  @item Flash Screen Video v2  @tab     @tab  X
>  @item Flash Video (FLV)      @tab  X  @tab  X
>      @tab Sorenson H.263 used in Flash
> +@item FM Screen Capture Codec  @tab     @tab  X

ditto

>  @item Forward Uncompressed   @tab     @tab  X
>  @item Fraps                  @tab     @tab  X
>  @item Go2Meeting             @tab     @tab  X

> +static int decode_frame(AVCodecContext *avctx, void *data,
> +                        int *got_frame, AVPacket *avpkt)
> +{
> +    FMVCContext *s = avctx->priv_data;
> +    GetByteContext *gb = &s->gb;
> +    PutByteContext *pb = &s->pb;
> +    AVFrame *frame = data;
> +    int ret, y, x;
> +
> +    if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)

nit: maybe coalesce ret declaration and initialization?
also maybe this could use an error message

> +        return ret;
> +
> +    bytestream2_init(gb, avpkt->data, avpkt->size);
> +    bytestream2_skip(gb, 2);
> +
> +    frame->key_frame = !!bytestream2_get_le16(gb);
> +    frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : 
> AV_PICTURE_TYPE_P;

these are usually initialized only if got_frame = 1

> +    if (frame->key_frame) {
> +        const uint8_t *src;
> +        unsigned type, size;
> +        uint8_t *dst;
> +

seems fine for the rest
-- 
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to