aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-14 20:12:47 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-14 20:17:24 +0200
commit7e944159c63c4d4504cf76f90bb668519c3109af (patch)
tree99c916277e5523ae607f50cdde69030513b70d39 /libavcodec
parent281bde27894f994d0982ab9283f15d6073ae352c (diff)
parent100c70b0481b889d522b4fc2aac5b948ddb05c70 (diff)
downloadffmpeg-7e944159c63c4d4504cf76f90bb668519c3109af.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits) vcr1: Add vcr1_ prefixes to all static functions with generic names. vcr1: Fix return type of common_init to match the function pointer signature. vcr1enc: Replace obsolete get_bit_count by put_bits_count/flush_put_bits. motion-test: remove disabled code gxfenc: remove disabled half-implemented MJPEG tag x86: use more standard construct for setting ASM functions in FFT code fate: westwood-aud: disable decoding fate: caf: disable decoding fate: film-cvid: drop pcm audio and rename test fate: d-cinema-demux: drop unnecessary flags fate: split off dpcm-interplay from interplay-mve tests fate: rename funcom-iss to adpcm-ima-iss fate: rename cryo-apc to adpcm-ima-apc fate: rename adpcm-psx-str-v3 to adpcm-xa fate: split off adpcm-ms-mono test from dxa-feeble fate: split off adpcm-ima-ws test from vqa-cc fate: add adpcm-ima-smjpeg test fate: split off adpcm-ima-amv from amv test fate: separate bmv audio and video tests fate: separate delphine-cin audio and video tests ... Conflicts: doc/platform.texi libavcodec/vcr1.c tests/fate/audio.mak tests/fate/demux.mak tests/fate/video.mak tests/ref/fate/ea-mad-pcm-planar tests/ref/fate/interplay-mve-16bit tests/ref/fate/interplay-mve-8bit tests/ref/fate/mtv tests/ref/fate/qtrle-1bit tests/ref/fate/qtrle-2bit tests/ref/fate/truemotion1-15 tests/ref/fate/truemotion1-24 tests/ref/fate/vqa-cc Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/motion-test.c4
-rw-r--r--libavcodec/vcr1.c36
-rw-r--r--libavcodec/x86/fft.c45
3 files changed, 43 insertions, 42 deletions
diff --git a/libavcodec/motion-test.c b/libavcodec/motion-test.c
index ce1a1b0631..f230094832 100644
--- a/libavcodec/motion-test.c
+++ b/libavcodec/motion-test.c
@@ -48,11 +48,7 @@ static void fill_random(uint8_t *tab, int size)
av_lfg_init(&prng, 1);
for(i=0;i<size;i++) {
-#if 1
tab[i] = av_lfg_get(&prng) % 256;
-#else
- tab[i] = i;
-#endif
}
}
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
index 13aded9122..a5e1bc6577 100644
--- a/libavcodec/vcr1.c
+++ b/libavcodec/vcr1.c
@@ -33,24 +33,26 @@ typedef struct VCR1Context {
int offset[4];
} VCR1Context;
-static av_cold void common_init(AVCodecContext *avctx)
+static av_cold int vcr1_common_init(AVCodecContext *avctx)
{
VCR1Context *const a = avctx->priv_data;
avctx->coded_frame = &a->picture;
avcodec_get_frame_defaults(&a->picture);
+
+ return 0;
}
-static av_cold int decode_init(AVCodecContext *avctx)
+static av_cold int vcr1_decode_init(AVCodecContext *avctx)
{
- common_init(avctx);
+ vcr1_common_init(avctx);
avctx->pix_fmt = PIX_FMT_YUV410P;
return 0;
}
-static av_cold int decode_end(AVCodecContext *avctx)
+static av_cold int vcr1_decode_end(AVCodecContext *avctx)
{
VCR1Context *s = avctx->priv_data;
@@ -60,8 +62,8 @@ static av_cold int decode_end(AVCodecContext *avctx)
return 0;
}
-static int decode_frame(AVCodecContext *avctx, void *data,
- int *data_size, AVPacket *avpkt)
+static int vcr1_decode_frame(AVCodecContext *avctx, void *data,
+ int *data_size, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
@@ -145,9 +147,9 @@ AVCodec ff_vcr1_decoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_VCR1,
.priv_data_size = sizeof(VCR1Context),
- .init = decode_init,
- .close = decode_end,
- .decode = decode_frame,
+ .init = vcr1_decode_init,
+ .close = vcr1_decode_end,
+ .decode = vcr1_decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"),
};
@@ -157,8 +159,11 @@ AVCodec ff_vcr1_decoder = {
#define CONFIG_VCR1_ENCODER 0
#if CONFIG_VCR1_ENCODER
-static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
- int buf_size, void *data)
+
+#include "put_bits.h"
+
+static int vcr1_encode_frame(AVCodecContext *avctx, unsigned char *buf,
+ int buf_size, void *data)
{
VCR1Context *const a = avctx->priv_data;
AVFrame *pict = data;
@@ -170,10 +175,9 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
p->key_frame = 1;
avpriv_align_put_bits(&a->pb);
- while (get_bit_count(&a->pb) & 31)
- put_bits(&a->pb, 8, 0);
+ flush_put_bits(&a->pb);
- size = get_bit_count(&a->pb) / 32;
+ size = put_bits_count(&a->pb) / 32;
return size * 4;
}
@@ -183,8 +187,8 @@ AVCodec ff_vcr1_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_VCR1,
.priv_data_size = sizeof(VCR1Context),
- .init = common_init,
- .encode = encode_frame,
+ .init = vcr1_common_init,
+ .encode = vcr1_encode_frame,
.long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"),
};
#endif /* CONFIG_VCR1_ENCODER */
diff --git a/libavcodec/x86/fft.c b/libavcodec/x86/fft.c
index 8544e322c4..7c21335834 100644
--- a/libavcodec/x86/fft.c
+++ b/libavcodec/x86/fft.c
@@ -25,30 +25,31 @@ av_cold void ff_fft_init_mmx(FFTContext *s)
{
#if HAVE_YASM
int has_vectors = av_get_cpu_flags();
- if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX && s->nbits >= 5) {
- /* AVX for SB */
- s->imdct_calc = ff_imdct_calc_sse;
- s->imdct_half = ff_imdct_half_avx;
- s->fft_permute = ff_fft_permute_sse;
- s->fft_calc = ff_fft_calc_avx;
- s->fft_permutation = FF_FFT_PERM_AVX;
- } else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) {
+ if (has_vectors & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) {
+ /* 3DNow! for K6-2/3 */
+ s->imdct_calc = ff_imdct_calc_3dn;
+ s->imdct_half = ff_imdct_half_3dn;
+ s->fft_calc = ff_fft_calc_3dn;
+ }
+ if (has_vectors & AV_CPU_FLAG_3DNOWEXT && HAVE_AMD3DNOWEXT) {
+ /* 3DNowEx for K7 */
+ s->imdct_calc = ff_imdct_calc_3dn2;
+ s->imdct_half = ff_imdct_half_3dn2;
+ s->fft_calc = ff_fft_calc_3dn2;
+ }
+ if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE) {
/* SSE for P3/P4/K8 */
s->imdct_calc = ff_imdct_calc_sse;
s->imdct_half = ff_imdct_half_sse;
s->fft_permute = ff_fft_permute_sse;
s->fft_calc = ff_fft_calc_sse;
s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
- } else if (has_vectors & AV_CPU_FLAG_3DNOWEXT && HAVE_AMD3DNOWEXT) {
- /* 3DNowEx for K7 */
- s->imdct_calc = ff_imdct_calc_3dn2;
- s->imdct_half = ff_imdct_half_3dn2;
- s->fft_calc = ff_fft_calc_3dn2;
- } else if (has_vectors & AV_CPU_FLAG_3DNOW && HAVE_AMD3DNOW) {
- /* 3DNow! for K6-2/3 */
- s->imdct_calc = ff_imdct_calc_3dn;
- s->imdct_half = ff_imdct_half_3dn;
- s->fft_calc = ff_fft_calc_3dn;
+ }
+ if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX && s->nbits >= 5) {
+ /* AVX for SB */
+ s->imdct_half = ff_imdct_half_avx;
+ s->fft_calc = ff_fft_calc_avx;
+ s->fft_permutation = FF_FFT_PERM_AVX;
}
#endif
}
@@ -58,12 +59,12 @@ av_cold void ff_dct_init_mmx(DCTContext *s)
{
#if HAVE_YASM
int has_vectors = av_get_cpu_flags();
+ if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
+ s->dct32 = ff_dct32_float_sse;
+ if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE)
+ s->dct32 = ff_dct32_float_sse2;
if (has_vectors & AV_CPU_FLAG_AVX && HAVE_AVX)
s->dct32 = ff_dct32_float_avx;
- else if (has_vectors & AV_CPU_FLAG_SSE2 && HAVE_SSE)
- s->dct32 = ff_dct32_float_sse2;
- else if (has_vectors & AV_CPU_FLAG_SSE && HAVE_SSE)
- s->dct32 = ff_dct32_float_sse;
#endif
}
#endif