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>
12 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
Clément Bœsch
36e61e24e7
lavc: add ff_bprint_to_extradata() helper and use it.
...
This commit also makes sure the extradata and subtitle_header are NUL
terminated, without taking into account the trailing '\0' in account in
the size.
At the same time, it should fix 'warning: dereferencing type-punned
pointer will break strict-aliasing rules' warning for compilers who
don't consider uint8_t** and char** compatibles.
12 years ago
Reimar Döffinger
25fec8595d
avcodec: add ff_lock/unlock_avcodec functions.
...
Will be used in future patches, together with the
variable that allows checking whether the lock is held.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
12 years ago
Anton Khirnov
e57c4706e9
lavc: don't reuse audio buffers
...
Any performance gain from this is negligible and not worth the extra
code.
12 years ago
Anton Khirnov
594d4d5df3
lavc: add a wrapper for AVCodecContext.get_buffer().
...
It will be useful in the upcoming transition to refcounted AVFrames.
12 years ago
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.
12 years ago
Justin Ruggles
bb6941af2a
lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders
12 years ago
Ash Hughes
2470851f12
lavc: enable recursively using avcodec_open2/close.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
716d413c13
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Stefano Sabatini
44bd69e9b9
lavc/utils: rename ff_init_buffer_info() pic parameter to frame
...
The new name is more expressive, given that the frame is not necessarily
a picture but may be an audio frame.
13 years ago
Michael Niedermayer
2fe186409b
lavc: skip initial silence when requested
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
bafa1c7f38
h264: add avpriv_h264_has_num_reorder_frames()
...
This function exports the exact sps.num_reorder_frames value
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
fde1bc64ad
lavc: add frame multithreading capability (currently intra only)
...
Compared to the decoder side, this code is able to change both the
delay and the number of threads seamlessly during encoding. Also
any idle thread can pick up tasks, the strict round robin in order
limit is gone too.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
0c851e4642
threads: make get_logical_cpus() available outside pthread.c
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
a5117a2444
lavc: pad last audio frame with silence when needed.
13 years ago
Michael Niedermayer
6952301f33
ff_samples_to_time_base: support AV_NOPTS_VALUE
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
59a4b73531
pthread/mpegvideo: detect and block attempts to init frames after setup.
...
This fixes race conditions that ultimately lead to memory corruption.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
740b9ff44e
lavc: Redesign the internal encoding API.
...
The new API allows (optionally and on by default) using a internal buffer to encode, avoiding
the need to allocate large buffers or risking failure on too small buffers.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
00663de3b7
lavc: add ff_alloc_packet2().
...
This contains a AVCodecContext thus allowing us to prevent the
error message duplication
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Justin Ruggles
91a28b0e8e
avcodec: add ff_samples_to_time_base() convenience function to internal.h
13 years ago