1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-08-20 16:25:04 +02:00
Commit Graph

71 Commits

Author SHA1 Message Date
Rostislav Pehlivanov
7591f8319b lpc: increase error array size of ff_lpc_calc_ref_coefs_f by one
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-05 08:51:19 +01:00
Rostislav Pehlivanov
0fc3a51353 lpc: add ff_lpc_calc_ref_coefs_f() function
This commit adds a function to get the reflection coefficients on
floating point samples. It's functionally identical to
ff_lpc_calc_ref_coefs() except it works on float samples and will
return the global prediction gain. The Welch window implementation
which is more optimized works only on int32_t samples so a slower
generic expression was used.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-01 06:34:50 +01:00
Rostislav Pehlivanov
a70ee2bdcd lpc: remove unused ff_lpc_calc_levinson() function
Not needed anymore, it was only used by the AAC TNS
encoder and was replaced with a more suitable function
in the following commit.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-01 06:32:35 +01:00
Rostislav Pehlivanov
141d80ded7 lpc: rename ff_lpc_calc_levinsion to ff_lpc_calc_levinson
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-08-29 19:29:18 +01:00
Rostislav Pehlivanov
20962b567b lpc: create a simplified Levinson-Durbin LPC handling float samples
This commit simply duplicates the functionality of ff_lpc_calc_coefs()
for the case of a Levinson-Durbin LPC with the only difference being
that floating point samples are accepted and the resulting coefficients
are raw and unquantized.
The motivation behind doing this is the fact that the AAC encoder
requires LPC in TNS and LTP and converting non-normalized floating
point coefficients to int32_t using SWR and again back for the LPC
coefficients was very impractical.
The current LPC interfaces were designed for int32_t in mind possibly
because FLAC and ALAC use this type for most internal operations.
The mathematics in case of floats remains of course identical.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-08-29 06:14:13 +01:00
Michael Niedermayer
a3a61d4663 avcodec/lpc: Fix lpc_apply_welch_window_c() for odd len
Also removes assert
this fixes an assertion failure on non-x86

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-06 19:11:42 +02:00
Reimar Döffinger
458aadf862 lpc: Reduce stack usage by allocating LLSModel in context.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-11-23 06:51:18 +01:00
Michael Niedermayer
d4065a9f47 Merge commit '60e0ee7ca25bd3bea54043b0607efe4cd51acaf3'
* commit '60e0ee7ca25bd3bea54043b0607efe4cd51acaf3':
  lpc: always initialize ref and err

The initialization is not needed, its merged anyway as it might
help suppressing warnings and might make the code more robust against
future changes

See: c4a36b6f70
See: 0dd99628ea
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-15 02:05:25 +01:00
Vittorio Giovara
60e0ee7ca2 lpc: always initialize ref and err
CC: libav-stable@libav.org
Bug-Id: CID 29585 / CID 700759
2014-11-14 20:25:52 +01:00
Michael Niedermayer
70b8668fb5 drop LLS1, rename LLS2 to LLS
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-09 23:20:31 +02:00
Michael Niedermayer
c3814ab654 rename new lls code to lls2 to avoid conflict with the old which has a different ABI
also remove failed attempt at a compatibility layer, the code simply cannot work

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-17 16:41:08 +01:00
Michael Niedermayer
bbe66ef912 avutil: rename lls to lls2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-17 16:30:23 +01:00
Michael Niedermayer
0dd99628ea ff_lpc_calc_coefs: assert that the type is levinson or cholesky
Otherwise the code could misbehave (and there are no other types anyway)
Fixes CID700759

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-09 11:57:45 +02:00
Loren Merritt
1221bb6239 x86: lpc: fix a segfault in av_evaluate_lls_sse2() 2013-06-30 23:11:19 +00:00
Michael Niedermayer
e27be795f0 avcodec/lpc: Use a function pointer from an initialized context
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 12:40:16 +02:00
Michael Niedermayer
32a3955259 Merge commit 'c93ccf5a4cca722b39f05e9f5660b4cb75bc1740'
* commit 'c93ccf5a4cca722b39f05e9f5660b4cb75bc1740':
  lpc: use levinson for the first pass of multipass cholesky

Conflicts:
	libavcodec/lpc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 12:26:58 +02:00
Michael Niedermayer
78b5479633 Merge commit '502ab21af0ca68f76d6112722c46d2f35c004053'
* commit '502ab21af0ca68f76d6112722c46d2f35c004053':
  x86: lpc: simd av_update_lls

The versions are bumped due to changes in lls.h which is used across
libraries affecting intra library ABI
(This version bump also covers changes to lls.h in the immedeatly previous
 commits)

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 11:35:52 +02:00
Michael Niedermayer
c93a424718 Merge commit '41578f70cf8aec8e7565fba1ca7e07f3dc46c3d2'
* commit '41578f70cf8aec8e7565fba1ca7e07f3dc46c3d2':
  lpc: use function pointers, in preparation for asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 11:23:43 +02:00
Michael Niedermayer
d3bd320e63 Merge commit 'cc6714bb16b1f0716ba43701d47273dbe9657b8b'
* commit 'cc6714bb16b1f0716ba43701d47273dbe9657b8b':
  lpc: remove "decay" argument

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 10:54:20 +02:00
Loren Merritt
c93ccf5a4c lpc: use levinson for the first pass of multipass cholesky
Levinson is faster, and cholesky is only needed if we want to apply different
weights to different samples, which doesn't happen on the first pass.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-29 13:26:52 +02:00
Loren Merritt
502ab21af0 x86: lpc: simd av_update_lls
4x-6x faster on sandybridge

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-29 13:23:57 +02:00
Loren Merritt
41578f70cf lpc: use function pointers, in preparation for asm
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-29 13:23:57 +02:00
Loren Merritt
cc6714bb16 lpc: remove "decay" argument
We never used the rolling-average mode, and this makes av_update_lls 15% faster.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-06-29 13:23:57 +02:00
Michael Niedermayer
76f8d3c8d9 Merge commit '9d4da474f5f40b019cb4cb931c8499deee586174'
* commit '9d4da474f5f40b019cb4cb931c8499deee586174':
  lls: move to the private namespace

Conflicts:
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-01 13:19:00 +01:00
Luca Barbato
9d4da474f5 lls: move to the private namespace
The functions are private.
2013-02-28 17:39:24 +01:00
Michael Niedermayer
e79c3858b3 Merge commit '14f031d7ecfabba0ef02776d4516aa3dcb7c40d8'
* commit '14f031d7ecfabba0ef02776d4516aa3dcb7c40d8':
  dv: use AVStream.index instead of abusing AVStream.id
  lavfi: add ashowinfo filter
  avcodec: Add a RFC 3389 comfort noise codec
  lpc: Add a function for calculating reflection coefficients from samples
  lpc: Add a function for calculating reflection coefficients from autocorrelation coefficients
  lavr: document upper bound on number of output samples.
  lavr: add general API usage doxy
  indeo3: remove duplicate capabilities line.
  fate: ac3: Add dependencies

Conflicts:
	Changelog
	doc/filters.texi
	libavcodec/Makefile
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/codec_desc.c
	libavcodec/version.h
	libavfilter/Makefile
	libavfilter/af_ashowinfo.c
	libavfilter/allfilters.c
	libavfilter/version.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-30 14:40:22 +01:00
Martin Storsjö
8b25a20efb lpc: Add a function for calculating reflection coefficients from samples
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-29 21:53:16 +02:00
Michael Niedermayer
c4a36b6f70 lpc: check that lpc_type is valid in ff_lpc_calc_coefs
Fixes CID700759
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-28 03:27:16 +01:00
Michael Niedermayer
52dc18d414 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  x86: vc1: call ff_vc1dsp_init_x86() under if (ARCH_X86)
  x86: cavs: call ff_cavsdsp_init_x86() under if (ARCH_X86)
  x86: call most of the x86 dsp init functions under if (ARCH_X86)
  doc: support the new website layout
  doc: remove a warning from filters.texi
  doc: initial nut documentation
  segment: drop global headers setting
  lavu: fix typo in Makefile

Conflicts:
	doc/Makefile
	doc/filters.texi
	doc/t2h.init
	libavcodec/fmtconvert.c
	libavcodec/proresdsp.c
	libavcodec/x86/Makefile
	libavcodec/x86/vc1dsp_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-08 21:46:34 +02:00
Janne Grunau
f101eab1be x86: call most of the x86 dsp init functions under if (ARCH_X86)
Rename the called dsp init functions to *_init_x86.
2012-10-08 11:54:05 +02:00
Michael Niedermayer
104f42e694 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  doc/APIchanges: add an entry for codec descriptors.
  vorbisenc: set AVCodecContext.bit_rate to 0
  vorbisenc: fix quality parameter
  FATE: add ALAC encoding tests
  lpc: fix alignment of windowed samples for odd maximum LPC order
  alacenc: use s16p sample format as input
  alacenc: remove unneeded sample_fmt check
  alacenc: fix max_frame_size calculation for the final frame
  adpcm_swf: Use correct sample offsets when using trellis.
  rtmp: support strict rtmp servers
  mjpegdec: support AVRn interlaced
  x86: remove FASTDIV inline asm

Conflicts:
	doc/APIchanges
	libavcodec/mjpegdec.c
	libavcodec/vorbisenc.c
	libavutil/x86/intmath.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-23 14:33:33 +02:00
Justin Ruggles
4b0e0f31bf lpc: fix alignment of windowed samples for odd maximum LPC order
Fixes crash on x86 due to alignment requirements for w_data in
lpc_apply_welch_window_sse2().
2012-08-22 16:41:50 -04:00
Michael Niedermayer
c581cb4e4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix even more missing includes after the common.h removal
  build: Factor out rangecoder dependencies to CONFIG_RANGECODER
  build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
  x86: avcodec: Consistently name all init files
  Add more missing includes after removing the implicit common.h
  Add some more missing includes after removing the implicit common.h
  Don't include common.h from avutil.h
  rtmp: Automatically compute the hash for SWFVerification

Conflicts:
	configure
	doc/APIchanges
	doc/examples/decoding_encoding.c
	libavcodec/Makefile
	libavcodec/assdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/avpacket.c
	libavcodec/dv_profile.c
	libavcodec/dwt.c
	libavcodec/libtheoraenc.c
	libavcodec/rawdec.c
	libavcodec/rv40dsp.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/v210dec.h
	libavcodec/vc1dsp.c
	libavcodec/x86/Makefile
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/buffer.c
	libavfilter/formats.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_select.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/version.h
	libavutil/audioconvert.c
	libavutil/error.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-16 16:20:30 +02:00
Martin Storsjö
1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
Michael Niedermayer
894319e010 lpc: use default number of passes when lpc_passes is invalid
Should fix valgrind failure (uninitialized vars)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-06 04:04:10 +02:00
Michael Niedermayer
b1a17953ec lpc: use av_assert
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-28 00:07:10 +02:00
Michael Niedermayer
b479e01612 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Revert "v210enc: use FFALIGN()"
  doxygen: Do not include license boilerplates in Doxygen comment blocks.
  avplay: reset decoder flush state when seeking
  ape: skip packets with invalid size
  ape: calculate final packet size instead of guessing
  ape: stop reading after the last frame has been read
  ape: return AVERROR_EOF instead of AVERROR(EIO) when demuxing is finished
  ape: return error if seeking to the current packet fails in ape_read_packet()
  avcodec: Clarify AVFrame member documentation.
  v210dec: check for coded_frame allocation failure
  v210enc: use stride as it is already calculated
  v210enc: use FFALIGN()
  v210enc: return proper AVERROR codes instead of -1
  v210enc: do not set coded_frame->key_frame
  v210enc: check for coded_frame allocation failure
  drawtext: add 'fix_bounds' option on coords fixing
  drawtext: fix text_{w, h} expression vars
  drawtext: add missing braces around an if() block.

Conflicts:
	libavcodec/arm/vp8.h
	libavcodec/arm/vp8dsp_init_arm.c
	libavcodec/v210dec.c
	libavfilter/vf_drawtext.c
	libavformat/ape.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-07 01:40:29 +01:00
Diego Biurrun
32f3c541bc doxygen: Do not include license boilerplates in Doxygen comment blocks. 2012-02-06 19:39:24 +01:00
Michael Niedermayer
52c522c720 Merge remote-tracking branch 'qatar/master'
* qatar/master: (27 commits)
  asfdec: add side data to ASFStream packet instead of output packet.
  idroqdec: set AVFMTCTX_NOHEADER and create streams as they occur.
  nellymoserdec: Indicate that the decoder can handle changed parameters
  libavcodec: Apply parameter change side data when decoding audio
  flvdec: Add param change side data if the sample rate or channels have changed
  libavformat: Add a utility function for adding parameter change side data
  libavcodec: Define a side data type for parameter changes
  aacdec: Handle new extradata passed as side data
  flvdec: Export new AAC/H.264 extradata as side data on the next packet
  libavcodec: Define a side data type for new extradata
  flacdec: skip all track indices at once instead of looping.
  mxf: Add PictureEssenceCoding UL for V210.
  mxfdec: consider QuantizationBits between 17 and 24 to be pcm_s24*
  mxfenc: Add support for MPEG-2 MP@HL-14 in mxf container.
  mxf: H.264/MPEG-4 AVC Intra support
  configure: Show whether the safe bitstream reader is enabled
  x86: Tighten register constraints for decode_significance*_x86.
  Replace Subversion revisions in comments by Git hashes.
  h264_cabac: synchronize decode_significance_*_x86 conditionals
  w32threads: wait for the waked thread in pthread_cond_signal.
  ...

Conflicts:
	libavcodec/avcodec.h
	libavcodec/version.h
	libavformat/flvdec.c
	libavformat/utils.c
	tests/ref/lavfi/pixdesc
	tests/ref/lavfi/pixfmts_copy
	tests/ref/lavfi/pixfmts_null
	tests/ref/lavfi/pixfmts_scale
	tests/ref/lavfi/pixfmts_vflip

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-22 01:51:53 +01:00
Diego Biurrun
c18365402b Replace Subversion revisions in comments by Git hashes. 2011-12-21 09:04:25 +01:00
Michael Niedermayer
5dc6bd86f0 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  APIchanges: fill in missing hashes and dates.
  Add an APIChanges entry and bump minor versions for recent changes.
  ffmpeg: print the low bitrate warning after the codec is openend.
  doxygen: Move function documentation into the macro generating the function.
  doxygen: Make sure parameter names match between .c and .h files.
  h264: move fill_decode_neighbors()/fill_decode_caches() to h264_mvpred.h
  H.264: Add more x86 assembly for 10-bit H.264 predict functions
  lavf: fix invalid reads in avformat_find_stream_info()
  cmdutils: replace opt_default with opt_default2() and remove set_context_opts
  ffmpeg: use new avcodec_open2 and avformat_find_stream_info API.
  ffplay: use new avcodec_open2 and avformat_find_stream_info API.
  cmdutils: store all codec options in one dict instead of video/audio/sub
  ffmpeg: check experimental flag after codec is opened.
  ffmpeg: do not set GLOBAL_HEADER flag in the options context

Conflicts:
	cmdutils.c
	doc/APIchanges
	ffmpeg.c
	ffplay.c
	libavcodec/version.h
	libavformat/version.h
	libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-14 20:44:58 +02:00
Diego Biurrun
96c1e6d40d doxygen: Make sure parameter names match between .c and .h files. 2011-07-14 04:09:49 +02:00
Michael Niedermayer
976a8b2179 Merge remote-tracking branch 'qatar/master'
* qatar/master: (40 commits)
  H.264: template left MB handling
  H.264: faster fill_decode_caches
  H.264: faster write_back_*
  H.264: faster fill_filter_caches
  H.264: make filter_mb_fast support the case of unavailable top mb
  Do not include log.h in avutil.h
  Do not include pixfmt.h in avutil.h
  Do not include rational.h in avutil.h
  Do not include mathematics.h in avutil.h
  Do not include intfloat_readwrite.h in avutil.h
  Remove return statements following infinite loops without break
  RTSP: Doxygen comment cleanup
  doxygen: Escape '\' in Doxygen documentation.
  md5: cosmetics
  md5: use AV_WL32 to write result
  md5: add fate test
  md5: include correct headers
  md5: fix test program
  doxygen: Drop array size declarations from Doxygen parameter names.
  doxygen: Fix parameter names to match the function prototypes.
  ...

Conflicts:
	libavcodec/x86/dsputil_mmx.c
	libavformat/flvenc.c
	libavformat/oggenc.c
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-04 00:45:21 +02:00
Diego Biurrun
24c9babaaf doxygen: Fix parameter names to match the function prototypes. 2011-07-03 18:30:02 +02:00
Michael Niedermayer
59eb12faff Merge remote branch 'qatar/master'
* qatar/master: (30 commits)
  AVOptions: make default_val a union, as proposed in AVOption2.
  arm/h264pred: add missing argument type.
  h264dsp_mmx: place bracket outside #if/#endif block.
  lavf/utils: fix ff_interleave_compare_dts corner case.
  fate: add 10-bit H264 tests.
  h264: do not print "too many references" warning for intra-only.
  Enable decoding of high bit depth h264.
  Adds 8-, 9- and 10-bit versions of some of the functions used by the h264 decoder.
  Add support for higher QP values in h264.
  Add the notion of pixel size in h264 related functions.
  Make the h264 loop filter bit depth aware.
  Template dsputil_template.c with respect to pixel size, etc.
  Template h264idct_template.c with respect to pixel size, etc.
  Preparatory patch for high bit depth h264 decoding support.
  Move some functions in dsputil.c into a new file dsputil_template.c.
  Move the functions in h264idct into a new file h264idct_template.c.
  Move the functions in h264pred.c into a new file h264pred_template.c.
  Preparatory patch for high bit depth h264 decoding support.
  Add pixel formats for 9- and 10-bit yuv420p.
  Choose h264 chroma dc dequant function dynamically.
  ...

Conflicts:
	doc/APIchanges
	ffmpeg.c
	ffplay.c
	libavcodec/alpha/dsputil_alpha.c
	libavcodec/arm/dsputil_init_arm.c
	libavcodec/arm/dsputil_init_armv6.c
	libavcodec/arm/dsputil_init_neon.c
	libavcodec/arm/dsputil_iwmmxt.c
	libavcodec/arm/h264pred_init_arm.c
	libavcodec/bfin/dsputil_bfin.c
	libavcodec/dsputil.c
	libavcodec/h264.c
	libavcodec/h264.h
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_ps.c
	libavcodec/h264_refs.c
	libavcodec/h264dsp.c
	libavcodec/h264idct.c
	libavcodec/h264pred.c
	libavcodec/mlib/dsputil_mlib.c
	libavcodec/options.c
	libavcodec/ppc/dsputil_altivec.c
	libavcodec/ppc/dsputil_ppc.c
	libavcodec/ppc/h264_altivec.c
	libavcodec/ps2/dsputil_mmi.c
	libavcodec/sh4/dsputil_align.c
	libavcodec/sh4/dsputil_sh4.c
	libavcodec/sparc/dsputil_vis.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/x86/dsputil_mmx.c
	libavformat/options.c
	libavformat/utils.c
	libavutil/pixfmt.h
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/swscale_template.c
	tests/ref/seek/lavf_avi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-11 05:47:02 +02:00
Anton Khirnov
188dea1dbf lavc: move some flac-specific options to its private context. 2011-05-10 07:42:33 +02:00
Mans Rullgard
2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Justin Ruggles
384dbd617f cosmetics related to LPC changes.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 1c189fc533)
2011-01-23 19:32:06 +01:00
Justin Ruggles
7101b18508 Separate window function from autocorrelation.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 77a78e9bdc)
2011-01-23 19:32:06 +01:00
Justin Ruggles
0d8837bdda Move lpc_compute_autocorr() from DSPContext to a new struct LPCContext.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 56f8952b25)
2011-01-23 19:32:06 +01:00