Commit 8e09e183 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  8bps: cosmetics
  aasc: cosmetics, reformat
  ansi: remove an extra return
  asvdec: cosmetics, reformat
  aura: cosmetics, reformat

Conflicts:
	libavcodec/aasc.c
	libavcodec/asvdec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents def18e54 b6d7d4ef
......@@ -44,9 +44,6 @@
static const enum AVPixelFormat pixfmt_rgb24[] = {
AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE };
/*
* Decoder context
*/
typedef struct EightBpsContext {
AVCodecContext *avctx;
AVFrame pic;
......@@ -57,12 +54,6 @@ typedef struct EightBpsContext {
uint32_t pal[256];
} EightBpsContext;
/*
*
* Decode a frame
*
*/
static int decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
......@@ -151,12 +142,6 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return buf_size;
}
/*
*
* Init 8BPS decoder
*
*/
static av_cold int decode_init(AVCodecContext *avctx)
{
EightBpsContext * const c = avctx->priv_data;
......@@ -202,14 +187,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
/*
*
* Uninit 8BPS decoder
*
*/
static av_cold int decode_end(AVCodecContext *avctx)
{
EightBpsContext * const c = avctx->priv_data;
......@@ -220,8 +197,6 @@ static av_cold int decode_end(AVCodecContext *avctx)
return 0;
}
AVCodec ff_eightbps_decoder = {
.name = "8bps",
.type = AVMEDIA_TYPE_VIDEO,
......
......@@ -79,8 +79,8 @@ static int aasc_decode_frame(AVCodecContext *avctx,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AascContext *s = avctx->priv_data;
int buf_size = avpkt->size;
AascContext *s = avctx->priv_data;
int compr, i, stride, psize;
if (buf_size < 4) {
......@@ -95,8 +95,8 @@ static int aasc_decode_frame(AVCodecContext *avctx,
return -1;
}
compr = AV_RL32(buf);
buf += 4;
compr = AV_RL32(buf);
buf += 4;
buf_size -= 4;
psize = avctx->bits_per_coded_sample / 8;
switch (avctx->codec_tag) {
......@@ -105,11 +105,11 @@ static int aasc_decode_frame(AVCodecContext *avctx,
ff_msrle_decode(avctx, (AVPicture*)&s->frame, 8, &s->gb);
break;
case MKTAG('A', 'A', 'S', 'C'):
switch(compr){
switch (compr) {
case 0:
stride = (avctx->width * psize + psize) & ~psize;
for(i = avctx->height - 1; i >= 0; i--){
if(avctx->width * psize > buf_size){
for (i = avctx->height - 1; i >= 0; i--) {
if (avctx->width * psize > buf_size) {
av_log(avctx, AV_LOG_ERROR, "Next line is beyond buffer bounds\n");
break;
}
......
This diff is collapsed.
......@@ -50,8 +50,7 @@ static int aura_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *pkt)
{
AuraDecodeContext *s=avctx->priv_data;
AuraDecodeContext *s = avctx->priv_data;
uint8_t *Y, *U, *V;
uint8_t val;
int x, y;
......@@ -69,12 +68,12 @@ static int aura_decode_frame(AVCodecContext *avctx,
/* pixel data starts 48 bytes in, after 3x16-byte tables */
buf += 48;
if(s->frame.data[0])
if (s->frame.data[0])
avctx->release_buffer(avctx, &s->frame);
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
s->frame.reference = 0;
if(ff_get_buffer(avctx, &s->frame) < 0) {
if (ff_get_buffer(avctx, &s->frame) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
......@@ -86,23 +85,23 @@ static int aura_decode_frame(AVCodecContext *avctx,
/* iterate through each line in the height */
for (y = 0; y < avctx->height; y++) {
/* reset predictors */
val = *buf++;
val = *buf++;
U[0] = val & 0xF0;
Y[0] = val << 4;
val = *buf++;
val = *buf++;
V[0] = val & 0xF0;
Y[1] = Y[0] + delta_table[val & 0xF];
Y += 2; U++; V++;
Y += 2; U++; V++;
/* iterate through the remaining pixel groups (4 pixels/group) */
for (x = 1; x < (avctx->width >> 1); x++) {
val = *buf++;
val = *buf++;
U[0] = U[-1] + delta_table[val >> 4];
Y[0] = Y[-1] + delta_table[val & 0xF];
val = *buf++;
val = *buf++;
V[0] = V[-1] + delta_table[val >> 4];
Y[1] = Y[ 0] + delta_table[val & 0xF];
Y += 2; U++; V++;
Y += 2; U++; V++;
}
Y += s->frame.linesize[0] - avctx->width;
U += s->frame.linesize[1] - (avctx->width >> 1);
......@@ -110,7 +109,7 @@ static int aura_decode_frame(AVCodecContext *avctx,
}
*got_frame = 1;
*(AVFrame*)data= s->frame;
*(AVFrame*)data = s->frame;
return pkt->size;
}
......
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