Derek Buitenhuis
abaa12263e
avcodec: Don't lock during open if the codec has threadsafe init
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
9 years ago
Michael Niedermayer
b947ac9096
avcodec/internal: Use do {} while() for ff_tlog()
...
Avoids problems when used without braces
Found-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Ganesh Ajjanagadde
4e2471ef1d
avcodec/internal: silence -Wempty-body on clang
...
This silences a -Wempty-body warning on clang 3.7+, e.g
http://fate.ffmpeg.org/log.cgi?time=20150918181527&log=compile&slot=x86_64-darwin-clang-polly-vectorize-stripmine-3.7 .
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
wm4
87a051f976
lavc: allow asynchronous decoders to return correct pkt_dts values
...
The generic code in utils.c sets the AVFrame.pkt_dts field from the
packet it was supposedly decoded. This does not have to be true for a
fully asynchronous decoder like mmaldec. It could be overwritten with an
incorrect value. Even if the decoder doesn't determine the DTS (but sets
it to AV_NOPTS_VALUE), it's impossible to determine a correct value in
utils.c.
Decoders can now be marked with FF_CODEC_CAP_SETS_PKT_DTS, in which case
utils.c won't overwrite the field. The decoders are expected to set this
field (even if they only set it to AV_NOPTS_VALUE).
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years ago
Hendrik Leppkes
64c33f9624
avcodec: remove deprecated old audio encode API
9 years ago
Ronald S. Bultje
70a19c482a
Move ff_dlog from lavc to lavu.
9 years ago
Michael Niedermayer
d903b62750
avcodec/internal: improve min_size documentation for ff_alloc_packet2()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Michael Niedermayer
0dbfb5386f
avcodec/internal: Deprecate ff_alloc_packet() in favor of ff_alloc_packet2()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years ago
Michael Niedermayer
e36db49b7b
avcodec: Add a min size parameter to ff_alloc_packet2()
...
This parameter can be used to inform the allocation code about how much
downsizing might occur, and can be used to optimize how to allocate the
packet
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
c40ecffd31
Replace AV_PKT_DATA_QUALITY_FACTOR by AV_PKT_DATA_QUALITY_STATS
...
The stats are a superset of the quality factor, also allowing the picture type and encoder "PSNR" stats to be exported
This also replaces the native by fixed little endian order for the affected side data
AV_PKT_DATA_QUALITY_FACTOR is left as a synonym of AV_PKT_DATA_QUALITY_STATS
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Carl Eugen Hoyos
7f0d540188
lavc: Allow 64 channels internally.
9 years ago
Vittorio Giovara
910247f172
lavc: Deprecate avctx.{inter,intra}_quant_bias
...
They are used by dnxhd and mpegvideo_enc exclusively, move them to codec
private options instead.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Vittorio Giovara
5bba3ab0cf
internal: Make dlog/tlog a no-op when disabled
...
Improves Coverity analysis, avoiding "double semicolon" CIDs.
10 years ago
Michael Niedermayer
dbd94b771f
avcodec/internal: Fix ff_dlog() define like av_dlog()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Martin Storsjö
5637ff0121
libavcodec: Clarify the documentation of the internal codec capability flags
...
The previous documentation was very vague and almost misleading.
Signed-off-by: Martin Storsjö <martin@martin.st>
10 years ago
Michael Niedermayer
65a646eb0b
avcodec/internal: Fix doxy for ff_alloc_packet2() return value
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
a994fc39b3
avcodec/utils: mark codec argument as const in ff_lock_avcodec()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
117b432748
lavc: Introduce AVCodec internal capabilities
...
This field is designed for marking codec properties useful to lavc internals.
Two internal capabilities are added:
- FF_CODEC_CAP_INIT_THREADSAFE: codec can be opened without locks;
- FF_CODEC_CAP_INIT_CLEANUP: codec frees memory if initialization fails.
10 years ago
Michael Niedermayer
9bb6e1175f
avcodec/internal: Add () to argument of FF_SIGNBIT() to ensure correct order or operations
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
85dc006b1a
lavc: fix bitshifts amount bigger than the type
...
CC: libav-stable@libav.org
Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638
10 years ago
Justin Ruggles
9e500efdbe
Add av_image_check_sar() and use it to validate SAR
11 years ago
Michael Niedermayer
0739614c9c
avcodec: remove no longer needed ff_codec_close_recursive()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
James Almer
b82274487b
lavc: define STRIDE_ALIGN as 32 when compiling with AVX support
...
Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
dd2d3b766b
lavc: Add hwaccel private data and init/uninit callbacks
11 years ago
Anton Khirnov
5c1d7246cd
lavc: set AVCodecContext.hwaccel in ff_get_format()
...
This way each decoder does not have to do the same thing manually.
11 years ago
Anton Khirnov
632ad2248e
lavc: Add an internal wrapper around get_format()
...
It will be useful in the following commits.
11 years ago
Anton Khirnov
4a0f665143
libavcodec: when decoding, copy replaygain side data to decoded frames
11 years ago
Michael Niedermayer
da89572004
avcodec: Move STRIDE_ALIGN to internal.h
...
The next commit/bugfix will need it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
5968415156
Define ff_log2_run[] in libavcodec/internal.h.
...
This avoids defining the array with different sizes in
different source files.
11 years ago
Tim Walker
5b4797a21d
avframe: add AV_FRAME_DATA_MATRIXENCODING side data type.
...
Includes a libavcodec utility function to update a frame's side data.
11 years ago
Anton Khirnov
37a749012a
lavc: rework handling of refcounted_frames=0
...
Use only proper AVFrame API (no assigning of whole frames, since that
hardcodes sizeof(AVFrame) into lavc).
Make a copy of the side data, so the caller can use av_frame_unref/free
on non-refcounted frames, eliminating the need for
avcodec_get_frame_defaults()/avcodec_free_frame().
11 years ago
Luca Barbato
08303d7741
hwaccel: Simplify ff_find_hwaccel
...
It is always called by passing fields from an AVCodecContext.
11 years ago
Anton Khirnov
da6506c607
lavc: move AVCodecContext.pkt to AVCodecInternal
...
It's a private field, not meant to be accessed from outside lavc.
11 years ago
Anton Khirnov
38ecc3702d
pthread: store thread contexts in AVCodecInternal instead of AVCodecContext
...
It's a private field, it should not be visible to callers.
Deprecate AVCodecContext.thread_opaque
11 years ago
Anton Khirnov
7644f5a807
lavc: replace avcodec_set_dimensions with ff_set_dimensions
...
avcodec_set_dimensions() is supposed to be an internal utility function,
there is no reason whatsoever for it to be public. Therefore deprecate
it.
11 years ago
Michael Niedermayer
9a0e20817a
avcodec/util: Make size argument of ff_alloc_packet2() int64_t
...
This ensures that huge sizes dont get truncated before the check in ff_alloc_packet2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
98fd8a7848
avcodec: Remove ff_packet_free_side_data, use av_packet_free_side_data
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Peter Große
c6c2231227
libavcodec: use 64bit counter in deprecated audio encoder API to prevent problems regarding negative dts
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
42bb3e4db6
avcodec: remove ff_get_logical_cpus()
...
This simplifies the code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Martin Storsjö
f1e9398621
lavc: Rename avpriv_mpv_find_start_code after moving out from mpegvideo
...
Also move the declaration to internal.h, and add restrict qualifiers
to the declaration (as in the implementation).
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Anton Khirnov
f073b1500e
lavc: remove disabled FF_API_OLD_ENCODE_AUDIO cruft
12 years ago
Anton Khirnov
192f1984b1
lavc: limit maximum number of channels to 63
...
This is the most that can be represented with the current channel layout
system. This limit should be raised/removed when a better system is
implemented.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Diego Biurrun
5a4e9fe855
avcodec/internal: Fix #if DECODE_AUDIO / ENCODE_AUDIO name mismatch
12 years ago
Michael Niedermayer
bf90ef0314
avcodec: add ff_frame_get_metadatap()
...
This is needed for av_dict_*
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
a3a97129e7
mpegvideo: make ff_print_debug_info independant of mpegvideo
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
a53b144ec0
avcodec: add avpriv_color_frame()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
67286fa98b
10l: export ff_bprint_to_extradata between libs using avpriv_ prefix.
...
Both libavformat and libavcodec requires this function.
12 years ago