Commit 543a46e0 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '1ea9fa15'

* commit '1ea9fa15':
  libopenjpeg: K&R formatting cosmetics

Conflicts:
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 82367475 1ea9fa15
This diff is collapsed.
...@@ -235,7 +235,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx) ...@@ -235,7 +235,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
} }
opj_setup_encoder(ctx->compress, &ctx->enc_params, ctx->image); opj_setup_encoder(ctx->compress, &ctx->enc_params, ctx->image);
ctx->stream = opj_cio_open((opj_common_ptr)ctx->compress, NULL, 0); ctx->stream = opj_cio_open((opj_common_ptr) ctx->compress, NULL, 0);
if (!ctx->stream) { if (!ctx->stream) {
av_log(avctx, AV_LOG_ERROR, "Error creating the cio stream\n"); av_log(avctx, AV_LOG_ERROR, "Error creating the cio stream\n");
err = AVERROR(ENOMEM); err = AVERROR(ENOMEM);
...@@ -252,7 +252,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx) ...@@ -252,7 +252,7 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
ctx->event_mgr.info_handler = info_callback; ctx->event_mgr.info_handler = info_callback;
ctx->event_mgr.error_handler = error_callback; ctx->event_mgr.error_handler = error_callback;
ctx->event_mgr.warning_handler = warning_callback; ctx->event_mgr.warning_handler = warning_callback;
opj_set_event_mgr((opj_common_ptr)ctx->compress, &ctx->event_mgr, avctx); opj_set_event_mgr((opj_common_ptr) ctx->compress, &ctx->event_mgr, avctx);
return 0; return 0;
...@@ -310,12 +310,11 @@ static int libopenjpeg_copy_packed8(AVCodecContext *avctx, const AVFrame *frame, ...@@ -310,12 +310,11 @@ static int libopenjpeg_copy_packed8(AVCodecContext *avctx, const AVFrame *frame,
static int libopenjpeg_copy_packed12(AVCodecContext *avctx, const AVFrame *frame, opj_image_t *image) static int libopenjpeg_copy_packed12(AVCodecContext *avctx, const AVFrame *frame, opj_image_t *image)
{ {
int compno; int compno;
int x; int x, y;
int y;
int *image_line; int *image_line;
int frame_index; int frame_index;
const int numcomps = image->numcomps; const int numcomps = image->numcomps;
uint16_t *frame_ptr = (uint16_t*)frame->data[0]; uint16_t *frame_ptr = (uint16_t *)frame->data[0];
for (compno = 0; compno < numcomps; ++compno) { for (compno = 0; compno < numcomps; ++compno) {
if (image->comps[compno].w > frame->linesize[0] / numcomps) { if (image->comps[compno].w > frame->linesize[0] / numcomps) {
...@@ -406,7 +405,7 @@ static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *fram ...@@ -406,7 +405,7 @@ static int libopenjpeg_copy_unpacked8(AVCodecContext *avctx, const AVFrame *fram
} }
for (compno = 0; compno < numcomps; ++compno) { for (compno = 0; compno < numcomps; ++compno) {
width = avctx->width / image->comps[compno].dx; width = avctx->width / image->comps[compno].dx;
height = avctx->height / image->comps[compno].dy; height = avctx->height / image->comps[compno].dy;
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
image_line = image->comps[compno].data + y * image->comps[compno].w; image_line = image->comps[compno].data + y * image->comps[compno].w;
...@@ -448,9 +447,9 @@ static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *fra ...@@ -448,9 +447,9 @@ static int libopenjpeg_copy_unpacked16(AVCodecContext *avctx, const AVFrame *fra
} }
for (compno = 0; compno < numcomps; ++compno) { for (compno = 0; compno < numcomps; ++compno) {
width = avctx->width / image->comps[compno].dx; width = avctx->width / image->comps[compno].dx;
height = avctx->height / image->comps[compno].dy; height = avctx->height / image->comps[compno].dy;
frame_ptr = (uint16_t*)frame->data[compno]; frame_ptr = (uint16_t *)frame->data[compno];
for (y = 0; y < height; ++y) { for (y = 0; y < height; ++y) {
image_line = image->comps[compno].data + y * image->comps[compno].w; image_line = image->comps[compno].data + y * image->comps[compno].w;
frame_index = y * (frame->linesize[compno] / 2); frame_index = y * (frame->linesize[compno] / 2);
...@@ -475,9 +474,9 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, ...@@ -475,9 +474,9 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet) const AVFrame *frame, int *got_packet)
{ {
LibOpenJPEGContext *ctx = avctx->priv_data; LibOpenJPEGContext *ctx = avctx->priv_data;
opj_cinfo_t *compress = ctx->compress; opj_cinfo_t *compress = ctx->compress;
opj_image_t *image = ctx->image; opj_image_t *image = ctx->image;
opj_cio_t *stream = ctx->stream; opj_cio_t *stream = ctx->stream;
int cpyresult = 0; int cpyresult = 0;
int ret, len; int ret, len;
AVFrame *gbrframe; AVFrame *gbrframe;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment