changeset 5029:dbaa06366c3c libavcodec

add a proper prefix to all mjpeg encoder exported functions
author aurel
date Fri, 18 May 2007 22:54:54 +0000
parents 3d8a813666e4
children 9ce0052d533a
files ljpegenc.c mjpegenc.c mjpegenc.h mpegvideo.c
diffstat 4 files changed, 34 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/ljpegenc.c	Fri May 18 22:42:49 2007 +0000
+++ b/ljpegenc.c	Fri May 18 22:54:54 2007 +0000
@@ -52,7 +52,7 @@
     p->pict_type= FF_I_TYPE;
     p->key_frame= 1;
 
-    mjpeg_picture_header(s);
+    ff_mjpeg_encode_picture_header(s);
 
     s->header_bits= put_bits_count(&s->pb);
 
@@ -96,9 +96,9 @@
                     diff= ((left[i] - pred + 0x100)&0x1FF) - 0x100;
 
                     if(i==0)
-                        mjpeg_encode_dc(s, diff, m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
+                        ff_mjpeg_encode_dc(s, diff, m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
                     else
-                        mjpeg_encode_dc(s, diff, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
+                        ff_mjpeg_encode_dc(s, diff, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
                 }
             }
         }
@@ -141,9 +141,9 @@
                                 }
 
                                 if(i==0)
-                                    mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
+                                    ff_mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
                                 else
-                                    mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
+                                    ff_mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
                             }
                         }
                     }
@@ -164,9 +164,9 @@
                                 PREDICT(pred, ptr[-linesize-1], ptr[-linesize], ptr[-1], predictor);
 
                                 if(i==0)
-                                    mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
+                                    ff_mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_luminance, m->huff_code_dc_luminance); //FIXME ugly
                                 else
-                                    mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
+                                    ff_mjpeg_encode_dc(s, (int8_t)(*ptr - pred), m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
                             }
                         }
                     }
@@ -177,7 +177,7 @@
 
     emms_c();
 
-    mjpeg_picture_trailer(s);
+    ff_mjpeg_encode_picture_trailer(s);
     s->picture_number++;
 
     flush_put_bits(&s->pb);
--- a/mjpegenc.c	Fri May 18 22:42:49 2007 +0000
+++ b/mjpegenc.c	Fri May 18 22:54:54 2007 +0000
@@ -44,7 +44,7 @@
 #undef TWOMATRIXES
 
 
-int mjpeg_init(MpegEncContext *s)
+int ff_mjpeg_encode_init(MpegEncContext *s)
 {
     MJpegContext *m;
 
@@ -77,7 +77,7 @@
     return 0;
 }
 
-void mjpeg_close(MpegEncContext *s)
+void ff_mjpeg_encode_close(MpegEncContext *s)
 {
     av_free(s->mjpeg_ctx);
 }
@@ -197,7 +197,7 @@
     }
 }
 
-void mjpeg_picture_header(MpegEncContext *s)
+void ff_mjpeg_encode_picture_header(MpegEncContext *s)
 {
     const int lossless= s->avctx->codec_id != CODEC_ID_MJPEG;
 
@@ -335,16 +335,16 @@
     }
 }
 
-void ff_mjpeg_stuffing(PutBitContext * pbc)
+void ff_mjpeg_encode_stuffing(PutBitContext * pbc)
 {
     int length;
     length= (-put_bits_count(pbc))&7;
     if(length) put_bits(pbc, length, (1<<length)-1);
 }
 
-void mjpeg_picture_trailer(MpegEncContext *s)
+void ff_mjpeg_encode_picture_trailer(MpegEncContext *s)
 {
-    ff_mjpeg_stuffing(&s->pb);
+    ff_mjpeg_encode_stuffing(&s->pb);
     flush_put_bits(&s->pb);
 
     assert((s->header_bits&7)==0);
@@ -354,8 +354,8 @@
     put_marker(&s->pb, EOI);
 }
 
-void mjpeg_encode_dc(MpegEncContext *s, int val,
-                                   uint8_t *huff_size, uint16_t *huff_code)
+void ff_mjpeg_encode_dc(MpegEncContext *s, int val,
+                        uint8_t *huff_size, uint16_t *huff_code)
 {
     int mant, nbits;
 
@@ -389,11 +389,11 @@
     dc = block[0]; /* overflow is impossible */
     val = dc - s->last_dc[component];
     if (n < 4) {
-        mjpeg_encode_dc(s, val, m->huff_size_dc_luminance, m->huff_code_dc_luminance);
+        ff_mjpeg_encode_dc(s, val, m->huff_size_dc_luminance, m->huff_code_dc_luminance);
         huff_size_ac = m->huff_size_ac_luminance;
         huff_code_ac = m->huff_code_ac_luminance;
     } else {
-        mjpeg_encode_dc(s, val, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
+        ff_mjpeg_encode_dc(s, val, m->huff_size_dc_chrominance, m->huff_code_dc_chrominance);
         huff_size_ac = m->huff_size_ac_chrominance;
         huff_code_ac = m->huff_code_ac_chrominance;
     }
@@ -434,8 +434,7 @@
         put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
 }
 
-void mjpeg_encode_mb(MpegEncContext *s,
-                     DCTELEM block[6][64])
+void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64])
 {
     int i;
     for(i=0;i<5;i++) {
--- a/mjpegenc.h	Fri May 18 22:42:49 2007 +0000
+++ b/mjpegenc.h	Fri May 18 22:54:54 2007 +0000
@@ -48,13 +48,13 @@
     uint16_t huff_code_ac_chrominance[256];
 } MJpegContext;
 
-int mjpeg_init(MpegEncContext *s);
-void mjpeg_close(MpegEncContext *s);
-void mjpeg_picture_header(MpegEncContext *s);
-void mjpeg_picture_trailer(MpegEncContext *s);
-void ff_mjpeg_stuffing(PutBitContext *pbc);
-void mjpeg_encode_dc(MpegEncContext *s, int val,
-                     uint8_t *huff_size, uint16_t *huff_code);
-void mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]);
+int  ff_mjpeg_encode_init(MpegEncContext *s);
+void ff_mjpeg_encode_close(MpegEncContext *s);
+void ff_mjpeg_encode_picture_header(MpegEncContext *s);
+void ff_mjpeg_encode_picture_trailer(MpegEncContext *s);
+void ff_mjpeg_encode_stuffing(PutBitContext *pbc);
+void ff_mjpeg_encode_dc(MpegEncContext *s, int val,
+                        uint8_t *huff_size, uint16_t *huff_code);
+void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]);
 
 #endif /* MJPEGENC_H */
--- a/mpegvideo.c	Fri May 18 22:42:49 2007 +0000
+++ b/mpegvideo.c	Fri May 18 22:54:54 2007 +0000
@@ -1204,7 +1204,8 @@
         s->mjpeg_hsample[0] = 2;
         s->mjpeg_hsample[1] = 2>>chroma_h_shift;
         s->mjpeg_hsample[2] = 2>>chroma_h_shift;
-        if (!(ENABLE_MJPEG_ENCODER || ENABLE_LJPEG_ENCODER) || mjpeg_init(s) < 0)
+        if (!(ENABLE_MJPEG_ENCODER || ENABLE_LJPEG_ENCODER)
+            || ff_mjpeg_encode_init(s) < 0)
             return -1;
         avctx->delay=0;
         s->low_delay=1;
@@ -1398,7 +1399,7 @@
 
     MPV_common_end(s);
     if ((ENABLE_MJPEG_ENCODER || ENABLE_LJPEG_ENCODER) && s->out_format == FMT_MJPEG)
-        mjpeg_close(s);
+        ff_mjpeg_encode_close(s);
 
     av_freep(&avctx->extradata);
 
@@ -2544,7 +2545,7 @@
         MPV_frame_end(s);
 
         if (ENABLE_MJPEG_ENCODER && s->out_format == FMT_MJPEG)
-            mjpeg_picture_trailer(s);
+            ff_mjpeg_encode_picture_trailer(s);
 
         if(avctx->rc_buffer_size){
             RateControlContext *rcc= &s->rc_context;
@@ -4594,7 +4595,7 @@
         h263_encode_mb(s, s->block, motion_x, motion_y); break;
     case CODEC_ID_MJPEG:
         if (ENABLE_MJPEG_ENCODER)
-            mjpeg_encode_mb(s, s->block);
+            ff_mjpeg_encode_mb(s, s->block);
         break;
     default:
         assert(0);
@@ -4896,7 +4897,7 @@
 
         ff_mpeg4_stuffing(&s->pb);
     }else if(ENABLE_MJPEG_ENCODER && s->out_format == FMT_MJPEG){
-        ff_mjpeg_stuffing(&s->pb);
+        ff_mjpeg_encode_stuffing(&s->pb);
     }
 
     align_put_bits(&s->pb);
@@ -5763,7 +5764,7 @@
     switch(s->out_format) {
     case FMT_MJPEG:
         if (ENABLE_MJPEG_ENCODER)
-            mjpeg_picture_header(s);
+            ff_mjpeg_encode_picture_header(s);
         break;
     case FMT_H261:
         if (ENABLE_H261_ENCODER)