mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavc/gif: miscellaneous cosmetics.
This commit is contained in:
parent
7004cad36d
commit
f5ede48fbb
@ -34,11 +34,9 @@
|
|||||||
#include "bytestream.h"
|
#include "bytestream.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "lzw.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
|
#define BITSTREAM_WRITER_LE
|
||||||
|
|
||||||
#include "put_bits.h"
|
#include "put_bits.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -137,7 +135,7 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* image block */
|
/* image block */
|
||||||
bytestream_put_byte(bytestream, 0x2c);
|
bytestream_put_byte(bytestream, GIF_IMAGE_SEPARATOR);
|
||||||
bytestream_put_le16(bytestream, x_start);
|
bytestream_put_le16(bytestream, x_start);
|
||||||
bytestream_put_le16(bytestream, y_start);
|
bytestream_put_le16(bytestream, y_start);
|
||||||
bytestream_put_le16(bytestream, width);
|
bytestream_put_le16(bytestream, width);
|
||||||
@ -189,11 +187,10 @@ static int gif_image_write_image(AVCodecContext *avctx,
|
|||||||
ref += ref_linesize;
|
ref += ref_linesize;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* TODO: reindent */
|
for (y = 0; y < height; y++) {
|
||||||
for (y = 0; y < height; y++) {
|
len += ff_lzw_encode(s->lzw, ptr, width);
|
||||||
len += ff_lzw_encode(s->lzw, ptr, width);
|
ptr += linesize;
|
||||||
ptr += linesize;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
len += ff_lzw_encode_flush(s->lzw, flush_put_bits);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* better than nothing gif encoder */
|
|
||||||
static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||||
const AVFrame *pict, int *got_packet)
|
const AVFrame *pict, int *got_packet)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user