diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-05 22:17:02 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-05 22:17:02 +0200 |
commit | b4780d03d04d402b490be21b01ec886565cabe29 (patch) | |
tree | 2c5605baa7b588cced8f79c2916eb724356d5c25 | |
parent | 69aeba1396d5a13e79cbc3cc9f49fd6896addb82 (diff) | |
parent | 2096857551660649dbe9a5aad7338b0872858575 (diff) | |
download | ffmpeg-b4780d03d04d402b490be21b01ec886565cabe29.tar.gz |
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | ffmpeg.c | 3 | ||||
-rw-r--r-- | libavcodec/dpx.c | 3 | ||||
-rw-r--r-- | libavcodec/x86/h264_idct.asm | 8 | ||||
-rw-r--r-- | libavfilter/audio.c | 4 | ||||
-rw-r--r-- | libavutil/rational.h | 11 |
5 files changed, 22 insertions, 7 deletions
@@ -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; diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 6ef2db2299..791e66af7b 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -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; diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm index da045f71e2..edd603b793 100644 --- a/libavcodec/x86/h264_idct.asm +++ b/libavcodec/x86/h264_idct.asm @@ -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 ] diff --git a/libavfilter/audio.c b/libavfilter/audio.c index f3eebbfdae..1a201e608b 100644 --- a/libavfilter/audio.c +++ b/libavfilter/audio.c @@ -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; diff --git a/libavutil/rational.h b/libavutil/rational.h index 8c2bdb5529..417e29e577 100644 --- a/libavutil/rational.h +++ b/libavutil/rational.h @@ -115,6 +115,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. * |