On Fri, Jul 13, 2012 at 05:10:32AM +0200, Luca Barbato wrote:
>
> --- a/configure
> +++ b/configure
> @@ -179,6 +179,7 @@ External library support:
> --enable-libopencv enable video filtering via libopencv [no]
> --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]
> --enable-libpulse enable Pulseaudio input via libpulse [no]
> + --enable-libopenjpeg enable JPEG 2000 encoding/decoding via OpenJPEG
> [no]
> --enable-librtmp enable RTMP[E] support via librtmp [no]
> --enable-libschroedinger enable Dirac support via libschroedinger [no]
> --enable-libspeex enable Speex support via libspeex [no]
Umm, look two lines above..
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -18,6 +18,7 @@ explicitly requested by passing the appropriate flags to
>
> @section OpenCORE and VisualOn libraries
>
> +
> Spun off Google Android sources, OpenCore and VisualOn libraries provide
> encoders for a number of audio codecs.
stray change
> @@ -522,6 +523,7 @@ following image formats are supported:
> @tab Used in the game Cyberia from Interplay.
> @item Interplay MVE video @tab @tab X
> @tab Used in Interplay .MVE files.
> +@item J2K @tab X @tab X
That's not a suitable name to use in the documentation, go for "JPEG 2000".
Also, it should be in the image codecs section, not video codecs.
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -385,7 +385,7 @@ void avcodec_register_all(void)
> REGISTER_DECODER (LIBOPENCORE_AMRWB, libopencore_amrwb);
> - REGISTER_DECODER (LIBOPENJPEG, libopenjpeg);
> + REGISTER_ENCDEC (LIBOPENJPEG, libopenjpeg);
align
> --- /dev/null
> +++ b/libavcodec/libopenjpegenc.c
> @@ -0,0 +1,490 @@
> +
> +#include "libavutil/opt.h"
> +#include "libavutil/imgutils.h"
> +#include "libavutil/intreadwrite.h"
> +#include "avcodec.h"
> +#include "internal.h"
> +#define OPJ_STATIC
> +#include <openjpeg.h>
system headers before local headers
> + default:
> + av_log(avctx, AV_LOG_ERROR,
> + "The requested pixel format '%s' is not supported\n",
> + av_get_pix_fmt_name(avctx->pix_fmt));
Indentation is off.
> + cmptparm[i].bpp =
> + av_pix_fmt_descriptors[avctx->pix_fmt].comp[i].depth_minus1 + 1;
> + cmptparm[i].sgnd = 0;
> + cmptparm[i].dx = sub_dx[i];
> + cmptparm[i].dy = sub_dy[i];
> + cmptparm[i].w = avctx->width / sub_dx[i];
> + cmptparm[i].h = avctx->height / sub_dy[i];
vertical align
> +static int libopenjpeg_copy_packed8(AVCodecContext *avctx,
> + const AVFrame *frame, opj_image_t *image)
> +{
> + int compno;
> + int x;
> + int y;
> + int image_index;
> + int frame_index;
Maybe merge these.
> +static int libopenjpeg_copy_packed16(AVCodecContext *avctx,
> + const AVFrame *frame, opj_image_t
> *image)
> +{
> + int compno;
> + int x;
> + int y;
> + int image_index;
> + int frame_index;
same
> +static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx,
> + const AVFrame *frame, opj_image_t
> *image)
> +{
> + int compno;
> + int x;
> + int y;
> + int width;
> + int height;
> + int image_index;
> + int frame_index;
ditto
> +static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx,
> + const AVFrame *frame, opj_image_t
> *image)
> +{
> + int compno;
> + int x;
> + int y;
> + int width;
> + int height;
> + int image_index;
> + int frame_index;
same
> + image->x1 = (avctx->width - 1) * ctx->enc_params.subsampling_dx + 1;
> + image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1;
nit: align
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel