Originally committed as revision 18259 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -43,7 +43,7 @@ · 42 unmodified lines | |||
| 43 | /* | 43 | /* |
| 44 | * Audio encoding example | 44 | * Audio encoding example |
| 45 | */ | 45 | */ |
| 46 | void audio_encode_example(const char *filename) | 46 | static 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 | */ |
| 114 | void audio_decode_example(const char *outfilename, const char *filename) | 114 | static 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 example | 187 | * Video encoding example |
| 188 | */ | 188 | */ |
| 189 | void video_encode_example(const char *filename) | 189 | static 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 example | 297 | * Video decoding example |
| 298 | */ | 298 | */ |
| 299 | 299 | ||
| 300 | void pgm_save(unsigned char *buf,int wrap, int xsize,int ysize,char *filename) | 300 | static 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 | ||
| 312 | void video_decode_example(const char *outfilename, const char *filename) | 313 | static 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; |
| @@ -150,7 +150,7 @@ struct algo algos[] = { · 149 unmodified lines | |||
| 150 | 150 | ||
| 151 | uint8_t cropTbl[256 + 2 * MAX_NEG_CROP]; | 151 | uint8_t cropTbl[256 + 2 * MAX_NEG_CROP]; |
| 152 | 152 | ||
| 153 | int64_t gettime(void) | 153 | static 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 | ||
| 176 | static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7}; | 176 | static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7}; |
| 177 | 177 | ||
| 178 | void idct_mmx_init(void) | 178 | static 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 | #endif | 198 | #endif |
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | void dct_error(const char *name, int is_idct, | 201 | static 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 | |||
| 387 | static uint8_t img_dest[64] __attribute__ ((aligned (8))); | 387 | static uint8_t img_dest[64] __attribute__ ((aligned (8))); |
| 388 | static uint8_t img_dest1[64] __attribute__ ((aligned (8))); | 388 | static uint8_t img_dest1[64] __attribute__ ((aligned (8))); |
| 389 | 389 | ||
| 390 | void idct248_ref(uint8_t *dest, int linesize, int16_t *block) | 390 | static 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 | ||
| 470 | void idct248_error(const char *name, | 470 | static 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 | ||
| 548 | void help(void) | 548 | static 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" |
| @@ -45,7 +45,7 @@ · 44 unmodified lines | |||
| 45 | 45 | ||
| 46 | FFTComplex *exptab; | 46 | FFTComplex *exptab; |
| 47 | 47 | ||
| 48 | void fft_ref_init(int nbits, int inverse) | 48 | static 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 | ||
| 67 | void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits) | 67 | static 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 | ||
| 96 | void imdct_ref(float *out, float *in, int nbits) | 96 | static 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 */ |
| 114 | void mdct_ref(float *output, float *input, int nbits) | 114 | static 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 | ||
| 132 | float frandom(void) | 132 | static 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 | ||
| 139 | int64_t gettime(void) | 139 | static 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 | ||
| 146 | void check_diff(float *tab1, float *tab2, int n) | 146 | static 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 | ||
| 165 | void help(void) | 165 | static 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" |
| @@ -41,7 +41,7 @@ · 40 unmodified lines | |||
| 41 | uint8_t img1[WIDTH * HEIGHT]; | 41 | uint8_t img1[WIDTH * HEIGHT]; |
| 42 | uint8_t img2[WIDTH * HEIGHT]; | 42 | uint8_t img2[WIDTH * HEIGHT]; |
| 43 | 43 | ||
| 44 | void fill_random(uint8_t *tab, int size) | 44 | static 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 | ||
| 59 | void help(void) | 59 | static 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 | ||
| 66 | int64_t gettime(void) | 66 | static 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 | ||
| 75 | int dummy; | 75 | int dummy; |
| 76 | 76 | ||
| 77 | void test_motion(const char *name, | 77 | static 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; |
| @@ -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 1024 | 106 | #define MAX_DATA_SIZE 1024 |
| 107 | #define MAX_ENCODED_SIZE 2048 | 107 | #define MAX_ENCODED_SIZE 2048 |
| 108 | 108 | ||
| 109 | int test_encode_decode(const uint8_t *data, unsigned int data_size, const char *encoded_ref) | 109 | static 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]; |
| @@ -349,7 +349,7 @@ static const uint8_t cbc_key[] = { · 348 unmodified lines | |||
| 349 | 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23 | 349 | 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23 |
| 350 | }; | 350 | }; |
| 351 | 351 | ||
| 352 | int run_test(int cbc, int decrypt) { | 352 | static 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; |
| @@ -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 | ||
| 177 | int cmp(const void *a, const void *b){ | 177 | static int cmp(const void *a, const void *b){ |
| 178 | return a-b; | 178 | return a-b; |
| 179 | } | 179 | } |
| 180 | 180 | ||