Merge commit 'a7dbfcf6cb6ab8a8981d74332fd02fb90360d22f'
* commit 'a7dbfcf6cb6ab8a8981d74332fd02fb90360d22f': sgi: K&R formatting cosmetics Conflicts: libavcodec/sgidec.c libavcodec/sgienc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
be4ae3f532
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* SGI image encoder
|
* SGI image encoder
|
||||||
* Xiaohui Sun <tjnksxh@hotmail.com>
|
* Xiaohui Sun <tjnksxh@hotmail.com>
|
||||||
*
|
*
|
||||||
|
@ -97,7 +97,7 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
|
|||||||
unsigned int start_offset;
|
unsigned int start_offset;
|
||||||
|
|
||||||
/* size of RLE offset and length tables */
|
/* size of RLE offset and length tables */
|
||||||
if (len * 2 > bytestream2_get_bytes_left(&s->g)) {
|
if (len * 2 > bytestream2_get_bytes_left(&s->g)) {
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,8 @@ static int read_rle_sgi(uint8_t *out_buf, SgiState *s)
|
|||||||
* @param s the current image state
|
* @param s the current image state
|
||||||
* @return 0 if read success, else return error code.
|
* @return 0 if read success, else return error code.
|
||||||
*/
|
*/
|
||||||
static int read_uncompressed_sgi(unsigned char* out_buf, SgiState *s)
|
static int read_uncompressed_sgi(unsigned char *out_buf,
|
||||||
|
SgiState *s)
|
||||||
{
|
{
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
unsigned int offset = s->height * s->width * s->bytes_per_channel;
|
unsigned int offset = s->height * s->width * s->bytes_per_channel;
|
||||||
|
@ -132,14 +132,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
memset(buf, 0, SGI_HEADER_SIZE);
|
memset(buf, 0, SGI_HEADER_SIZE);
|
||||||
buf += 80;
|
buf += 80;
|
||||||
|
|
||||||
/* colormap */
|
/* colormap */
|
||||||
bytestream_put_be32(&buf, 0L);
|
bytestream_put_be32(&buf, 0L);
|
||||||
|
|
||||||
/* The rest of the 512 byte header is unused. */
|
/* The rest of the 512 byte header is unused. */
|
||||||
buf += 404;
|
buf += 404;
|
||||||
offsettab = buf;
|
offsettab = buf;
|
||||||
|
|
||||||
if (avctx->coder_type != FF_CODER_TYPE_RAW) {
|
if (avctx->coder_type != FF_CODER_TYPE_RAW) {
|
||||||
/* Skip RLE offset table. */
|
/* Skip RLE offset table. */
|
||||||
buf += tablesize;
|
buf += tablesize;
|
||||||
lengthtab = buf;
|
lengthtab = buf;
|
||||||
@ -195,7 +195,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* total length */
|
/* total length */
|
||||||
pkt->size = buf - pkt->data;
|
pkt->size = buf - pkt->data;
|
||||||
pkt->flags |= AV_PKT_FLAG_KEY;
|
pkt->flags |= AV_PKT_FLAG_KEY;
|
||||||
*got_packet = 1;
|
*got_packet = 1;
|
||||||
|
|
||||||
@ -209,14 +209,14 @@ static av_cold int encode_close(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
AVCodec ff_sgi_encoder = {
|
AVCodec ff_sgi_encoder = {
|
||||||
.name = "sgi",
|
.name = "sgi",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
|
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
|
||||||
.type = AVMEDIA_TYPE_VIDEO,
|
.type = AVMEDIA_TYPE_VIDEO,
|
||||||
.id = AV_CODEC_ID_SGI,
|
.id = AV_CODEC_ID_SGI,
|
||||||
.init = encode_init,
|
.init = encode_init,
|
||||||
.encode2 = encode_frame,
|
.encode2 = encode_frame,
|
||||||
.close = encode_close,
|
.close = encode_close,
|
||||||
.pix_fmts = (const enum AVPixelFormat[]){
|
.pix_fmts = (const enum AVPixelFormat[]) {
|
||||||
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
|
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
|
||||||
AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE,
|
AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE,
|
||||||
AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE,
|
AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user