Commit b4780d03 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  x86: h264_idct: Rename x264_add8x4_idct_sse2 --> h264_add8x4_idct_sse2
  rational: add av_inv_q() returning the inverse of an AVRational
  dpx: Make start offset unsigned
  lavfi: properly signal out-of-memory error in ff_filter_samples
  cosmetics: Fix a few switched periods and linebreaks
  zerocodec: Fix memleak in decode_frame
  zerocodec: Cosmetics

Conflicts:
	ffmpeg.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 69aeba13 20968575
......@@ -1172,8 +1172,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilterContext *first_filter = in->filter_ctx;
AVFilter *filter = avfilter_get_by_name("buffer");
InputStream *ist = ifilter->ist;
AVRational tb = ist->framerate.num ? (AVRational){ist->framerate.den,
ist->framerate.num} :
AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
ist->st->time_base;
AVRational fr = ist->framerate.num ? ist->framerate :
ist->st->r_frame_rate;
......
......@@ -62,7 +62,8 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame *const p = &s->picture;
uint8_t *ptr;
int magic_num, offset, endian;
unsigned int offset;
int magic_num, endian;
int x, y;
int w, h, stride, bits_per_color, descriptor, elements, target_packet_size, source_packet_size;
......
......@@ -704,7 +704,7 @@ h264_idct_dc_add8_mmx2:
ALIGN 16
INIT_XMM
; r0 = uint8_t *dst (clobbered), r2 = int16_t *block, r3 = int stride
x264_add8x4_idct_sse2:
h264_add8x4_idct_sse2:
movq m0, [r2+ 0]
movq m1, [r2+ 8]
movq m2, [r2+16]
......@@ -733,7 +733,7 @@ x264_add8x4_idct_sse2:
%else
add r0, r0m
%endif
call x264_add8x4_idct_sse2
call h264_add8x4_idct_sse2
.cycle%1end
%if %1 < 7
add r2, 64
......@@ -768,7 +768,7 @@ cglobal h264_idct_add16_8_sse2, 5, 5 + ARCH_X86_64, 8
%else
add r0, r0m
%endif
call x264_add8x4_idct_sse2
call h264_add8x4_idct_sse2
jmp .cycle%1end
.try%1dc
movsx r0, word [r2 ]
......@@ -815,7 +815,7 @@ cglobal h264_idct_add16intra_8_sse2, 5, 7 + ARCH_X86_64, 8
mov r0, [r0]
add r0, dword [r1+(%1&1)*8+64*(1+(%1>>1))]
%endif
call x264_add8x4_idct_sse2
call h264_add8x4_idct_sse2
jmp .cycle%1end
.try%1dc
movsx r0, word [r2 ]
......
......@@ -178,6 +178,10 @@ int ff_filter_samples_framed(AVFilterLink *link, AVFilterBufferRef *samplesref)
buf_out = ff_default_get_audio_buffer(link, dst->min_perms,
samplesref->audio->nb_samples);
if (!buf_out) {
avfilter_unref_buffer(samplesref);
return AVERROR(ENOMEM);
}
buf_out->pts = samplesref->pts;
buf_out->audio->sample_rate = samplesref->audio->sample_rate;
......
......@@ -114,6 +114,17 @@ AVRational av_add_q(AVRational b, AVRational c) av_const;
*/
AVRational av_sub_q(AVRational b, AVRational c) av_const;
/**
* Invert a rational.
* @param q value
* @return 1 / q
*/
static av_always_inline AVRational av_inv_q(AVRational q)
{
AVRational r = { q.den, q.num };
return r;
}
/**
* Convert a double precision floating point number to a rational.
* inf is expressed as {1,0} or {-1,0} depending on the sign.
......
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