Mercurial > libavcodec.hg
comparison utils.c @ 8590:7a463923ecd1 libavcodec
Change semantic of CONFIG_*, HAVE_* and ARCH_*.
They are now always defined to either 0 or 1.
author | aurel |
---|---|
date | Tue, 13 Jan 2009 23:44:16 +0000 |
parents | 93dbb3999cc8 |
children | 68e959302527 |
comparison
equal
deleted
inserted
replaced
8589:a29b5b5c3c9d | 8590:7a463923ecd1 |
---|---|
38 #include "audioconvert.h" | 38 #include "audioconvert.h" |
39 #include <stdlib.h> | 39 #include <stdlib.h> |
40 #include <stdarg.h> | 40 #include <stdarg.h> |
41 #include <limits.h> | 41 #include <limits.h> |
42 #include <float.h> | 42 #include <float.h> |
43 #if !defined(HAVE_MKSTEMP) | 43 #if !HAVE_MKSTEMP |
44 #include <fcntl.h> | 44 #include <fcntl.h> |
45 #endif | 45 #endif |
46 | 46 |
47 const uint8_t ff_reverse[256]={ | 47 const uint8_t ff_reverse[256]={ |
48 0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0, | 48 0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0, |
249 for (i=0; i<4; i++){ | 249 for (i=0; i<4; i++){ |
250 //STRIDE_ALIGN is 8 for SSE* but this does not work for SVQ1 chroma planes | 250 //STRIDE_ALIGN is 8 for SSE* but this does not work for SVQ1 chroma planes |
251 //we could change STRIDE_ALIGN to 16 for x86/sse but it would increase the | 251 //we could change STRIDE_ALIGN to 16 for x86/sse but it would increase the |
252 //picture size unneccessarily in some cases. The solution here is not | 252 //picture size unneccessarily in some cases. The solution here is not |
253 //pretty and better ideas are welcome! | 253 //pretty and better ideas are welcome! |
254 #ifdef HAVE_MMX | 254 #if HAVE_MMX |
255 if(s->codec_id == CODEC_ID_SVQ1) | 255 if(s->codec_id == CODEC_ID_SVQ1) |
256 stride_align[i]= 16; | 256 stride_align[i]= 16; |
257 else | 257 else |
258 #endif | 258 #endif |
259 stride_align[i] = STRIDE_ALIGN; | 259 stride_align[i] = STRIDE_ALIGN; |
898 default: | 898 default: |
899 return 0; | 899 return 0; |
900 } | 900 } |
901 } | 901 } |
902 | 902 |
903 #if !defined(HAVE_THREADS) | 903 #if !HAVE_THREADS |
904 int avcodec_thread_init(AVCodecContext *s, int thread_count){ | 904 int avcodec_thread_init(AVCodecContext *s, int thread_count){ |
905 return -1; | 905 return -1; |
906 } | 906 } |
907 #endif | 907 #endif |
908 | 908 |
925 * *prefix can be a character constant; *filename will be allocated internally. | 925 * *prefix can be a character constant; *filename will be allocated internally. |
926 * Returns file descriptor of opened file (or -1 on error) | 926 * Returns file descriptor of opened file (or -1 on error) |
927 * and opened file name in **filename. */ | 927 * and opened file name in **filename. */ |
928 int av_tempfile(char *prefix, char **filename) { | 928 int av_tempfile(char *prefix, char **filename) { |
929 int fd=-1; | 929 int fd=-1; |
930 #if !defined(HAVE_MKSTEMP) | 930 #if !HAVE_MKSTEMP |
931 *filename = tempnam(".", prefix); | 931 *filename = tempnam(".", prefix); |
932 #else | 932 #else |
933 size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ | 933 size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ |
934 *filename = av_malloc(len); | 934 *filename = av_malloc(len); |
935 #endif | 935 #endif |
936 /* -----common section-----*/ | 936 /* -----common section-----*/ |
937 if (*filename == NULL) { | 937 if (*filename == NULL) { |
938 av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n"); | 938 av_log(NULL, AV_LOG_ERROR, "ff_tempfile: Cannot allocate file name\n"); |
939 return -1; | 939 return -1; |
940 } | 940 } |
941 #if !defined(HAVE_MKSTEMP) | 941 #if !HAVE_MKSTEMP |
942 fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444); | 942 fd = open(*filename, O_RDWR | O_BINARY | O_CREAT, 0444); |
943 #else | 943 #else |
944 snprintf(*filename, len, "/tmp/%sXXXXXX", prefix); | 944 snprintf(*filename, len, "/tmp/%sXXXXXX", prefix); |
945 fd = mkstemp(*filename); | 945 fd = mkstemp(*filename); |
946 if (fd < 0) { | 946 if (fd < 0) { |