On 03/08/2012 11:08 AM, Paul B Mahol wrote:

> 
> Signed-off-by: Paul B Mahol <[email protected]>
> ---
>  Changelog              |    1 +
>  doc/general.texi       |    4 ++-
>  libavcodec/Makefile    |    1 +
>  libavcodec/allcodecs.c |    1 +
>  libavcodec/avcodec.h   |    1 +
>  libavcodec/version.h   |    2 +-
>  libavcodec/xbmenc.c    |   93 
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  libavformat/img2.c     |    1 +
>  libavformat/img2enc.c  |    2 +-
>  9 files changed, 103 insertions(+), 3 deletions(-)
>  create mode 100644 libavcodec/xbmenc.c

[...]

> +static av_cold int xbm_encode_init(AVCodecContext *avctx)
> +{
> +    if (avctx->width & 7) {
> +        av_log(avctx, AV_LOG_ERROR, "width is not divisible by eight.\n");
> +        return AVERROR(EINVAL);
> +    }


Wikipedia says this is allowed:
"If the image width does not match a multiple of 8, the display
mechanism ignores and discards the extra bits in the last byte of each row."

The input frame should also be padded in such cases, so it should be
trivial to support.

[...]
> +
> +    avctx->coded_frame->key_frame = 1;
> +    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;


Those could be set after allocating coded_frame since they do not change
from frame to frame. (also key_frame is already 1 by default)

The rest LGTM.

Thanks,
Justin

P.S. new fate test please :)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to