Commit Graph

17059 Commits

Author SHA1 Message Date
Michael Niedermayer
1e27655388 aacenc: use the correct output buffer
This fixes segfault caused by 3d3cf6745e
when SingleChannelElement.ret was renamed to SingleChannelElement.ret_buf.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-11-26 11:17:17 -05:00
Mans Rullgard
edd80ec7e3 aacdec: fix signed overflows in lcg_random()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-11-26 13:34:58 +00:00
Janne Grunau
5ae72f5453 flashsv: check for keyframe before using differential coding
Fixes a segfault in te fuzzed sample resolutionchange.flv_s211713.

CC: libav-stable@libav.org
2012-11-26 10:26:01 +01:00
Janne Grunau
706acb558a h264: enable low delay only if no delayed frames were seen
Dropping frames is undesirable but that is the only way by which the
decoder could return to low delay mode. Instead emit a warning and
continue with delayed frames.
Fixes a crash in fuzzed sample nasa-8s2.ts_s20033 caused by a larger
than expected has_b_frames value. Low delay keeps getting re-enabled
from a presumely broken SPS.

CC: libav-stable@libav.org
2012-11-26 10:25:39 +01:00
Diego Biurrun
7ee4071362 x86: fix build without inline asm
The qpel functions referenced here are not related to h264 and should
thus never have been under CONFIG_H264QPEL.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-11-26 01:50:47 +01:00
Justin Ruggles
3d3cf6745e aacdec: use float planar sample format for output 2012-11-25 19:06:36 -05:00
Justin Ruggles
8e134e5104 lavc: clarify get_buffer() documentation
This is needed for the AAC decoder, which may need to call get_buffer()
more than once if the channel configuration changes.
2012-11-25 19:06:36 -05:00
Justin Ruggles
3ffed68c2a mpegaudiodec: use planar sample format for output unless packed is requested 2012-11-25 19:05:58 -05:00
Justin Ruggles
2d3993ce8c x86: h264 qpel: use the correct number of utilized xmm regs in cglobal
Fixes xmm register clobbering on win64.
2012-11-25 18:48:43 -05:00
Daniel Kang
610e00b359 x86: h264: Convert 8-bit QPEL inline assembly to YASM
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-11-25 20:38:35 +01:00
Daniel Kang
ad01ba6cea x86: h264: Remove 3dnow QPEL code
The only CPUs that have 3dnow and don't have mmxext are 12 years old.
Moreover, AMD has dropped 3dnow extensions from newer CPUs.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-11-25 20:32:55 +01:00
Diego Biurrun
28c8e288fa x86: h264_chromamc: port to cpuflags 2012-11-25 17:25:10 +01:00
Mans Rullgard
5e39bb073a mpegvideo: simplify dxy calculation in hpel_motion()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-11-23 12:03:54 +00:00
Xi Wang
0d3123666a cdgraphics: fix incorrect vertical offset mask in cdg_scroll()
The vertical offset mask 0x07 is suspicious.

    v_off = FFMIN(data[2] & 0x07, CDG_BORDER_HEIGHT - 1);

Note that v_off is up to 11 (CDG_BORDER_HEIGHT - 1), the correct mask
should be 0x0F.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-11-21 14:35:26 +01:00
Diego Biurrun
17fecb4a59 flashsv: Drop unused function and struct parameters 2012-11-21 11:49:41 +01:00
Justin Ruggles
00dd9a6d6a pcm: fix decoding of pcm_s16le_planar on big-endian
The sample count is decremented by the DECODE() macro and needs to be reset
in each loop iteration. Also, DECODE() increments the src pointer so that does
not need to be done separately.
2012-11-20 10:52:49 -05:00
Luca Barbato
ae3822bca1 imgconvert: remove PixFmtInfo
It is pleonastic and was used in stale functions pending replacement.
2012-11-20 12:45:58 +01:00
Luca Barbato
d1d9efaae6 avcodec: split avpicture from imgconvert
All the non deprecated functions are in avpicture.c now.
2012-11-20 12:45:58 +01:00
Justin Ruggles
7c278d2ae4 alacenc: support 24-bit encoding 2012-11-20 00:26:45 -05:00
Justin Ruggles
c9d0f4506f pcmdec: use planar sample format for pcm_s16le_planar 2012-11-19 23:48:37 -05:00
Justin Ruggles
79b7747556 vorbisdec: use float planar sample format 2012-11-19 23:48:37 -05:00
Diego Biurrun
89923fce70 x86: h264_intrapred: Fix C function names in comments
Function names changed after switching to declaration with
PRED4x4/8x8/8x8L/16x16 macros in the C code.
2012-11-18 18:34:05 +01:00
Diego Biurrun
87af05c575 x86: SPLATD: port to cpuflags 2012-11-18 18:34:05 +01:00
John Stebbins
1c5805521c PGS subtitles: Set AVSubtitle pts value
pts should be that of the packet containing the presentation segment.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-11-18 18:34:05 +01:00
Janne Grunau
e6160bda98 h264: Fix parameters to ff_er_add_slice() call
s->mb_x is reset to zero a couple of lines above. It does not make
sense to call ff_er_add_slice() with 0 as endx when the end of the
macroblock row was reached. Fixes unnecessary and counterproductive
error resilience in https://bugzilla.libav.org/show_bug.cgi?id=394.

CC: libav-stable@libav.org
2012-11-16 13:18:28 +01:00
Janne Grunau
60b6b8c019 h264: always check ref_count for validity
Fixes a crash with zuffed files.
2012-11-16 13:18:28 +01:00
Diego Biurrun
8c3849bc76 x86: dsputil: port to cpuflags 2012-11-16 10:38:23 +01:00
Xi Wang
b74dbdd5e9 bgmc: Fix av_malloc checks in ff_bgmc_init()
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-11-14 23:03:36 +01:00
Diego Biurrun
26301caaa1 x86: mmx2 ---> mmxext in asm constructs 2012-11-14 00:58:51 +01:00
Diego Biurrun
da39cac8de Drop broken and unused CABAC test program. 2012-11-14 00:36:17 +01:00
Diego Biurrun
5e9c6ef8f3 x86: h264_weight_10bit: port to cpuflags 2012-11-13 19:07:09 +01:00
Luca Barbato
83f9ed42ec libtheoraenc: add missing pixdesc.h header
Was left out from c1a02e884a.
2012-11-13 17:42:13 +01:00
Luca Barbato
cc085993f4 avcodec: remove ff_is_hwaccel_pix_fmt
It is used only in one place and is unlikely it would be needed
elsewhere.
2012-11-13 16:21:47 +01:00
Luca Barbato
c1a02e884a pixdesc: add av_pix_fmt_get_chroma_sub_sample
Deprecate avcodec_get_chroma_sub_sample.
2012-11-13 16:14:55 +01:00
Mans Rullgard
a384f6a7f7 ppc: replace pointer casting with AV_COPY32
This removes warnings about strict aliasing violations.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-11-12 10:31:31 +00:00
Mans Rullgard
031aac9861 ppc: fix some unused variable warnings
The third argument of OP_U8_ALTIVEC is evaluated at most once so
there is no need for a potentially unused temporary variable.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-11-12 10:31:31 +00:00
Justin Ruggles
faf340f60c binkaudio: set channel layout 2012-11-12 00:41:02 -05:00
Diego Biurrun
2b479bcab0 build: Drop AVX assembly ifdefs
An assembler able to cope with AVX instructions is now required.
2012-11-11 20:43:28 +01:00
Justin Ruggles
a903f8f087 Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
Also reorder some other #include when applicable.
2012-11-11 13:35:12 -05:00
Alberto Delmás
802713c4e7 mss2: prevent potential uninitialized reads
The alternative to zeroing on init is setting the corrupted flag in
all cases where pal_pic is not fully written, at the cost of added
complexity.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-11-11 16:07:50 +01:00
Kostya Shishkov
6d93308c0c mss2: reindent after last commit 2012-11-11 16:07:42 +01:00
Alberto Delmás
b077eb0780 mss2: fix handling of unmasked implicit WMV9 rectangles
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
2012-11-11 16:07:36 +01:00
Diego Biurrun
6cd796049d x86: h264_qpel_10bit: drop unused parameter from MC10/MC20/MC30 macros 2012-11-10 14:49:09 +01:00
Diego Biurrun
4b60fac419 x86: PALIGNR: port to cpuflags 2012-11-09 21:31:31 +01:00
Diego Biurrun
4d1f69f244 x86: h264_qpel_10bit: port to cpuflags 2012-11-09 21:17:05 +01:00
Justin Ruggles
3a2731cbd3 flacenc: ensure the order is within the min/max range in LPC order search
This fixes use of uninitialized values when the FLAC encoder uses the
2-level, 4-level, and 8-level search methods. Fixes failure of the
fate-flac-24-comp-8 test when run using valgrind.
2012-11-08 13:57:34 -05:00
Diego Biurrun
6ca60d4ddd x86: h264_intrapred: port to cpuflags 2012-11-08 18:05:23 +01:00
James Zern
12776d5d2a libvpxenc: Allow enabling constrained quality (CQ) mode
The CQ mode was introduced in libvpx 0.9.6.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-11-08 00:01:54 +02:00
Martin Storsjö
ad961726dc libopencore-amr: Check the return value of amr_decode_fix_avctx
This allows getting rid of redundant checks later in the codec
specific init functions.

Move the check to before actually initializing the decoder lib,
to simplify error handling.

This fixes a case of returning a value from a void function, present since
d40dab907.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-11-07 00:48:50 +02:00
Justin Ruggles
2e76f34387 flacenc: use RICE2 entropy coding mode for 24-bit 2012-11-05 15:32:30 -05:00
Justin Ruggles
13e1ee6c84 flacenc: add 24-bit encoding 2012-11-05 15:32:30 -05:00
Justin Ruggles
799e232490 flacdsp: move lpc encoding from FLAC encoder to FLACDSPContext
Also, templatize the functions for 16-bit and 32-bit sample range. This will
be used for 24-bit FLAC encoding.
2012-11-05 15:32:30 -05:00
Justin Ruggles
5ff998a233 flacenc: use uint64_t for bit counts
Needed to avoid integer overflows for 24-bit encoding.
2012-11-05 15:32:30 -05:00
Justin Ruggles
e783316322 flacenc: remove wasted trailing 0 bits 2012-11-05 15:32:30 -05:00
Justin Ruggles
6a744d2619 flacenc: use a separate buffer for byte-swapping for MD5 checksum on big-endian
This is much faster than calculating the MD5 one sample at a time.
2012-11-05 15:32:29 -05:00
Diego Biurrun
930e26a3ea x86: h264qpel: Only define mmxext QPEL functions if H264QPEL is enabled
This fixes compilation with --disable-everything and components enabled.
2012-11-05 20:48:43 +01:00
Diego Biurrun
dbb37e7711 x86: PABSW: port to cpuflags 2012-11-05 14:51:10 +01:00
Diego Biurrun
6c104826bd x86: vc1dsp: port to cpuflags 2012-11-05 14:51:10 +01:00
Diego Biurrun
0a7a94f2e5 x86: Refactor PSWAPD fallback implementations and port to cpuflags 2012-11-02 17:05:29 +01:00
Diego Biurrun
9a07c1332c parser: Move Doxygen documentation to the header files 2012-11-02 16:44:23 +01:00
John Stebbins
85f67c4865 PGS subtitles: Expose forced flag
Useful for detection of subtitles displayed during foreign language
scenes.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-11-02 16:13:35 +01:00
Diego Biurrun
26f01bd106 x86: PMINUB: port to cpuflags 2012-11-02 15:38:15 +01:00
Diego Biurrun
9ce02e14f0 x86: ac3dsp: port to cpuflags 2012-11-02 15:24:50 +01:00
Anton Khirnov
0876c28080 lavc: add some AVPacket doxy. 2012-11-02 07:58:38 +01:00
Ilkka Ollakka
6d1270a0f9 decode_audio3: initialize AVFrame
Same fix and issue as in a25d912dca

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-11-01 19:43:05 +01:00
Justin Ruggles
5459848b14 ws-snd1: set channel layout 2012-11-01 11:30:04 -04:00
Justin Ruggles
f7b8506573 wmavoice: set channel layout 2012-11-01 11:30:04 -04:00
Justin Ruggles
002097a00b wmapro: use AVCodecContext.channels instead of keeping a private copy 2012-11-01 11:29:19 -04:00
Justin Ruggles
2ed40608e9 wma: do not keep private copies of some AVCodecContext fields
channels, sample_rate, bit_rate, and block_align can be used directly from
the AVCodecContext
2012-11-01 11:29:19 -04:00
Justin Ruggles
50a65e7a54 vmdaudio: set channel layout 2012-11-01 11:29:19 -04:00
Justin Ruggles
b5f628e227 twinvq: validate sample rate code
A large invalid value could cause undefined behavior when left-shifted
by 8 later in the function.
2012-11-01 11:29:19 -04:00
Justin Ruggles
335826cf5f twinvq: set channel layout 2012-11-01 11:29:19 -04:00
Justin Ruggles
8cc72ce5a0 twinvq: validate that channels is not <= 0
This could occur due to integer overflow when reading the channel count from
the extradata.
2012-11-01 11:29:19 -04:00
Justin Ruggles
cebea00c8a truespeech: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles
523734eb6a sipr: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles
4c53f4aed3 shorten: validate that the channel count in the header is not <= 0 2012-11-01 11:29:18 -04:00
Justin Ruggles
4e13e50432 ra288dec: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles
6159f64364 ra144dec: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles
eb38d8fe92 qdm2: remove unneeded checks for channel count 2012-11-01 11:29:18 -04:00
Justin Ruggles
be2ab8b75a qdm2: make sure channels is not <= 0 and set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles
e3d6ab5704 qcelpdec: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles
d26701ce2f nellymoserdec: set channels to 1 2012-11-01 11:29:17 -04:00
Justin Ruggles
d40dab907a libopencore-amr: set channel layout for amr-nb or if not set by the user 2012-11-01 11:29:17 -04:00
Justin Ruggles
30f8da29bf libilbc: set channel layout 2012-11-01 11:29:17 -04:00
Justin Ruggles
0fd1ddf155 dpcm: use AVCodecContext.channels instead of keeping a private copy 2012-11-01 11:29:17 -04:00
Justin Ruggles
1c7a016153 imc: set channels to 1 instead of validating it 2012-11-01 11:29:17 -04:00
Justin Ruggles
32c7769e5c gsmdec: always set channel layout and sample rate at initialization
Only mono 8kHz is supported.
2012-11-01 11:29:17 -04:00
Justin Ruggles
c5b8acad73 libgsmdec: always set channel layout and sample rate at initialization
Only mono 8kHz is supported.
2012-11-01 11:29:16 -04:00
Justin Ruggles
a346aaf148 g726dec: do not validate sample rate
For decoding it does not really matter what the sample rate is.
2012-11-01 11:29:16 -04:00
Justin Ruggles
e00eb03cd8 g726dec: set channel layout at initialization instead of validating it 2012-11-01 11:29:16 -04:00
Justin Ruggles
99d8686357 flacdec: do not warn on sample rate change 2012-11-01 11:29:16 -04:00
Justin Ruggles
90fcac0e95 flacdec: allow mid-stream channel layout change
Although the libFLAC decoder cannot handle such a change, it is allowed by the
spec and could potentially occur with live streams.
2012-11-01 11:29:16 -04:00
Justin Ruggles
268f8ba112 flacdec: use av_samples_* functions for sample buffer allocation
Also, return an error on allocation failure.
2012-11-01 11:29:16 -04:00
Justin Ruggles
8ac0f6767b dcadec: allow the decoder to change the channel layout mid-stream 2012-11-01 11:29:16 -04:00
Justin Ruggles
93e27f86f1 cook: use av_dlog() for debug logging instead of av_log() with AV_LOG_ERROR 2012-11-01 11:29:15 -04:00
Justin Ruggles
8f173ef019 cook: move samples_per_frame from COOKSubpacket to where it is used 2012-11-01 11:29:15 -04:00
Justin Ruggles
7efbba2e36 cook: use av_get_channel_layout_nb_channels() instead of cook_count_channels() 2012-11-01 11:29:15 -04:00
Justin Ruggles
d21b2e4726 cook: reverse a condition so that the code makes more sense 2012-11-01 11:29:15 -04:00
Justin Ruggles
926e9d28f1 cook: remove unneeded COOKContext variable, sample_rate 2012-11-01 11:29:15 -04:00
Justin Ruggles
8aa5b8c5c8 cook: remove unneeded COOKContext variable, bit_rate 2012-11-01 11:29:15 -04:00
Justin Ruggles
3509eee19c cook: use AVCodecContext.channels instead of keeping a private copy 2012-11-01 11:29:14 -04:00
Justin Ruggles
a3145d0335 bmvaudio: set channel layout at init() rather than validating it 2012-11-01 11:29:14 -04:00
Justin Ruggles
a38eadf7ed atrac1: do not keep a copy of channel count in the private context 2012-11-01 11:29:14 -04:00
Justin Ruggles
4f56f9c48f dsicinaudio: set channels and channel layout 2012-11-01 11:29:14 -04:00
Justin Ruggles
ec2694d259 g722dec: set channel layout at initialization instead of validating it 2012-11-01 11:29:14 -04:00
Justin Ruggles
ee0e9678e7 amrwbdec: set channels, channel_layout, and sample_rate
Only mono 16kHz is supported.
2012-11-01 11:29:14 -04:00
Justin Ruggles
b24a4449a5 amrnbdec: set channels, channel_layout, and sample_rate
Only mono 8kHz is supported.
2012-11-01 11:29:14 -04:00
Justin Ruggles
a4202003b2 dca_parser: allow the parser to change the sample rate 2012-11-01 11:29:13 -04:00
Justin Ruggles
0366664ef9 lavc: check channel count after decoder init
Ensures the decoder did not set channel count to an insanely high value
during initialization, which could cause large memory usage when it tries to
get a buffer during decoding.
2012-11-01 11:29:13 -04:00
Justin Ruggles
bb6941af2a lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders 2012-11-01 11:29:13 -04:00
Diego Biurrun
c37322e68c x86: Move optimization suffix to end of function names
This simplifies cpuflags porting.
2012-10-31 18:21:55 +01:00
Diego Biurrun
fa8fcab1e0 x86: h264_chromamc_10bit: drop pointless PAVG %define
It is only used in one place so there is no need for the abstraction.
2012-10-31 18:21:55 +01:00
Diego Biurrun
d8eda37080 x86: mmx2 ---> mmxext in function names 2012-10-31 17:53:57 +01:00
Diego Biurrun
5707af8d0b aacdec: Drop some unused function arguments 2012-10-31 10:54:52 +01:00
Diego Biurrun
be2c456e96 x86: fmtconvert: Refactor cvtps2pi emulation through cpuflags 2012-10-31 01:05:03 +01:00
Diego Biurrun
be923ed659 x86: fmtconvert: port to cpuflags 2012-10-31 01:05:03 +01:00
Diego Biurrun
588fafe7f3 x86: MMX2 ---> MMXEXT in macro names 2012-10-31 01:04:55 +01:00
Diego Biurrun
652f518594 x86: mmx2 ---> mmxext in comments and messages 2012-10-31 00:37:42 +01:00
Diego Biurrun
04581c8c77 x86: yasm: Use complete source path for macro helper %includes
This is more consistent with the way we handle C #includes and
it simplifies the build system.
2012-10-31 00:37:42 +01:00
Diego Biurrun
6860b4081d x86: include x86inc.asm in x86util.asm
This is necessary to allow refactoring some x86util macros with cpuflags.
2012-10-31 00:37:42 +01:00
Martin Storsjö
ab9545a290 cng: Reindent some incorrectly indented lines
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:29 +02:00
Martin Storsjö
6b68223d31 cngdec: Allow flushing the decoder
After a flush, don't average the output envelope and energy with
previous iterations.

Also start directly from the target values for the first iteration
at startup.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:25 +02:00
Martin Storsjö
036e6c37d3 cngdec: Make the dbov variable have the right unit
Previously the unit of the variable was Bov, not dBov.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:21 +02:00
Martin Storsjö
cafefd889b cngdec: Fix the memset size to cover the full array
This was a leftover from previous iterations of the code, where the
refl coef arrays were statically allocated.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:16 +02:00
Martin Storsjö
9b50d20cd2 cngdec: Update the LPC coefficients after averaging the reflection coefficients
I somehow messed up the placement of this one.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-30 16:51:12 +02:00
Luca Barbato
7658295ba3 pixfmt: support more yuva formats
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-30 12:02:42 +01:00
Ronald S. Bultje
95c89da36e Use ptrdiff_t instead of int for intra pred "stride" function parameter.
This way, SIMD-optimized functions don't have to sign-extend their
stride argument manually to be able to do pointer arithmetic.
2012-10-29 17:49:13 -07:00
Ronald S. Bultje
bad8e33dc9 x86: use PRED4x4/8x8/8x8L/16x16 macros to declare intrapred prototypes. 2012-10-29 17:48:23 -07:00
Ronald S. Bultje
c285edd06e Remove usage of INIT_AVX in h264_intrapred_10bit.asm.
Replace INIT_AVX by INIT_XMM avx. Port the whole file to use cpuflag
based function declarations. Remove (now unused) cputype argument in
function declaration macros. Change function prototypes to have mmx2
instead of mmxext as suffix, since that's required by cpuflags.
2012-10-29 14:10:51 -07:00
Martin Storsjö
9b500b8f6c avcodec: Add a RFC 3389 comfort noise codec
This isn't too useful as a normal codec, but can be used in
voip style applications. The decoder updates the noise
generator parameters when a packet is given to it for decoding,
but if called with an empty packet, it generates more noise
according to the last parameters.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-29 22:00:43 +02: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
Justin Ruggles
39ef66f530 lpc: Add a function for calculating reflection coefficients from autocorrelation coefficients
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-29 21:53:13 +02:00
Anton Khirnov
bff5e5f8b3 indeo3: remove duplicate capabilities line. 2012-10-29 20:04:56 +01:00
Diego Biurrun
72c758f1fd aacenc: Drop some unused function arguments 2012-10-29 18:27:54 +01:00
Anton Khirnov
f174fbac3c lavc: add CODEC_CAP_DR1 to all video decoders missing them 2012-10-29 09:51:23 +01:00
Mans Rullgard
4471a24207 vp8: fix memset() crossing array boundary
Indexing across array boundaries is not allowed by C99.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 17:02:46 +01:00
Mans Rullgard
c4cccc8d3f h264: fix invalid pointer arithmetic
Subtracting a (positive) value from the address of an array violates
C99 section 6.5.6:

  If both the pointer operand and the result point to elements of the
  same array object, or one past the last element of the array object,
  the evaluation shall not produce an overflow; otherwise, the
  behavior is undefined.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 17:02:46 +01:00
Mans Rullgard
50be207759 amrwbdec: fix invalid pointer arithmetic
Subtracting a (positive) value from the address of an array violates
C99 section 6.5.6:

  If both the pointer operand and the result point to elements of the
  same array object, or one past the last element of the array object,
  the evaluation shall not produce an overflow; otherwise, the
  behavior is undefined.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 17:02:45 +01:00
Diego Biurrun
87cdd7c694 ivi_common: Drop unused function parameter from decode_band() 2012-10-26 18:28:38 +02:00
Diego Biurrun
707f58f515 cook: Remove some silly Doxygen comments 2012-10-26 18:28:38 +02:00
Diego Biurrun
8a61ba0e81 cook: Remove senseless maybe_reformat_buffer32() function 2012-10-26 18:28:38 +02:00
Diego Biurrun
f23b4a0682 cook: cosmetics: Better names for joint_decode() function parameters 2012-10-26 18:28:38 +02:00
Diego Biurrun
20015379a4 cook: cosmetics: Better name for ccpl COOKSubpacket member 2012-10-26 18:28:38 +02:00
Janne Grunau
154ff81870 h263: avoid memcpys over array bound in motion vector caching for obmc
Fixes CID602232.
2012-10-26 17:38:07 +02:00
Luca Barbato
22f7942fe7 ffv1: set the range coder state in decode_slice_header 2001-01-01 01:06:41 +01:00
Diego Biurrun
5bac2d0c30 avutil: Move memcpy_backptr() to mem.c
The function is used elsewhere and does not belong with the LZO code.
2012-10-25 11:36:57 +02:00
Anton Khirnov
5a9567631a g.723.1: add missing CODEC_CAP_DR1 2012-10-24 08:46:45 +02:00
Anton Khirnov
1bc64c2814 lavc: initialize output AVFrame before decoding.
Avoids memleaks with audio when extended_data is nontrivial and the user
doesn't reset the frame.
Shouldn't have any effect for video for now, but might be useful in the
future.
2012-10-24 08:46:45 +02:00
Justin Ruggles
c68317ebbe lavc: fix documentation for AVCodecContext.delay 2012-10-23 14:35:27 -04:00
Justin Ruggles
44d854a518 atrac3: return an error if extradata_size is not a specific known size
Also fixes 3 compiler warnings about using uninitialized variables.
2012-10-23 14:35:27 -04:00
Justin Ruggles
a5ef830b12 lavc: use the correct API version guard macro for avcodec_encode_audio() 2012-10-23 14:35:27 -04:00
Mans Rullgard
a153e45b95 dfa: use av_memcpy_backptr() where previously impossible
Since the requirement for output padding has been lifted, we can
use av_memcpy_backptr() here as well.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 18:57:24 +01:00
Diego Biurrun
e831b3b852 av_memcpy_backptr: Drop no longer necessary malloc padding
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 18:57:24 +01:00
Diego Biurrun
330b864cda dsputil: Replace AV_WNxx(AV_RNxx()) combinations by AV_COPYxxU 2012-10-23 16:54:17 +02:00
Diego Biurrun
aa91fe8091 dxtory: Replace AV_WN16A(AV_RN16A()) combination by AV_COPY16 2012-10-23 16:53:42 +02:00
Luca Barbato
9ab0874ea8 mp3: properly forward mp_decode_frame errors
The function can return either a parsing error or a memory management
error.
2012-10-23 14:22:16 +02:00
Luca Barbato
0c03cc6838 mp3: exit on parsing error in mp_decode_frame
Properly forward mp_decode_layer3 errors, mp_decode_layer1 and
mp_decode_layer2 do not return errors.

Based on a patch by Michael Niedermayer.
2012-10-23 14:22:16 +02:00
Mans Rullgard
fab0a8b2c6 libm: add fallbacks for various single-precision functions
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-23 12:00:21 +01:00
Michael Niedermayer
ec444c84cf mpegaudiodec: Fix buffer handling on random access 2012-10-23 10:52:25 +02:00
Diego Biurrun
2f17f265ed mpegaudio: Refactor mp3on4 flush function 2012-10-23 10:52:25 +02:00
Diego Biurrun
8f4c414df6 Improve wording and spelling of av_log_missing_feature messages. 2012-10-23 10:28:40 +02:00
Anton Khirnov
c6b25d1d5e Revert "avutil: Add a copy of ff_sqrt_tab back into avutil to restore ABI compatibility"
This reverts commit d15c21e5fa.

After the major bump this is no longer necessary.
2012-10-23 07:33:05 +02:00
Justin Ruggles
a1f4cd371a atrac3: replace a calculation with FFALIGN()
This allocates 4 bytes less than the previous code if avctx->block_align is
a multiple of 4, but the extra 4 bytes is not really needed.
2012-10-22 10:10:08 -04:00
Justin Ruggles
808686fc1e atrac3: remove unused ATRAC3Context field, sample_rate 2012-10-22 10:10:08 -04:00
Justin Ruggles
89a6c32bc1 atrac3: use sizeof(variable) instead of sizeof(type) 2012-10-22 10:10:08 -04:00
Justin Ruggles
327747de15 atrac3: simplify MDCT window calculation 2012-10-22 10:10:08 -04:00
Justin Ruggles
5d1007f74d atrac3: initialize static tables in AVCodec.init_static_data() 2012-10-22 10:10:08 -04:00
Justin Ruggles
78edce3f19 atrac3: separate window initialization from IMDCT initialization 2012-10-22 10:10:08 -04:00
Justin Ruggles
c51311b907 atrac3: move the 'frame_factor' field from ATRAC3Context to where it is used 2012-10-22 10:10:08 -04:00
Justin Ruggles
7e76f27081 atrac3: remove unused ATRAC3Context field, bit_rate 2012-10-22 10:10:07 -04:00
Justin Ruggles
a2664c91fb atrac3: move the 'samples_per_frame' field from ATRAC3Context to where it is used 2012-10-22 10:10:07 -04:00
Justin Ruggles
7c1f93afe6 atrac3: remove unused ATRAC3Context field, samples_per_channel 2012-10-22 10:10:07 -04:00
Justin Ruggles
cdd0e0de81 atrac3: use AVCodecContext.block_align instead of keeping a private copy 2012-10-22 10:10:07 -04:00
Justin Ruggles
64ebbb8f89 atrac3: move the 'delay' field from ATRAC3Context to where it is used 2012-10-22 10:10:07 -04:00
Justin Ruggles
56a9d2b44e atrac3: move the 'version' field from ATRAC3Context to where it is used 2012-10-22 10:10:06 -04:00
Justin Ruggles
5ac673b553 atrac3: use AVCodecContext.channels instead of keeping a private copy 2012-10-22 10:10:06 -04:00
Justin Ruggles
aefdb735c3 atrac3: simplify some loop indexing 2012-10-22 10:10:06 -04:00
Justin Ruggles
e55d53905f atrac3: cosmetics: pretty-printing and renaming
also does some minor refactoring.
2012-10-22 10:10:06 -04:00
Mans Rullgard
abdee95224 pcm: define AVCodec instances only for enabled codecs
This defines an AVCodec only if the corresponding CONFIG option is
enabled instead of using the broad CONFIG_ENCODERS/DECODERS.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-22 14:40:57 +01:00
Anton Khirnov
5957aefc7c libxvid: remove useless doxy comments. 2012-10-22 15:20:23 +02:00
Anton Khirnov
b691135d0c lavc: remove stats_out from the options table.
Since it is declared as a string AVOption, the generic freeing code
attempts to free it on codec close. Some codecs might have already freed
it elsewhere (or didn't even allocate it with av_malloc() in the first
place), so this might lead to an invalid free.

There is no point in having this field accessible as an AVOption, so
remove it from the options table.

Fixes Bug 380.

CC: libav-stable@libav.org
2012-10-22 14:44:07 +02:00
Anton Khirnov
d6f4fe68c8 lavc: extend frame_size doxy. 2012-10-22 08:49:58 +02:00
Justin Ruggles
46a86c6194 alacdec: set bits_per_raw_sample 2012-10-21 23:54:51 -04:00
Nathan Caldwell
c854102da7 avcodec: handle AVERROR_EXPERIMENTAL
Error out on init if a codec with CODEC_CAP_EXPERIMENTAL is requested
and strict_std_compliance is not FF_COMPLIANCE_EXPERIMENTAL.

Move the check from avconv to avcodec_open2() and return
AVERROR_EXPERIMENTAL accordingly.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-21 23:03:26 +02:00
Nathan Caldwell
a4aa20fbdb avcodec: prefer decoders without CODEC_CAP_EXPERIMENTAL
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-21 22:27:58 +02:00
Diego Biurrun
af1ede069c svq3: cosmetics: Drop useless parentheses 2012-10-20 21:10:21 +02:00
Diego Biurrun
a7d2861d36 svq3: K&R formatting cosmetics 2012-10-20 21:10:21 +02:00
Diego Biurrun
6cfca5b6ae ffv1: Add missing #includes to header file 2012-10-20 21:10:21 +02:00
Luca Barbato
0f13cd3187 ffv1: update to ffv1 version 3
Based on code from Carl Eugen Hoyos, Michael Niedermayer and Paul B Mahol.
2012-10-20 18:14:52 +02:00
Luca Barbato
4a2a4524a3 ffv1: propagate errors 2012-10-20 18:14:51 +02:00
Luca Barbato
71f7b22dba ffv1: split decoder and encoder 2012-10-20 18:14:43 +02:00
Martin Storsjö
d15c21e5fa avutil: Add a copy of ff_sqrt_tab back into avutil to restore ABI compatibility
Earlier versions of for instance of libavcodec expect this symbol to be
present in libavutil. This commit can be reverted after the next major
bump.

New shared builds of avcodec will link to the internal copy of the
table within that library, so those builds won't rely on this table
being present in avutil any longer either.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-20 14:31:55 +03:00
Mans Rullgard
f0c07be649 celp_math: rename ff_log2 to ff_log2_q15
This name is more descriptive as the function returns a fixed-point
value with 15 fraction bits.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-20 12:28:45 +01:00
Mans Rullgard
1846ddf0a7 ARM: fix overreads in neon h264 chroma mc
The loops were reading ahead one line, which could end up outside the
buffer for reference blocks at the edge of the picture.  Removing
this readahead has no measurable performance impact.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-20 01:28:38 +01:00
Diego Biurrun
c896aa984e build: Drop OBJS declaration for non-existing PCM_DVD encoder 2012-10-19 17:04:41 +02:00
Michael Niedermayer
6bcdfe48d0 mpeg4videodec: Disable frame multithreading for GMC, its not implemented at all
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-19 15:42:35 +03:00
Kostya Shishkov
169514c440 indeo3: do not try to output more lines than we can fit
Internally chroma planes have multiple of four height while allocated image
planes might be smaller if CODEC_FLAG_EMU_EDGE is set. Thus we should not
output more lines of chroma than frame can accept.

Also the decoder can be safely switched to direct rendering now.
2012-10-19 07:58:51 +02:00
Kostya Shishkov
8774d58358 bmv: get a new frame on every decode_frame(), so we can use direct rendering 2012-10-19 07:58:51 +02:00
Mans Rullgard
7a12d97eb1 aac: fix build with hardcoded tables
aac_tablegen.h includes aac.h for the POW_SF2_ZERO definition, but
this also pulls in a raft of other headers, some of which are not
safe to use in code built with the host compiler.

Moving POW_SF2_ZERO to aac_tablegen_decl.h, where the declaration
of the array it relates to already resides, fixes the problems.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-18 19:59:43 +01:00
Martin Storsjö
d66c52c2b3 Add support for building shared libraries with MSVC
This requires the makedef perl script by Derek, from the
c89-to-c99 repo. That scripts produces a .def file, listing
the symbols to be exported, based on the gcc version scripts
and the built object files.

To properly load non-function symbols from DLL files, the
data symbol declarations need to have the attribute
__declspec(dllimport) when building the calling code. (On mingw,
the linker can fix this up automatically, which is why it has not
been an issue so far. If this attribute is omitted, linking
actually succeeds, but reads from the table will not produce the
desired results at runtime.)

MSVC seems to manage to link DLLs (and run properly) even if
this attribute is present while building the library itself
(which normally isn't recommended) - other object files in the
same library manage to link to the symbol (with a small warning
at link time, like "warning LNK4049: locally defined symbol
_avpriv_mpa_bitrate_tab imported" - it doesn't seem to be possible
to squelch this warning), and the definition of the tables
themselves produce a warning that can be squelched ("warning C4273:
'avpriv_mpa_bitrate_tab' : inconsistent dll linkage, see previous
definition of 'avpriv_mpa_bitrate_tab').

In this setup, mingw isn't able to link object files that refer to
data symbols with __declspec(dllimport) without those symbols
actually being linked via a DLL (linking avcodec.dll ends up with
errors like "undefined reference to `__imp__avpriv_mpa_freq_tab'").
The dllimport declspec isn't needed at all in mingw, so we simply
choose not to declare it for other compilers than MSVC that requires
it. (If ICL support later requires it, the condition can be extended
later to include both of them.)

This also implies that code that is built to link to a certain
library as a DLL can't link to the same library as a static library.
Therefore, we only allow building either static or shared but not
both at the same time. (That is, static libraries as such can be,
and actually are, built - this is used for linking the test tools to
internal symbols in the libraries - but e.g. libavformat built to
link to libavcodec as a DLL cannot link statically to libavcodec.)

Also, linking to DLLs is slightly different from linking to shared
libraries on other platforms. DLLs use a thing called import
libraries, which is basically a stub library allowing the linker
to know which symbols exist in the DLL and what name the DLL will
have at runtime.

In mingw/gcc, the import library is usually named libfoo.dll.a,
which goes next to a static library named libfoo.a. This allows
gcc to pick the dynamic one, if available, from the normal -lfoo
switches, just as it does for libfoo.a vs libfoo.so on Unix. On
MSVC however, you need to literally specify the name of the import
library instead of the static library.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 14:26:15 +03:00