Merge commit 'd509ae5be0a9bac35a4cedbe68b774a74446bb27'

* commit 'd509ae5be0a9bac35a4cedbe68b774a74446bb27':
  jvdec: K&R formatting cosmetics

Conflicts:
	libavcodec/jvdec.c
	libavformat/jvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-02-05 01:18:48 +01:00
commit dcbc748ad1
2 changed files with 48 additions and 42 deletions

View File

@ -25,11 +25,12 @@
* @author Peter Ross <pross@xvid.org>
*/
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "dsputil.h"
#include "get_bits.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
typedef struct JvContext {
DSPContext dsp;
@ -111,7 +112,8 @@ static inline void decode4x4(GetBitContext *gb, uint8_t *dst, int linesize)
/**
* Decode 8x8 block
*/
static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize, DSPContext *dsp)
static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize,
DSPContext *dsp)
{
int i, j, v[2];
@ -134,8 +136,7 @@ static inline void decode8x8(GetBitContext *gb, uint8_t *dst, int linesize, DSPC
}
}
static int decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
JvContext *s = avctx->priv_data;
@ -164,16 +165,19 @@ static int decode_frame(AVCodecContext *avctx,
for (j = 0; j < avctx->height; j += 8)
for (i = 0; i < avctx->width; i += 8)
decode8x8(&gb, s->frame->data[0] + j * s->frame->linesize[0] + i,
decode8x8(&gb,
s->frame->data[0] + j * s->frame->linesize[0] + i,
s->frame->linesize[0], &s->dsp);
buf += video_size;
} else if (video_type == 2) {
int v = *buf++;
for (j = 0; j < avctx->height; j++)
memset(s->frame->data[0] + j * s->frame->linesize[0], v, avctx->width);
memset(s->frame->data[0] + j * s->frame->linesize[0],
v, avctx->width);
} else {
av_log(avctx, AV_LOG_WARNING, "unsupported frame type %i\n", video_type);
av_log(avctx, AV_LOG_WARNING,
"unsupported frame type %i\n", video_type);
return AVERROR_INVALIDDATA;
}
}

View File

@ -27,6 +27,7 @@
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
@ -106,7 +107,8 @@ static int read_header(AVFormatContext *s)
avio_skip(pb, 10);
ast->index_entries = av_malloc(ast->nb_index_entries * sizeof(*ast->index_entries));
ast->index_entries = av_malloc(ast->nb_index_entries *
sizeof(*ast->index_entries));
if (!ast->index_entries)
return AVERROR(ENOMEM);