aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bfi.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-04-01 10:47:39 +0200
committerDiego Biurrun <diego@biurrun.de>2012-04-12 09:00:49 +0200
commit2ef15b46e42647f6688d05abe2400fe008de5e0a (patch)
tree770eed43ae7f18c70f9203120ee0f2a56cfd319c /libavcodec/bfi.c
parent992f71e95dcf57c917531f126ba7499ef9ed87d3 (diff)
downloadffmpeg-2ef15b46e42647f6688d05abe2400fe008de5e0a.tar.gz
avpacket, bfi, bgmc, rawenc: K&R prettyprinting cosmetics
Diffstat (limited to 'libavcodec/bfi.c')
-rw-r--r--libavcodec/bfi.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c
index bc680c0d39..e4be176f77 100644
--- a/libavcodec/bfi.c
+++ b/libavcodec/bfi.c
@@ -39,8 +39,8 @@ typedef struct BFIContext {
static av_cold int bfi_decode_init(AVCodecContext *avctx)
{
BFIContext *bfi = avctx->priv_data;
- avctx->pix_fmt = PIX_FMT_PAL8;
- bfi->dst = av_mallocz(avctx->width * avctx->height);
+ avctx->pix_fmt = PIX_FMT_PAL8;
+ bfi->dst = av_mallocz(avctx->width * avctx->height);
return 0;
}
@@ -48,9 +48,9 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *avpkt)
{
GetByteContext g;
- int buf_size = avpkt->size;
+ int buf_size = avpkt->size;
BFIContext *bfi = avctx->priv_data;
- uint8_t *dst = bfi->dst;
+ uint8_t *dst = bfi->dst;
uint8_t *src, *dst_offset, colour1, colour2;
uint8_t *frame_end = bfi->dst + avctx->width * avctx->height;
uint32_t *pal;
@@ -82,9 +82,8 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
int shift = 16;
*pal = 0;
for (j = 0; j < 3; j++, shift -= 8)
- *pal +=
- ((avctx->extradata[i * 3 + j] << 2) |
- (avctx->extradata[i * 3 + j] >> 4)) << shift;
+ *pal += ((avctx->extradata[i * 3 + j] << 2) |
+ (avctx->extradata[i * 3 + j] >> 4)) << shift;
pal++;
}
bfi->frame.palette_has_changed = 1;
@@ -107,7 +106,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
return -1;
}
- /* Get length and offset(if required) */
+ /* Get length and offset (if required) */
if (length == 0) {
if (code == 1) {
length = bytestream2_get_byte(&g);
@@ -127,8 +126,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
break;
switch (code) {
-
- case 0: //Normal Chain
+ case 0: // normal chain
if (length >= bytestream2_get_bytes_left(&g)) {
av_log(avctx, AV_LOG_ERROR, "Frame larger than buffer.\n");
return -1;
@@ -136,21 +134,18 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
bytestream2_get_buffer(&g, dst, length);
dst += length;
break;
-
- case 1: //Back Chain
+ case 1: // back chain
dst_offset = dst - offset;
- length *= 4; //Convert dwords to bytes.
+ length *= 4; // Convert dwords to bytes.
if (dst_offset < bfi->dst)
break;
while (length--)
*dst++ = *dst_offset++;
break;
-
- case 2: //Skip Chain
+ case 2: // skip chain
dst += length;
break;
-
- case 3: //Fill Chain
+ case 3: // fill chain
colour1 = bytestream2_get_byte(&g);
colour2 = bytestream2_get_byte(&g);
while (length--) {
@@ -158,7 +153,6 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
*dst++ = colour2;
}
break;
-
}
}
@@ -169,12 +163,12 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data,
src += avctx->width;
dst += bfi->frame.linesize[0];
}
- *data_size = sizeof(AVFrame);
+ *data_size = sizeof(AVFrame);
*(AVFrame *)data = bfi->frame;
return buf_size;
}
-static av_cold int bfi_decode_close(AVCodecContext * avctx)
+static av_cold int bfi_decode_close(AVCodecContext *avctx)
{
BFIContext *bfi = avctx->priv_data;
if (bfi->frame.data[0])