diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-04-27 03:51:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-27 03:51:04 +0200 |
commit | d7e5aebae7652ac766034f1d90e5a4f62677fb3c (patch) | |
tree | b77ee45f34455cf9aa6e28105a7533ecc204b898 /libavutil | |
parent | 93c28a55fd84280d97c3c0dd7b0d546043242c34 (diff) | |
parent | 79ee8977c25eee2408ef7b2822f377a983e4d65b (diff) | |
download | ffmpeg-d7e5aebae7652ac766034f1d90e5a4f62677fb3c.tar.gz |
Merge remote branch 'qatar/master'
* qatar/master: (23 commits)
ac3enc: correct the flipped sign in the ac3_fixed encoder
Eliminate pointless '#if 1' statements without matching '#else'.
Add AVX FFT implementation.
Increase alignment of av_malloc() as needed by AVX ASM.
Update x86inc.asm from x264 to allow AVX emulation using SSE and MMX.
mjpeg: Detect overreads in mjpeg_decode_scan() and error out.
documentation: extend documentation for ffmpeg -aspect option
APIChanges: update commit hashes for recent additions.
lavc: deprecate FF_*_TYPE macros in favor of AV_PICTURE_TYPE_* enums
aac: add headers needed for log2f()
lavc: remove FF_API_MB_Q cruft
lavc: remove FF_API_RATE_EMU cruft
lavc: remove FF_API_HURRY_UP cruft
pad: make the filter parametric
vsrc_movie: add key_frame and pict_type.
vsrc_movie: fix leak in request_frame()
lavfi: add key_frame and pict_type to AVFilterBufferRefVideo.
vsrc_buffer: add sample_aspect_ratio fields to arguments.
lavfi: add fieldorder filter
scale: make the filter parametric
...
Conflicts:
Changelog
doc/filters.texi
ffmpeg.c
libavcodec/ac3dec.h
libavcodec/dsputil.c
libavfilter/avfilter.h
libavfilter/vf_scale.c
libavfilter/vf_yadif.c
libavfilter/vsrc_buffer.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/avutil.h | 21 | ||||
-rw-r--r-- | libavutil/mem.c | 16 | ||||
-rw-r--r-- | libavutil/pca.c | 3 | ||||
-rw-r--r-- | libavutil/utils.c | 14 |
4 files changed, 42 insertions, 12 deletions
diff --git a/libavutil/avutil.h b/libavutil/avutil.h index 307a585290..b0462f1d91 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -40,7 +40,7 @@ #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 0 +#define LIBAVUTIL_VERSION_MINOR 1 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -97,6 +97,25 @@ enum AVMediaType { #define AV_TIME_BASE 1000000 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} +enum AVPictureType { + AV_PICTURE_TYPE_I = 1, ///< Intra + AV_PICTURE_TYPE_P, ///< Predicted + AV_PICTURE_TYPE_B, ///< Bi-dir predicted + AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 + AV_PICTURE_TYPE_SI, ///< Switching Intra + AV_PICTURE_TYPE_SP, ///< Switching Predicted + AV_PICTURE_TYPE_BI, ///< BI type +}; + +/** + * Return a single letter to describe the given picture type + * pict_type. + * + * @param[in] pict_type the picture type @return a single character + * representing the picture type, '?' if pict_type is unknown + */ +char av_get_picture_type_char(enum AVPictureType pict_type); + #include "common.h" #include "error.h" #include "mathematics.h" diff --git a/libavutil/mem.c b/libavutil/mem.c index 7e07fd2596..90f8667505 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -69,21 +69,21 @@ void *av_malloc(size_t size) #endif /* let's disallow possible ambiguous cases */ - if(size > (INT_MAX-16) ) + if(size > (INT_MAX-32) ) return NULL; #if CONFIG_MEMALIGN_HACK - ptr = malloc(size+16); + ptr = malloc(size+32); if(!ptr) return ptr; - diff= ((-(long)ptr - 1)&15) + 1; + diff= ((-(long)ptr - 1)&31) + 1; ptr = (char*)ptr + diff; ((char*)ptr)[-1]= diff; #elif HAVE_POSIX_MEMALIGN - if (posix_memalign(&ptr,16,size)) + if (posix_memalign(&ptr,32,size)) ptr = NULL; #elif HAVE_MEMALIGN - ptr = memalign(16,size); + ptr = memalign(32,size); /* Why 64? Indeed, we should align it: on 4 for 386 @@ -93,10 +93,8 @@ void *av_malloc(size_t size) Because L1 and L2 caches are aligned on those values. But I don't want to code such logic here! */ - /* Why 16? - Because some CPUs need alignment, for example SSE2 on P4, & most RISC CPUs - it will just trigger an exception and the unaligned load will be done in the - exception handler or it will just segfault (SSE2 on P4). + /* Why 32? + For AVX ASM. SSE / NEON needs only 16. Why not larger? Because I did not see a difference in benchmarks ... */ /* benchmarks with P3 diff --git a/libavutil/pca.c b/libavutil/pca.c index ce08e9ccb4..0839d68ed2 100644 --- a/libavutil/pca.c +++ b/libavutil/pca.c @@ -218,7 +218,6 @@ int main(void){ printf("\n"); } -#if 1 for(i=0; i<LEN; i++){ double v[LEN]; double error=0; @@ -233,7 +232,7 @@ int main(void){ printf("%f ", error); } printf("\n"); -#endif + for(i=0; i<LEN; i++){ for(j=0; j<LEN; j++){ printf("%9.6f ", eigenvector[i + j*LEN]); diff --git a/libavutil/utils.c b/libavutil/utils.c index 8a1d32e167..c77a060443 100644 --- a/libavutil/utils.c +++ b/libavutil/utils.c @@ -39,3 +39,17 @@ const char *avutil_license(void) #define LICENSE_PREFIX "libavutil license: " return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; } + +char av_get_picture_type_char(enum AVPictureType pict_type) +{ + switch (pict_type) { + case AV_PICTURE_TYPE_I: return 'I'; + case AV_PICTURE_TYPE_P: return 'P'; + case AV_PICTURE_TYPE_B: return 'B'; + case AV_PICTURE_TYPE_S: return 'S'; + case AV_PICTURE_TYPE_SI: return 'i'; + case AV_PICTURE_TYPE_SP: return 'p'; + case AV_PICTURE_TYPE_BI: return 'b'; + default: return '?'; + } +} |