diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-04 17:04:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-04 17:04:51 +0200 |
commit | 9dcc4c30f9d8ef70d3c07b4a77fdc507e8766107 (patch) | |
tree | ae6bb70dcf614bfbf032b5fe4ac4f712777cd0c3 /libavutil | |
parent | 9de7622927b1b0ec6f8045b17b3116f046f44b87 (diff) | |
parent | b36f87ff90d87687f574d51385f47bb98d14600a (diff) | |
download | ffmpeg-9dcc4c30f9d8ef70d3c07b4a77fdc507e8766107.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
configure: add support for bdver1 and bdver2 CPU types.
avio: make avio_close NULL the freed buffer
pixdesc: cosmetics
proresenc: Don't free a buffer not owned by the codec
proresenc: Write the full value in one put_bits call
adpcmenc: Calculate the IMA_QT predictor without overflow
x86: Add convenience macros to check for CPU extensions and flags
x86: h264dsp: drop some unnecessary ifdefs around prototype declarations
mss12: merge decode_pixel() and decode_top_left_pixel()
mss12: reduce SliceContext size from 1067 to 164 KB
mss12: move SliceContexts out of the common context into the codec contexts
Conflicts:
libavformat/aviobuf.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/pixdesc.c | 18 | ||||
-rw-r--r-- | libavutil/x86/cpu.h | 57 |
2 files changed, 69 insertions, 6 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 9e5a89b5c2..d64d300ea7 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -26,8 +26,10 @@ #include "intreadwrite.h" -void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], - const AVPixFmtDescriptor *desc, int x, int y, int c, int w, +void av_read_image_line(uint16_t *dst, + const uint8_t *data[4], const int linesize[4], + const AVPixFmtDescriptor *desc, + int x, int y, int c, int w, int read_pal_component) { AVComponentDescriptor comp = desc->comp[c]; @@ -53,7 +55,8 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesiz *dst++ = val; } } else { - const uint8_t *p = data[plane] + y * linesize[plane] + x * step + comp.offset_plus1 - 1; + const uint8_t *p = data[plane] + y * linesize[plane] + + x * step + comp.offset_plus1 - 1; int is_8bit = shift + depth <= 8; if (is_8bit) @@ -71,8 +74,10 @@ void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesiz } } -void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], - const AVPixFmtDescriptor *desc, int x, int y, int c, int w) +void av_write_image_line(const uint16_t *src, + uint8_t *data[4], const int linesize[4], + const AVPixFmtDescriptor *desc, + int x, int y, int c, int w) { AVComponentDescriptor comp = desc->comp[c]; int plane = comp.plane; @@ -93,7 +98,8 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi } } else { int shift = comp.shift; - uint8_t *p = data[plane] + y * linesize[plane] + x * step + comp.offset_plus1 - 1; + uint8_t *p = data[plane] + y * linesize[plane] + + x * step + comp.offset_plus1 - 1; if (shift + depth <= 8) { p += !!(flags & PIX_FMT_BE); diff --git a/libavutil/x86/cpu.h b/libavutil/x86/cpu.h new file mode 100644 index 0000000000..76abeb90b1 --- /dev/null +++ b/libavutil/x86/cpu.h @@ -0,0 +1,57 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_X86_CPU_H +#define AVUTIL_X86_CPU_H + +#include "config.h" +#include "libavutil/cpu.h" + +#define CPUEXT(flags, suffix, cpuext) \ + (HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext)) + +#define AV_CPU_FLAG_AMD3DNOW AV_CPU_FLAG_3DNOW +#define AV_CPU_FLAG_AMD3DNOWEXT AV_CPU_FLAG_3DNOWEXT + +#define EXTERNAL_AMD3DNOW(flags) CPUEXT(flags, _EXTERNAL, AMD3DNOW) +#define EXTERNAL_AMD3DNOWEXT(flags) CPUEXT(flags, _EXTERNAL, AMD3DNOWEXT) +#define EXTERNAL_MMX(flags) CPUEXT(flags, _EXTERNAL, MMX) +#define EXTERNAL_MMXEXT(flags) CPUEXT(flags, _EXTERNAL, MMXEXT) +#define EXTERNAL_SSE(flags) CPUEXT(flags, _EXTERNAL, SSE) +#define EXTERNAL_SSE2(flags) CPUEXT(flags, _EXTERNAL, SSE2) +#define EXTERNAL_SSE3(flags) CPUEXT(flags, _EXTERNAL, SSE3) +#define EXTERNAL_SSSE3(flags) CPUEXT(flags, _EXTERNAL, SSSE3) +#define EXTERNAL_SSE4(flags) CPUEXT(flags, _EXTERNAL, SSE4) +#define EXTERNAL_SSE42(flags) CPUEXT(flags, _EXTERNAL, SSE42) +#define EXTERNAL_AVX(flags) CPUEXT(flags, _EXTERNAL, AVX) +#define EXTERNAL_FMA4(flags) CPUEXT(flags, _EXTERNAL, FMA4) + +#define INLINE_AMD3DNOW(flags) CPUEXT(flags, _INLINE, AMD3DNOW) +#define INLINE_AMD3DNOWEXT(flags) CPUEXT(flags, _INLINE, AMD3DNOWEXT) +#define INLINE_MMX(flags) CPUEXT(flags, _INLINE, MMX) +#define INLINE_MMXEXT(flags) CPUEXT(flags, _INLINE, MMXEXT) +#define INLINE_SSE(flags) CPUEXT(flags, _INLINE, SSE) +#define INLINE_SSE2(flags) CPUEXT(flags, _INLINE, SSE2) +#define INLINE_SSE3(flags) CPUEXT(flags, _INLINE, SSE3) +#define INLINE_SSSE3(flags) CPUEXT(flags, _INLINE, SSSE3) +#define INLINE_SSE4(flags) CPUEXT(flags, _INLINE, SSE4) +#define INLINE_SSE42(flags) CPUEXT(flags, _INLINE, SSE42) +#define INLINE_AVX(flags) CPUEXT(flags, _INLINE, AVX) +#define INLINE_FMA4(flags) CPUEXT(flags, _INLINE, FMA4) + +#endif /* AVUTIL_X86_CPU_H */ |