History

Mark non-exported functions in test and example programs as static.

Originally committed as revision 18259 to svn://svn.ffmpeg.org/ffmpeg/trunk

Diego Biurrun committed 17 years ago

Commit 504ffed1 parent cafe71c7 files · +28 −26Browse files

Unified · Split

7 files
  1. libavcodec/api-example.c +6 −5
  2. libavcodec/dct-test.c +6 −6
  3. libavcodec/fft-test.c +8 −8
  4. libavcodec/motion-test.c +4 −4
  5. libavutil/base64.c +2 −1
  6. libavutil/des.c +1 −1
  7. libavutil/tree.c +1 −1
libavcodec/api-example.c+6−5
@@ -43,7 +43,7 @@ · 42 unmodified lines
43/*43/*
44 * Audio encoding example44 * Audio encoding example
45 */45 */
46void audio_encode_example(const char *filename)46static void audio_encode_example(const char *filename)
47{47{
48 AVCodec *codec;48 AVCodec *codec;
49 AVCodecContext *c= NULL;49 AVCodecContext *c= NULL;
@@ -111,7 +111,7 @@ void audio_encode_example(const char *filename) · 61 unmodified lines
111/*111/*
112 * Audio decoding.112 * Audio decoding.
113 */113 */
114void audio_decode_example(const char *outfilename, const char *filename)114static void audio_decode_example(const char *outfilename, const char *filename)
115{115{
116 AVCodec *codec;116 AVCodec *codec;
117 AVCodecContext *c= NULL;117 AVCodecContext *c= NULL;
@@ -186,7 +186,7 @@ void audio_decode_example(const char *outfilename, const char *filename) · 68 unmodified lines
186/*186/*
187 * Video encoding example187 * Video encoding example
188 */188 */
189void video_encode_example(const char *filename)189static void video_encode_example(const char *filename)
190{190{
191 AVCodec *codec;191 AVCodec *codec;
192 AVCodecContext *c= NULL;192 AVCodecContext *c= NULL;
@@ -297,7 +297,8 @@ void video_encode_example(const char *filename) · 104 unmodified lines
297 * Video decoding example297 * Video decoding example
298 */298 */
299 299
300void pgm_save(unsigned char *buf,int wrap, int xsize,int ysize,char *filename)300static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize,
301 char *filename)
301{302{
302 FILE *f;303 FILE *f;
303 int i;304 int i;
@@ -309,7 +310,7 @@ void pgm_save(unsigned char *buf,int wrap, int xsize,int ysize,char *filename) · 5 unmodified lines
309 fclose(f);310 fclose(f);
310}311}
311 312
312void video_decode_example(const char *outfilename, const char *filename)313static void video_decode_example(const char *outfilename, const char *filename)
313{314{
314 AVCodec *codec;315 AVCodec *codec;
315 AVCodecContext *c= NULL;316 AVCodecContext *c= NULL;
libavcodec/dct-test.c+6−6
@@ -150,7 +150,7 @@ struct algo algos[] = { · 149 unmodified lines
150 150
151uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];151uint8_t cropTbl[256 + 2 * MAX_NEG_CROP];
152 152
153int64_t gettime(void)153static int64_t gettime(void)
154{154{
155 struct timeval tv;155 struct timeval tv;
156 gettimeofday(&tv,NULL);156 gettimeofday(&tv,NULL);
@@ -175,7 +175,7 @@ static short idct_simple_mmx_perm[64]={ · 18 unmodified lines
175 175
176static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7};176static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7};
177 177
178void idct_mmx_init(void)178static void idct_mmx_init(void)
179{179{
180 int i;180 int i;
181 181
@@ -198,7 +198,7 @@ static inline void mmx_emms(void) · 16 unmodified lines
198#endif198#endif
199}199}
200 200
201void dct_error(const char *name, int is_idct,201static void dct_error(const char *name, int is_idct,
202 void (*fdct_func)(DCTELEM *block),202 void (*fdct_func)(DCTELEM *block),
203 void (*fdct_ref)(DCTELEM *block), int form, int test)203 void (*fdct_ref)(DCTELEM *block), int form, int test)
204{204{
@@ -387,7 +387,7 @@ void dct_error(const char *name, int is_idct, · 182 unmodified lines
387static uint8_t img_dest[64] __attribute__ ((aligned (8)));387static uint8_t img_dest[64] __attribute__ ((aligned (8)));
388static uint8_t img_dest1[64] __attribute__ ((aligned (8)));388static uint8_t img_dest1[64] __attribute__ ((aligned (8)));
389 389
390void idct248_ref(uint8_t *dest, int linesize, int16_t *block)390static void idct248_ref(uint8_t *dest, int linesize, int16_t *block)
391{391{
392 static int init;392 static int init;
393 static double c8[8][8];393 static double c8[8][8];
@@ -467,7 +467,7 @@ void idct248_ref(uint8_t *dest, int linesize, int16_t *block) · 73 unmodified lines
467 }467 }
468}468}
469 469
470void idct248_error(const char *name,470static void idct248_error(const char *name,
471 void (*idct248_put)(uint8_t *dest, int line_size, int16_t *block))471 void (*idct248_put)(uint8_t *dest, int line_size, int16_t *block))
472{472{
473 int it, i, it1, ti, ti1, err_max, v;473 int it, i, it1, ti, ti1, err_max, v;
@@ -545,7 +545,7 @@ void idct248_error(const char *name, · 71 unmodified lines
545 name, (double)it1 * 1000.0 / (double)ti1);545 name, (double)it1 * 1000.0 / (double)ti1);
546}546}
547 547
548void help(void)548static void help(void)
549{549{
550 printf("dct-test [-i] [<test-number>]\n"550 printf("dct-test [-i] [<test-number>]\n"
551 "test-number 0 -> test with random matrixes\n"551 "test-number 0 -> test with random matrixes\n"
libavcodec/fft-test.c+8−8
@@ -45,7 +45,7 @@ · 44 unmodified lines
45 45
46FFTComplex *exptab;46FFTComplex *exptab;
47 47
48void fft_ref_init(int nbits, int inverse)48static void fft_ref_init(int nbits, int inverse)
49{49{
50 int n, i;50 int n, i;
51 double c1, s1, alpha;51 double c1, s1, alpha;
@@ -64,7 +64,7 @@ void fft_ref_init(int nbits, int inverse) · 12 unmodified lines
64 }64 }
65}65}
66 66
67void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits)67static void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits)
68{68{
69 int n, i, j, k, n2;69 int n, i, j, k, n2;
70 double tmp_re, tmp_im, s, c;70 double tmp_re, tmp_im, s, c;
@@ -93,7 +93,7 @@ void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits) · 22 unmodified lines
93 }93 }
94}94}
95 95
96void imdct_ref(float *out, float *in, int nbits)96static void imdct_ref(float *out, float *in, int nbits)
97{97{
98 int n = 1<<nbits;98 int n = 1<<nbits;
99 int k, i, a;99 int k, i, a;
@@ -111,7 +111,7 @@ void imdct_ref(float *out, float *in, int nbits) · 11 unmodified lines
111}111}
112 112
113/* NOTE: no normalisation by 1 / N is done */113/* NOTE: no normalisation by 1 / N is done */
114void mdct_ref(float *output, float *input, int nbits)114static void mdct_ref(float *output, float *input, int nbits)
115{115{
116 int n = 1<<nbits;116 int n = 1<<nbits;
117 int k, i;117 int k, i;
@@ -129,21 +129,21 @@ void mdct_ref(float *output, float *input, int nbits) · 11 unmodified lines
129}129}
130 130
131 131
132float frandom(void)132static float frandom(void)
133{133{
134 AVLFG prn;134 AVLFG prn;
135 av_lfg_init(&prn, 1);135 av_lfg_init(&prn, 1);
136 return (float)((av_lfg_get(&prn) & 0xffff) - 32768) / 32768.0;136 return (float)((av_lfg_get(&prn) & 0xffff) - 32768) / 32768.0;
137}137}
138 138
139int64_t gettime(void)139static int64_t gettime(void)
140{140{
141 struct timeval tv;141 struct timeval tv;
142 gettimeofday(&tv,NULL);142 gettimeofday(&tv,NULL);
143 return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;143 return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
144}144}
145 145
146void check_diff(float *tab1, float *tab2, int n)146static void check_diff(float *tab1, float *tab2, int n)
147{147{
148 int i;148 int i;
149 double max= 0;149 double max= 0;
@@ -162,7 +162,7 @@ void check_diff(float *tab1, float *tab2, int n) · 12 unmodified lines
162}162}
163 163
164 164
165void help(void)165static void help(void)
166{166{
167 av_log(NULL, AV_LOG_INFO,"usage: fft-test [-h] [-s] [-i] [-n b]\n"167 av_log(NULL, AV_LOG_INFO,"usage: fft-test [-h] [-s] [-i] [-n b]\n"
168 "-h print this help\n"168 "-h print this help\n"
libavcodec/motion-test.c+4−4
@@ -41,7 +41,7 @@ · 40 unmodified lines
41uint8_t img1[WIDTH * HEIGHT];41uint8_t img1[WIDTH * HEIGHT];
42uint8_t img2[WIDTH * HEIGHT];42uint8_t img2[WIDTH * HEIGHT];
43 43
44void fill_random(uint8_t *tab, int size)44static void fill_random(uint8_t *tab, int size)
45{45{
46 int i;46 int i;
47 AVLFG prn;47 AVLFG prn;
@@ -56,14 +56,14 @@ void fill_random(uint8_t *tab, int size) · 8 unmodified lines
56 }56 }
57}57}
58 58
59void help(void)59static void help(void)
60{60{
61 printf("motion-test [-h]\n"61 printf("motion-test [-h]\n"
62 "test motion implementations\n");62 "test motion implementations\n");
63 exit(1);63 exit(1);
64}64}
65 65
66int64_t gettime(void)66static int64_t gettime(void)
67{67{
68 struct timeval tv;68 struct timeval tv;
69 gettimeofday(&tv,NULL);69 gettimeofday(&tv,NULL);
@@ -74,7 +74,7 @@ int64_t gettime(void) · 4 unmodified lines
74 74
75int dummy;75int dummy;
76 76
77void test_motion(const char *name,77static void test_motion(const char *name,
78 me_cmp_func test_func, me_cmp_func ref_func)78 me_cmp_func test_func, me_cmp_func ref_func)
79{79{
80 int x, y, d1, d2, it;80 int x, y, d1, d2, it;
libavutil/base64.c+2−1
@@ -106,7 +106,8 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size) · 105 unmodified lines
106#define MAX_DATA_SIZE 1024106#define MAX_DATA_SIZE 1024
107#define MAX_ENCODED_SIZE 2048107#define MAX_ENCODED_SIZE 2048
108 108
109int test_encode_decode(const uint8_t *data, unsigned int data_size, const char *encoded_ref)109static int test_encode_decode(const uint8_t *data, unsigned int data_size,
110 const char *encoded_ref)
110{111{
111 char encoded[MAX_ENCODED_SIZE];112 char encoded[MAX_ENCODED_SIZE];
112 uint8_t data2[MAX_DATA_SIZE];113 uint8_t data2[MAX_DATA_SIZE];
libavutil/des.c+1−1
@@ -349,7 +349,7 @@ static const uint8_t cbc_key[] = { · 348 unmodified lines
349 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23349 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23
350};350};
351 351
352int run_test(int cbc, int decrypt) {352static int run_test(int cbc, int decrypt) {
353 AVDES d;353 AVDES d;
354 int delay = cbc && !decrypt ? 2 : 1;354 int delay = cbc && !decrypt ? 2 : 1;
355 uint64_t res;355 uint64_t res;
libavutil/tree.c+1−1
@@ -174,7 +174,7 @@ static void print(AVTreeNode *t, int depth){ · 173 unmodified lines
174 av_log(NULL, AV_LOG_ERROR, "NULL\n");174 av_log(NULL, AV_LOG_ERROR, "NULL\n");
175}175}
176 176
177int cmp(const void *a, const void *b){177static int cmp(const void *a, const void *b){
178 return a-b;178 return a-b;
179}179}
180 180

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t