[FFmpeg-cvslog] doc/scaler: mention default scaling algorithm
ffmpeg | branch: master | Lou Logan | Thu Dec 22 15:27:49 2016 -0900| [890320b1c084e69456ebeaec66dd471671a40d09] | committer: Lou Logan doc/scaler: mention default scaling algorithm Default is "bicubic". Signed-off-by: Lou Logan Reviewed-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=890320b1c084e69456ebeaec66dd471671a40d09 --- doc/scaler.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/scaler.texi b/doc/scaler.texi index 3e115cd..f73804a 100644 --- a/doc/scaler.texi +++ b/doc/scaler.texi @@ -13,7 +13,8 @@ FFmpeg tools. For programmatic use, they can be set explicitly in the @anchor{sws_flags} @item sws_flags Set the scaler flags. This is also used to set the scaling -algorithm. Only a single algorithm should be selected. +algorithm. Only a single algorithm should be selected. Default +value is @samp{bicubic}. It accepts the following values: @table @samp ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/qdm2: make use of bytestream2
ffmpeg | branch: master | Paul B Mahol | Sun Jan 8 19:59:06 2017 +0100| [24d31a80746cc1d5a66c707150881985c3d134c9] | committer: Paul B Mahol avcodec/qdm2: make use of bytestream2 Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24d31a80746cc1d5a66c707150881985c3d134c9 --- libavcodec/qdm2.c | 66 ++- 1 file changed, 21 insertions(+), 45 deletions(-) diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index e3cc902..88b6b19 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -40,6 +40,7 @@ #define BITSTREAM_READER_LE #include "avcodec.h" #include "get_bits.h" +#include "bytestream.h" #include "internal.h" #include "mpegaudio.h" #include "mpegaudiodsp.h" @@ -1605,9 +1606,8 @@ static av_cold void qdm2_init_static_data(void) { static av_cold int qdm2_decode_init(AVCodecContext *avctx) { QDM2Context *s = avctx->priv_data; -uint8_t *extradata; -int extradata_size; int tmp_val, tmp, size; +GetByteContext gb; qdm2_init_static_data(); @@ -1650,55 +1650,39 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } -extradata = avctx->extradata; -extradata_size = avctx->extradata_size; +bytestream2_init(&gb, avctx->extradata, avctx->extradata_size); -while (extradata_size > 7) { -if (!memcmp(extradata, "frmaQDM", 7)) +while (bytestream2_get_bytes_left(&gb) > 8) { +if (bytestream2_peek_be64(&gb) == (((uint64_t)MKBETAG('f','r','m','a') << 32) | + (uint64_t)MKBETAG('Q','D','M','2'))) break; -extradata++; -extradata_size--; +bytestream2_skip(&gb, 1); } -if (extradata_size < 12) { +if (bytestream2_get_bytes_left(&gb) < 12) { av_log(avctx, AV_LOG_ERROR, "not enough extradata (%i)\n", - extradata_size); + bytestream2_get_bytes_left(&gb)); return AVERROR_INVALIDDATA; } -if (memcmp(extradata, "frmaQDM", 7)) { -av_log(avctx, AV_LOG_ERROR, "invalid headers, QDM? not found\n"); -return AVERROR_INVALIDDATA; -} - -if (extradata[7] == 'C') { -//s->is_qdmc = 1; -avpriv_report_missing_feature(avctx, "QDMC version 1"); -return AVERROR_PATCHWELCOME; -} - -extradata += 8; -extradata_size -= 8; +bytestream2_skip(&gb, 8); +size = bytestream2_get_be32(&gb); -size = AV_RB32(extradata); - -if(size > extradata_size){ +if (size > bytestream2_get_bytes_left(&gb)) { av_log(avctx, AV_LOG_ERROR, "extradata size too small, %i < %i\n", - extradata_size, size); + bytestream2_get_bytes_left(&gb), size); return AVERROR_INVALIDDATA; } -extradata += 4; av_log(avctx, AV_LOG_DEBUG, "size: %d\n", size); -if (AV_RB32(extradata) != MKBETAG('Q','D','C','A')) { +if (bytestream2_get_be32(&gb) != MKBETAG('Q','D','C','A')) { av_log(avctx, AV_LOG_ERROR, "invalid extradata, expecting QDCA\n"); return AVERROR_INVALIDDATA; } -extradata += 8; +bytestream2_skip(&gb, 4); -avctx->channels = s->nb_channels = s->channels = AV_RB32(extradata); -extradata += 4; +avctx->channels = s->nb_channels = s->channels = bytestream2_get_be32(&gb); if (s->channels <= 0 || s->channels > MPA_MAX_CHANNELS) { av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n"); return AVERROR_INVALIDDATA; @@ -1706,19 +1690,11 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx) avctx->channel_layout = avctx->channels == 2 ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO; -avctx->sample_rate = AV_RB32(extradata); -extradata += 4; - -avctx->bit_rate = AV_RB32(extradata); -extradata += 4; - -s->group_size = AV_RB32(extradata); -extradata += 4; - -s->fft_size = AV_RB32(extradata); -extradata += 4; - -s->checksum_size = AV_RB32(extradata); +avctx->sample_rate = bytestream2_get_be32(&gb); +avctx->bit_rate = bytestream2_get_be32(&gb); +s->group_size = bytestream2_get_be32(&gb); +s->fft_size = bytestream2_get_be32(&gb); +s->checksum_size = bytestream2_get_be32(&gb); if (s->checksum_size >= 1U << 28) { av_log(avctx, AV_LOG_ERROR, "data block size too large (%u)\n", s->checksum_size); return AVERROR_INVALIDDATA; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/af_sofalizer: speed and clean up fast convolution a little
ffmpeg | branch: master | Paul B Mahol | Mon Jan 9 18:15:03 2017 +0100| [7aef56864c968a0e059b8f6ce0cb6af5de2413b8] | committer: Paul B Mahol avfilter/af_sofalizer: speed and clean up fast convolution a little Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7aef56864c968a0e059b8f6ce0cb6af5de2413b8 --- libavfilter/af_sofalizer.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libavfilter/af_sofalizer.c b/libavfilter/af_sofalizer.c index 400b3c7..5f0ab31 100644 --- a/libavfilter/af_sofalizer.c +++ b/libavfilter/af_sofalizer.c @@ -703,6 +703,8 @@ static int sofalizer_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr, FFTContext *fft = s->fft[jobnr]; const int n_conv = s->n_conv; const int n_fft = s->n_fft; +const float fft_scale = 1.0f / s->n_fft; +FFTComplex *hrtf_offset; int wr = *write; int n_read; int i, j; @@ -736,6 +738,7 @@ static int sofalizer_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr, /* outer loop: go through all input channels to be convolved */ offset = i * n_fft; /* no. samples already processed */ +hrtf_offset = hrtf + offset; /* fill FFT input with 0 (we want to zero-pad) */ memset(fft_in, 0, sizeof(FFTComplex) * n_fft); @@ -750,14 +753,15 @@ static int sofalizer_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr, av_fft_permute(fft, fft_in); av_fft_calc(fft, fft_in); for (j = 0; j < n_fft; j++) { +const FFTComplex *hcomplex = hrtf_offset + j; const float re = fft_in[j].re; const float im = fft_in[j].im; /* complex multiplication of input signal and HRTFs */ /* output channel (real): */ -fft_in[j].re = re * (hrtf + offset + j)->re - im * (hrtf + offset + j)->im; +fft_in[j].re = re * hcomplex->re - im * hcomplex->im; /* output channel (imag): */ -fft_in[j].im = re * (hrtf + offset + j)->im + im * (hrtf + offset + j)->re; +fft_in[j].im = re * hcomplex->im + im * hcomplex->re; } /* transform output signal of current channel back to time domain */ @@ -766,14 +770,14 @@ static int sofalizer_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr, for (j = 0; j < in->nb_samples; j++) { /* write output signal of current channel to output buffer */ -dst[2 * j] += fft_in[j].re / (float)n_fft; +dst[2 * j] += fft_in[j].re * fft_scale; } for (j = 0; j < n_samples - 1; j++) { /* overflow length is IR length - 1 */ /* write the rest of output signal to overflow buffer */ int write_pos = (wr + j) & modulo; -*(ringbuffer + write_pos) += fft_in[in->nb_samples + j].re / (float)n_fft; +*(ringbuffer + write_pos) += fft_in[in->nb_samples + j].re * fft_scale; } } @@ -781,7 +785,7 @@ static int sofalizer_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr, for (i = 0; i < out->nb_samples; i++) { /* clippings counter */ if (fabs(*dst) > 1) { /* if current output sample > 1 */ -*n_clippings = *n_clippings + 1; +n_clippings[0]++; } /* move output buffer pointer by +2 to get to next sample of processed channel: */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] x86inc: Avoid using eax/rax for storing the stack pointer
ffmpeg | branch: master | Henrik Gramner | Tue Dec 20 21:33:12 2016 +0100| [cd09e3b34903db7b7e37fdb4d3e10549bf8b2e82] | committer: Henrik Gramner x86inc: Avoid using eax/rax for storing the stack pointer When allocating stack space with an alignment requirement that is larger than the current stack alignment we need to store a copy of the original stack pointer in order to be able to restore it later. If we chose to use another register for this purpose we should not pick eax/rax since it can be overwritten as a return value. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd09e3b34903db7b7e37fdb4d3e10549bf8b2e82 --- libavutil/x86/x86inc.asm | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index b2e9c60..128ddc1 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -385,7 +385,14 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14 %ifnum %1 %if %1 != 0 && required_stack_alignment > STACK_ALIGNMENT %if %1 > 0 +; Reserve an additional register for storing the original stack pointer, but avoid using +; eax/rax for this purpose since it can potentially get overwritten as a return value. %assign regs_used (regs_used + 1) +%if ARCH_X86_64 && regs_used == 7 +%assign regs_used 8 +%elif ARCH_X86_64 == 0 && regs_used == 1 +%assign regs_used 2 +%endif %endif %if ARCH_X86_64 && regs_used < 5 + UNIX64 * 3 ; Ensure that we don't clobber any registers containing arguments. For UNIX64 we also preserve r6 (rax) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog