summaryrefslogtreecommitdiffstats
path: root/libavcodec/gif.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-04-19 23:56:19 +0200
committerClément Bœsch <ubitux@gmail.com>2013-04-19 23:59:22 +0200
commitf5ede48fbb41d37e13a8ffd04eee1fdc78e44ec3 (patch)
tree2ef32e33bd56f97f1d0caa77a6831df2ca040607 /libavcodec/gif.c
parent7004cad36df251de7462207924c00bc03b5e3f5b (diff)
downloadffmpeg-streaming-f5ede48fbb41d37e13a8ffd04eee1fdc78e44ec3.zip
ffmpeg-streaming-f5ede48fbb41d37e13a8ffd04eee1fdc78e44ec3.tar.gz
lavc/gif: miscellaneous cosmetics.
Diffstat (limited to 'libavcodec/gif.c')
-rw-r--r--libavcodec/gif.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/libavcodec/gif.c b/libavcodec/gif.c
index 1dcb676..52c1d44 100644
--- a/libavcodec/gif.c
+++ b/libavcodec/gif.c
@@ -34,11 +34,9 @@
#include "bytestream.h"
#include "internal.h"
#include "lzw.h"
+#include "gif.h"
-/* The GIF format uses reversed order for bitstreams... */
-/* at least they don't use PDP_ENDIAN :) */
#define BITSTREAM_WRITER_LE
-
#include "put_bits.h"
typedef struct {
@@ -137,7 +135,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
}
/* image block */
- bytestream_put_byte(bytestream, 0x2c);
+ bytestream_put_byte(bytestream, GIF_IMAGE_SEPARATOR);
bytestream_put_le16(bytestream, x_start);
bytestream_put_le16(bytestream, y_start);
bytestream_put_le16(bytestream, width);
@@ -189,11 +187,10 @@ static int gif_image_write_image(AVCodecContext *avctx,
ref += ref_linesize;
}
} else {
- /* TODO: reindent */
- for (y = 0; y < height; y++) {
- len += ff_lzw_encode(s->lzw, ptr, width);
- ptr += linesize;
- }
+ for (y = 0; y < height; y++) {
+ len += ff_lzw_encode(s->lzw, ptr, width);
+ ptr += linesize;
+ }
}
len += ff_lzw_encode_flush(s->lzw, flush_put_bits);
@@ -233,7 +230,6 @@ static av_cold int gif_encode_init(AVCodecContext *avctx)
return 0;
}
-/* better than nothing gif encoder */
static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pict, int *got_packet)
{
OpenPOWER on IntegriCloud