|
|
|
@ -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; |
|
|
|
@ -160,7 +161,8 @@ 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; |
|
|
|
@ -168,10 +170,12 @@ static int decode_frame(AVCodecContext *avctx, |
|
|
|
|
if (buf + 1 <= buf_end) { |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|