Browse code

Merge commit '6c1df1f2287401b6022773e382ebc3a3bfed0b38'

* commit '6c1df1f2287401b6022773e382ebc3a3bfed0b38':
sgi: encode images with 4 channels at 8 and 16 bits

Conflicts:
Changelog
libavcodec/sgienc.c

See: 21a100610977a163fe6480b5cf4c25f34f64b86b
Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/04/01 11:09:22
Showing 2 changed files
... ...
@@ -397,7 +397,7 @@ version 0.10:
397 397
 - ffwavesynth decoder
398 398
 - aviocat tool
399 399
 - ffeval tool
400
-- support decoding 4-channel SGI images
400
+- support encoding and decoding 4-channel SGI images
401 401
 
402 402
 
403 403
 version 0.9:
... ...
@@ -50,7 +50,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
50 50
     const AVFrame * const p = frame;
51 51
     uint8_t *offsettab, *lengthtab, *in_buf, *encode_buf, *buf;
52 52
     int x, y, z, length, tablesize, ret;
53
-    unsigned int width, height, depth, dimension, bytes_per_channel, pixmax, put_be;
53
+    unsigned int width, height, depth, dimension;
54
+    unsigned int bytes_per_channel, pixmax, put_be;
54 55
     unsigned char *end_buf;
55 56
 
56 57
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
... ...
@@ -183,7 +184,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
183 183
             for (y = 0; y < height; y++) {
184 184
                 for (x = 0; x < width * depth; x += depth)
185 185
                     if (bytes_per_channel == 1) {
186
-                    bytestream_put_byte(&buf, in_buf[x]);
186
+                        bytestream_put_byte(&buf, in_buf[x]);
187 187
                     } else {
188 188
                         if (put_be) {
189 189
                             bytestream_put_be16(&buf, ((uint16_t *)in_buf)[x]);
... ...
@@ -223,7 +224,7 @@ AVCodec ff_sgi_encoder = {
223 223
         AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA,
224 224
         AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE,
225 225
         AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE,
226
-        AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE,
227
-        AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
226
+        AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY8,
227
+        AV_PIX_FMT_NONE
228 228
     },
229 229
 };