On Mon, Jul 16, 2012 at 03:25:38PM +0200, Luca Barbato wrote:
> From: Michael Bradshaw <[email protected]>
> 
> Signed-off-by: Luca Barbato <[email protected]>

s/added/add/

> --- a/configure
> +++ b/configure
> @@ -1462,6 +1462,7 @@ libopencore_amrnb_decoder_deps="libopencore_amrnb"
>  libopencore_amrwb_decoder_deps="libopencore_amrwb"
>  libopenjpeg_decoder_deps="libopenjpeg"
> +libopenjpeg_encoder_deps="libopenjpeg"
>  libschroedinger_decoder_deps="libschroedinger"

You missed updating the help output.

> --- /dev/null
> +++ b/libavcodec/libopenjpegenc.c
> @@ -0,0 +1,483 @@
> +static void error_callback(const char *msg, void *data)
> +{
> +    av_log((AVCodecContext*)data, AV_LOG_ERROR, "%s\n", msg);
> +}
> +
> +static void warning_callback(const char *msg, void *data)
> +{
> +    av_log((AVCodecContext*)data, AV_LOG_WARNING, "%s\n", msg);
> +}
> +
> +static void info_callback(const char *msg, void *data)
> +{
> +    av_log((AVCodecContext*)data, AV_LOG_DEBUG, "%s\n", msg);
> +}

unnecessary void* casts

> +
> +static opj_image_t *mj2_create_image(AVCodecContext *avctx,
> +                                     opj_cparameters_t *parameters)
> +{
> +    opj_image_cmptparm_t *cmptparm;
> +
> +    cmptparm = av_mallocz(numcomps * sizeof(opj_image_cmptparm_t));

sizeof(type) ---> sizeof(variable) or sizeof(*variable)

> +static int libopenjpeg_copy_packed16(AVCodecContext *avctx,
> +                                     const AVFrame *frame, opj_image_t 
> *image)
> +{
> +    int compno;
> +    int x, y;

What is compno?

> +    int image_index, frame_index;
> +    const int numcomps = image->numcomps;
> +    uint16_t *frame_ptr = (uint16_t*)frame->data[0];

You could drop the cast and multiply by 2 below, but that could just be me.

> +static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx,
> +                                      const AVFrame *frame, opj_image_t 
> *image)
> +{
> +    int compno;

ditto, more below

> +    for (compno = 0; compno < numcomps; ++compno) {
> +        width = avctx->width / image->comps[compno].dx;
> +        height = avctx->height / image->comps[compno].dy;

align

> +    for (compno = 0; compno < numcomps; ++compno) {
> +        width = avctx->width / image->comps[compno].dx;
> +        height = avctx->height / image->comps[compno].dy;

ditto

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to