On date Sunday 2011-04-24 15:05:09 +0200, Diego Biurrun wrote:
> ---
>  Changelog              |    1 +
>  configure              |    1 +
>  doc/general.texi       |    1 +
>  libavcodec/Makefile    |    1 +
>  libavcodec/allcodecs.c |    1 +
>  libavcodec/flashsv.c   |  225 ++++++++++++++++++++++++++++++++++++++++++++++-
>  libavcodec/version.h   |    2 +-
[...]
>  static int flashsv_decode_frame(AVCodecContext *avctx,
>                                      void *data, int *data_size,
>                                      AVPacket *avpkt)
> @@ -124,6 +238,18 @@ static int flashsv_decode_frame(AVCodecContext *avctx,
>      s->block_height= 16* (get_bits(&gb, 4)+1);
>      s->image_height=     get_bits(&gb,12);
>  

> +    if (s->ver == 2) {
> +        skip_bits(&gb, 6);
> +        if (get_bits1(&gb)) {
> +            av_log(avctx, AV_LOG_ERROR, "FIXME iframe not implemented 
> yet\n");
> +            return -1;
> +        }
> +        if (get_bits1(&gb)) {
> +            av_log(avctx, AV_LOG_ERROR, "FIXME custom palette not 
> implemented yet\n");
> +            return -1;
> +        }

Possibly return meaningful error codes, here and below.

[...]  
> +#if CONFIG_FLASHSV_DECODER
>  AVCodec ff_flashsv_decoder = {
>      "flashsv",
>      AVMEDIA_TYPE_VIDEO,
> @@ -261,3 +459,20 @@ AVCodec ff_flashsv_decoder = {
>      .pix_fmts = (const enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_NONE},
>      .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"),
>  };
> +#endif /* CONFIG_FLASHSV_DECODER */
> +
> +#if CONFIG_FLASHSV2_DECODER
> +AVCodec ff_flashsv2_decoder = {
> +    "flashsv2",
> +    AVMEDIA_TYPE_VIDEO,
> +    CODEC_ID_FLASHSV2,
> +    sizeof(FlashSVContext),
> +    flashsv2_decode_init,
> +    NULL,
> +    flashsv_decode_end,
> +    flashsv_decode_frame,
> +    CODEC_CAP_DR1,
> +    .pix_fmts = (const enum PixelFormat[]){PIX_FMT_BGR24, PIX_FMT_NONE},
> +    .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"),
> +};

Designated inits are preferred (more readable and more robust in case
of ABI changes).

Noob question: is this codec RE or is it documented somewhere?

In both cases an excellent way to start would be IMO to collect
information, samples and publish them somewhere (the MultiMediaWiki
may be an idea), this should also help reviews from other developers.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to