Browse code

lavc/elbg: rename ff_ symbols to avpriv_, so they can be used in shared libs

In particular, allows the use of elbg in other FFmpeg libraries, required
by the pending elbg filter.

Stefano Sabatini authored on 2013/11/12 20:58:21
Showing 6 changed files
... ...
@@ -338,8 +338,8 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
338 338
             buf = pkt->data;
339 339
 
340 340
             /* calc optimal new charset + charmaps */
341
-            ff_init_elbg(meta, 32, 1000 * c->mc_lifetime, best_cb, CHARSET_CHARS, 50, charmap, &c->randctx);
342
-            ff_do_elbg  (meta, 32, 1000 * c->mc_lifetime, best_cb, CHARSET_CHARS, 50, charmap, &c->randctx);
341
+            avpriv_init_elbg(meta, 32, 1000 * c->mc_lifetime, best_cb, CHARSET_CHARS, 50, charmap, &c->randctx);
342
+            avpriv_do_elbg  (meta, 32, 1000 * c->mc_lifetime, best_cb, CHARSET_CHARS, 50, charmap, &c->randctx);
343 343
 
344 344
             /* create colorram map and a c64 readable charset */
345 345
             render_charset(avctx, charset, colram);
... ...
@@ -324,7 +324,7 @@ static void do_shiftings(elbg_data *elbg)
324 324
 
325 325
 #define BIG_PRIME 433494437LL
326 326
 
327
-void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
327
+void avpriv_init_elbg(int *points, int dim, int numpoints, int *codebook,
328 328
                   int numCB, int max_steps, int *closest_cb,
329 329
                   AVLFG *rand_state)
330 330
 {
... ...
@@ -339,8 +339,8 @@ void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
339 339
             memcpy(temp_points + i*dim, points + k*dim, dim*sizeof(int));
340 340
         }
341 341
 
342
-        ff_init_elbg(temp_points, dim, numpoints/8, codebook, numCB, 2*max_steps, closest_cb, rand_state);
343
-        ff_do_elbg(temp_points, dim, numpoints/8, codebook, numCB, 2*max_steps, closest_cb, rand_state);
342
+        avpriv_init_elbg(temp_points, dim, numpoints/8, codebook, numCB, 2*max_steps, closest_cb, rand_state);
343
+        avpriv_do_elbg(temp_points, dim, numpoints/8, codebook, numCB, 2*max_steps, closest_cb, rand_state);
344 344
 
345 345
         av_free(temp_points);
346 346
 
... ...
@@ -351,7 +351,7 @@ void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
351 351
 
352 352
 }
353 353
 
354
-void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
354
+void avpriv_do_elbg(int *points, int dim, int numpoints, int *codebook,
355 355
                 int numCB, int max_steps, int *closest_cb,
356 356
                 AVLFG *rand_state)
357 357
 {
... ...
@@ -37,7 +37,7 @@
37 37
  * @param closest_cb Return the closest codebook to each point. Must be allocated.
38 38
  * @param rand_state A random number generator state. Should be already initialized by av_lfg_init().
39 39
  */
40
-void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
40
+void avpriv_do_elbg(int *points, int dim, int numpoints, int *codebook,
41 41
                 int numCB, int num_steps, int *closest_cb,
42 42
                 AVLFG *rand_state);
43 43
 
... ...
@@ -45,10 +45,10 @@ void ff_do_elbg(int *points, int dim, int numpoints, int *codebook,
45 45
  * Initialize the **codebook vector for the elbg algorithm. If you have already
46 46
  * a codebook and you want to refine it, you shouldn't call this function.
47 47
  * If numpoints < 8*numCB this function fills **codebook with random numbers.
48
- * If not, it calls ff_do_elbg for a (smaller) random sample of the points in
49
- * **points. Get the same parameters as ff_do_elbg.
48
+ * If not, it calls avpriv_do_elbg for a (smaller) random sample of the points in
49
+ * **points. Get the same parameters as avpriv_do_elbg.
50 50
  */
51
-void ff_init_elbg(int *points, int dim, int numpoints, int *codebook,
51
+void avpriv_init_elbg(int *points, int dim, int numpoints, int *codebook,
52 52
                   int numCB, int num_steps, int *closest_cb,
53 53
                   AVLFG *rand_state);
54 54
 
... ...
@@ -118,8 +118,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
118 118
             }
119 119
             // try to find optimal value to fill whole 4x4 block
120 120
             score = 0;
121
-            ff_init_elbg(c->block, 3, 16, c->avg, 1, 1, c->output, &c->rnd);
122
-            ff_do_elbg  (c->block, 3, 16, c->avg, 1, 1, c->output, &c->rnd);
121
+            avpriv_init_elbg(c->block, 3, 16, c->avg, 1, 1, c->output, &c->rnd);
122
+            avpriv_do_elbg  (c->block, 3, 16, c->avg, 1, 1, c->output, &c->rnd);
123 123
             if(c->avg[0] == 1) // red component = 1 will be written as skip code
124 124
                 c->avg[0] = 0;
125 125
             for(j = 0; j < 4; j++){
... ...
@@ -138,8 +138,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
138 138
             }
139 139
             // search for optimal filling of 2-color block
140 140
             score = 0;
141
-            ff_init_elbg(c->block, 3, 16, c->codebook, 2, 1, c->output, &c->rnd);
142
-            ff_do_elbg  (c->block, 3, 16, c->codebook, 2, 1, c->output, &c->rnd);
141
+            avpriv_init_elbg(c->block, 3, 16, c->codebook, 2, 1, c->output, &c->rnd);
142
+            avpriv_do_elbg  (c->block, 3, 16, c->codebook, 2, 1, c->output, &c->rnd);
143 143
             // last output value should be always 1, swap codebooks if needed
144 144
             if(!c->output[15]){
145 145
                 for(i = 0; i < 3; i++)
... ...
@@ -164,8 +164,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
164 164
             // search for optimal filling of 2-color 2x2 subblocks
165 165
             score = 0;
166 166
             for(i = 0; i < 4; i++){
167
-                ff_init_elbg(c->block2 + i*4*3, 3, 4, c->codebook2 + i*2*3, 2, 1, c->output2 + i*4, &c->rnd);
168
-                ff_do_elbg  (c->block2 + i*4*3, 3, 4, c->codebook2 + i*2*3, 2, 1, c->output2 + i*4, &c->rnd);
167
+                avpriv_init_elbg(c->block2 + i*4*3, 3, 4, c->codebook2 + i*2*3, 2, 1, c->output2 + i*4, &c->rnd);
168
+                avpriv_do_elbg  (c->block2 + i*4*3, 3, 4, c->codebook2 + i*2*3, 2, 1, c->output2 + i*4, &c->rnd);
169 169
             }
170 170
             // last value should be always 1, swap codebooks if needed
171 171
             if(!c->output2[15]){
... ...
@@ -806,8 +806,8 @@ static void generate_codebook(RoqContext *enc, RoqTempdata *tempdata,
806 806
     else
807 807
         closest_cb = tempdata->closest_cb2;
808 808
 
809
-    ff_init_elbg(points, 6*c_size, inputCount, codebook, cbsize, 1, closest_cb, &enc->randctx);
810
-    ff_do_elbg(points, 6*c_size, inputCount, codebook, cbsize, 1, closest_cb, &enc->randctx);
809
+    avpriv_init_elbg(points, 6*c_size, inputCount, codebook, cbsize, 1, closest_cb, &enc->randctx);
810
+    avpriv_do_elbg(points, 6*c_size, inputCount, codebook, cbsize, 1, closest_cb, &enc->randctx);
811 811
 
812 812
     if (size == 4)
813 813
         av_free(closest_cb);
... ...
@@ -30,7 +30,7 @@
30 30
 
31 31
 #define LIBAVCODEC_VERSION_MAJOR 55
32 32
 #define LIBAVCODEC_VERSION_MINOR  41
33
-#define LIBAVCODEC_VERSION_MICRO 100
33
+#define LIBAVCODEC_VERSION_MICRO 101
34 34
 
35 35
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
36 36
                                                LIBAVCODEC_VERSION_MINOR, \