Commit 75f847aa authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  avplay: use libavresample for sample format conversion and channel mixing
  Fix compilation with YASM/NASM without AVX support.
  WMAL: do not output last frame again if nothing was decoded in current packet
  WMAL: do not start decoding if frame does not end in current packet
  adpcm-thp: fix invalid array indexing
  ppc: add const where needed in scalarproduct_int16_altivec()
  ppc: remove shift parameter from scalarproduct_int16_altivec()
  ppc: dsputil: do unaligned block accesses correctly
  dvenc: do not call dsputil functions with stride not a multiple of 16
  APIchanges: fill in some dates and commit hashes

Conflicts:
	doc/APIchanges
	ffplay.c
	libavcodec/adpcm.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents aab5a452 f1ffb01e
......@@ -2,14 +2,14 @@ Never assume the API of libav* to be stable unless at least 1 month has passed
since the last major version increase.
The last version increases were:
libavcodec: 2012-01-27
libavdevice: 2011-04-18
libavfilter: 2011-04-18
libavformat: 2012-01-27
libavresample: 2012-xx-xx
libpostproc: 2011-04-18
libswscale: 2011-06-20
libavutil: 2011-04-18
libavcodec: 2012-01-27
libavdevice: 2011-04-18
libavfilter: 2011-04-18
libavformat: 2012-01-27
libavresample: 2012-04-24
libpostproc: 2011-04-18
libswscale: 2011-06-20
libavutil: 2011-04-18
API changes, most recent first:
......@@ -23,13 +23,13 @@ API changes, most recent first:
2012-03-26 - a67d9cf - lavfi 2.66.100
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
2012-04-25 - xxxxxxx - lavu 51.29.0 - cpu.h
2012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h
Add av_parse_cpu_flags()
2012-xx-xx - xxxxxxx - lavr 0.0.0
2012-04-24 - c8af852 - lavr 0.0.0
Add libavresample audio conversion library
2012-xx-xx - xxxxxxx - lavu 51.28.0 - audio_fifo.h
2012-04-20 - 0c0d1bc - lavu 51.28.0 - audio_fifo.h
Add audio FIFO functions:
av_audio_fifo_free()
av_audio_fifo_alloc()
......@@ -41,10 +41,10 @@ API changes, most recent first:
av_audio_fifo_size()
av_audio_fifo_space()
2012-xx-xx - xxxxxxx - lavfi 2.16.0 - avfiltergraph.h
Add avfilter_graph_parse2()
2012-04-14 - lavfi 2.16.0 - avfiltergraph.h
d7bcc71 Add avfilter_graph_parse2().
2012-xx-xx - xxxxxxx - lavu 51.27.0 - samplefmt.h
2012-04-08 - 4d693b0 - lavu 51.27.0 - samplefmt.h
Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
2012-03-21 - b75c67d - lavu 51.43.100
......
......@@ -40,7 +40,6 @@
#include "libavformat/avformat.h"
#include "libavdevice/avdevice.h"
#include "libswscale/swscale.h"
#include "libavcodec/audioconvert.h"
#include "libavutil/opt.h"
#include "libavcodec/avfft.h"
#include "libswresample/swresample.h"
......@@ -2130,7 +2129,8 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
/* if no pts, then compute it */
pts = is->audio_clock;
*pts_ptr = pts;
is->audio_clock += (double)data_size / (dec->channels * dec->sample_rate * av_get_bytes_per_sample(dec->sample_fmt));
is->audio_clock += (double)data_size /
(dec->channels * dec->sample_rate * av_get_bytes_per_sample(dec->sample_fmt));
#ifdef DEBUG
{
static double last_clock;
......@@ -2373,9 +2373,9 @@ static void stream_component_close(VideoState *is, int stream_index)
SDL_CloseAudio();
packet_queue_end(&is->audioq);
av_free_packet(&is->audio_pkt);
if (is->swr_ctx)
swr_free(&is->swr_ctx);
av_free_packet(&is->audio_pkt);
av_freep(&is->audio_buf1);
is->audio_buf = NULL;
av_freep(&is->frame);
......
......@@ -1212,12 +1212,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int prev[2][2];
int ch;
for (i = 0; i < 32; i++)
table[0][i] = sign_extend(bytestream2_get_be16u(&gb), 16);
for (i = 0; i < 2; i++)
for (n = 0; n < 16; n++)
table[i][n] = sign_extend(bytestream2_get_be16u(&gb), 16);
/* Initialize the previous sample. */
for (i = 0; i < 4; i++)
prev[i>>1][i&1] = sign_extend(bytestream2_get_be16u(&gb), 16);
for (i = 0; i < 2; i++)
for (n = 0; n < 2; n++)
prev[i][n] = sign_extend(bytestream2_get_be16u(&gb), 16);
for (ch = 0; ch <= st; ch++) {
samples = (short *)c->frame.data[0] + ch;
......
......@@ -668,7 +668,7 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
int mb_x, mb_y, c_offset, linesize, y_stride;
uint8_t* y_ptr;
uint8_t* dif;
LOCAL_ALIGNED_8(uint8_t, scratch, [64]);
LOCAL_ALIGNED_8(uint8_t, scratch, [128]);
EncBlockInfo enc_blks[5*DV_MAX_BPM];
PutBitContext pbs[5*DV_MAX_BPM];
PutBitContext* pb;
......@@ -723,10 +723,10 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
b[0] = c_ptr[0]; b[1] = c_ptr[1]; b[2] = c_ptr[2]; b[3] = c_ptr[3];
b[4] = d[0]; b[5] = d[1]; b[6] = d[2]; b[7] = d[3];
c_ptr += linesize;
b += 8;
b += 16;
}
c_ptr = scratch;
linesize = 8;
linesize = 16;
}
vs_bit_size += dv_init_enc_block( enc_blk++, c_ptr , linesize, s, 1);
......
This diff is collapsed.
......@@ -79,28 +79,20 @@ static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2,
return u.score[3];
}
static int32_t scalarproduct_int16_altivec(int16_t *v1, const int16_t *v2,
int order, const int shift)
static int32_t scalarproduct_int16_altivec(const int16_t *v1, const int16_t *v2,
int order)
{
int i;
LOAD_ZERO;
register vec_s16 vec1, *pv;
const vec_s16 *pv;
register vec_s16 vec1;
register vec_s32 res = vec_splat_s32(0), t;
register vec_u32 shifts;
int32_t ires;
shifts = zero_u32v;
if(shift & 0x10) shifts = vec_add(shifts, vec_sl(vec_splat_u32(0x08), vec_splat_u32(0x1)));
if(shift & 0x08) shifts = vec_add(shifts, vec_splat_u32(0x08));
if(shift & 0x04) shifts = vec_add(shifts, vec_splat_u32(0x04));
if(shift & 0x02) shifts = vec_add(shifts, vec_splat_u32(0x02));
if(shift & 0x01) shifts = vec_add(shifts, vec_splat_u32(0x01));
for(i = 0; i < order; i += 8){
pv = (vec_s16*)v1;
pv = (const vec_s16*)v1;
vec1 = vec_perm(pv[0], pv[1], vec_lvsl(0, v1));
t = vec_msum(vec1, vec_ld(0, v2), zero_s32v);
t = vec_sr(t, shifts);
res = vec_sums(t, res);
v1 += 8;
v2 += 8;
......@@ -114,31 +106,31 @@ static int32_t scalarproduct_and_madd_int16_altivec(int16_t *v1, const int16_t *
{
LOAD_ZERO;
vec_s16 *pv1 = (vec_s16*)v1;
vec_s16 *pv2 = (vec_s16*)v2;
vec_s16 *pv3 = (vec_s16*)v3;
register vec_s16 muls = {mul,mul,mul,mul,mul,mul,mul,mul};
register vec_s16 t0, t1, i0, i1;
register vec_s16 i2 = pv2[0], i3 = pv3[0];
register vec_s16 t0, t1, i0, i1, i4;
register vec_s16 i2 = vec_ld(0, v2), i3 = vec_ld(0, v3);
register vec_s32 res = zero_s32v;
register vec_u8 align = vec_lvsl(0, v2);
int32_t ires;
order >>= 4;
do {
t0 = vec_perm(i2, pv2[1], align);
i2 = pv2[2];
t1 = vec_perm(pv2[1], i2, align);
i1 = vec_ld(16, v2);
t0 = vec_perm(i2, i1, align);
i2 = vec_ld(32, v2);
t1 = vec_perm(i1, i2, align);
i0 = pv1[0];
i1 = pv1[1];
res = vec_msum(t0, i0, res);
res = vec_msum(t1, i1, res);
t0 = vec_perm(i3, pv3[1], align);
i3 = pv3[2];
t1 = vec_perm(pv3[1], i3, align);
i4 = vec_ld(16, v3);
t0 = vec_perm(i3, i4, align);
i3 = vec_ld(32, v3);
t1 = vec_perm(i4, i3, align);
pv1[0] = vec_mladd(t0, muls, i0);
pv1[1] = vec_mladd(t1, muls, i1);
pv1 += 2;
pv2 += 2;
pv3 += 2;
v2 += 8;
v3 += 8;
} while(--order);
res = vec_splat(vec_sums(res, zero_s32v), 3);
vec_ste(res, 0, &ires);
......
......@@ -1216,8 +1216,8 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
save_bits(s, gb, num_bits_prev_frame, 1);
/* decode the cross packet frame if it is valid */
if (!s->packet_loss)
decode_frame(s);
if (num_bits_prev_frame < remaining_packet_bits && !s->packet_loss)
decode_frame(s);
} else if (s->num_saved_bits - s->frame_offset) {
av_dlog(avctx, "ignoring %x previously saved bits\n",
s->num_saved_bits - s->frame_offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment