On Sun, Mar 27, 2011 at 10:16:26PM +0200, Anton Khirnov wrote:
> From: anatoly <[email protected]>
>
> ---
> libavcodec/Makefile | 1 +
> libavcodec/allcodecs.c | 1 +
> libavcodec/mxpegdec.c | 331
> ++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 333 insertions(+), 0 deletions(-)
> create mode 100644 libavcodec/mxpegdec.c
This is missing changelog and docs update, as well as a minor version
bump. Which confuses me, since the first patch in the thread has
those changes...
> --- /dev/null
> +++ b/libavcodec/mxpegdec.c
> @@ -0,0 +1,331 @@
> +
> +/**
> + * @file
> + * MxPEG decoder.
s/.//
> +#include "mjpeg.h"
> +#include "mjpegdec.h"
> +
> +int ff_mxpeg_decode_init(AVCodecContext *avctx);
> +int ff_mxpeg_decode_end(AVCodecContext *avctx);
> +int ff_mxpeg_decode_frame(AVCodecContext *avctx,
> + void *data, int *data_size,
> + AVPacket *avpkt);
These forward declarations must be replaced by the appropriate #include.
> +av_cold int ff_mxpeg_decode_init(AVCodecContext *avctx)
> +{
> + MXpegDecodeContext *s = avctx->priv_data;
> +
> + s->picture[0].reference = s->picture[1].reference = 3;
> + s->jpg.picture_ptr = &s->picture[0];
nit: Align the '='.
> +static int mxpeg_decode_app(MXpegDecodeContext *s, const uint8_t *buf_ptr,
> int buf_size)
nit: Break such long lines, more below...
> + if (start_code >= APP0 && start_code <= APP15) {
> + mxpeg_decode_app(s, unescaped_buf_ptr, unescaped_buf_size);
> + }
> +
> + switch(start_code) {
switch (start_code) {
> + if (!reference_ptr->data[0]) {
> + /* allocate dummy reference picture */
> + if (avctx->get_buffer(avctx, reference_ptr) < 0) {
> + av_log(avctx, AV_LOG_ERROR, "get_buffer()
> failed\n");
> + return AVERROR(ENOMEM);
These two ifs could be merged, matter of taste I guess...
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel