]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mjpegenc_common.c
ppc: Centralize compiler-specific altivec.h #include handling in one place
[ffmpeg] / libavcodec / mjpegenc_common.c
index f2a829fd335ae1e076c1353d712d86e28780bdb6..2262de60bdd7e34f486c1b3c4a4305927cb83286 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "avcodec.h"
 #include "idctdsp.h"
+#include "jpegtables.h"
 #include "put_bits.h"
 #include "mjpegenc.h"
 #include "mjpegenc_common.h"
@@ -97,7 +98,10 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
         put_marker(p, APP0);
         put_bits(p, 16, 16);
         avpriv_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */
-        put_bits(p, 16, 0x0201);         /* v 1.02 */
+        /* The most significant byte is used for major revisions, the least
+         * significant byte for minor revisions. Version 1.02 is the current
+         * released revision. */
+        put_bits(p, 16, 0x0102);
         put_bits(p,  8, 0);              /* units type: 0 - aspect ratio */
         put_bits(p, 16, avctx->sample_aspect_ratio.num);
         put_bits(p, 16, avctx->sample_aspect_ratio.den);
@@ -106,7 +110,7 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
     }
 
     /* comment */
-    if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+    if (!(avctx->flags & AV_CODEC_FLAG_BITEXACT)) {
         put_marker(p, COM);
         flush_put_bits(p);
         ptr = put_bits_ptr(p);
@@ -130,7 +134,7 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
 }
 
 void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
-                                    ScanTable *intra_scantable,
+                                    ScanTable *intra_scantable, int pred,
                                     uint16_t intra_matrix[64])
 {
     int chroma_h_shift, chroma_v_shift;
@@ -213,7 +217,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
     put_bits(pb, 4, 1); /* DC huffman table index */
     put_bits(pb, 4, lossless ? 0 : 1); /* AC huffman table index */
 
-    put_bits(pb, 8, lossless ? avctx->prediction_method + 1 : 0); /* Ss (not used) */
+    put_bits(pb, 8, lossless ? pred : 0); /* Ss (not used) */
 
     switch (avctx->codec_id) {
     case AV_CODEC_ID_MJPEG:  put_bits(pb, 8, 63); break; /* Se (not used) */