summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* lavc/libaomenc: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
|
* lavc/libx265: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
|
* lavc/libx264: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
|
* lavc/libtheoraenc: stop setting dts unnecessarilyAnton Khirnov2022-08-23
| | | | | Theora is not marked as supporting reordering, so dts will be set from pts by the generic code.
* lavc/libtheoraenc: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
|
* lavc/pngenc: stop setting dts unnecessarily for APNGAnton Khirnov2022-08-23
| | | | | APNG is not marked as supporting reordering, so dts will be set from pts by the generic code.
* lavc/pngenc: pass through frame durations to encoded packets for APNGAnton Khirnov2022-08-23
|
* lavc/ffv1enc: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
|
* lavc/adxenc: rescale packet duration according to timebaseAnton Khirnov2022-08-23
| | | | The timebase does not always have to be 1/samplerate.
* lavc: move ff_samples_to_time_base() to encode.hAnton Khirnov2022-08-23
| | | | | This function should only be used by encoders, since AVCodecContext.time_base is not used by audio decoders.
* lavc/nvenc: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
|
* lavc/amfenc: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
|
* lavc/librav1e: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
|
* lavc/encode: pass through frame durations to encoded packetsAnton Khirnov2022-08-23
| | | | | | The generic code can only handle the no-delay case. Encoders with delay need to be handled individually, which will be done in the following commits.
* lavc/encode: combine setting no-delay pts for video/audioAnton Khirnov2022-08-23
|
* lavc/encode: generalize a check for setting dts=ptsAnton Khirnov2022-08-23
|
* lavc/encode: simplify a conditionAnton Khirnov2022-08-23
| | | | | | | active_thread_type & FF_THREAD_FRAME will only be true for encoders if frame_thread_encoder has been successfully initialized. Also, stop relying on DCE in that block.
* lavc/encode: make sure frame timebase matches encoder, when setAnton Khirnov2022-08-23
| | | | | | AVFrame.time_base has been added recently, but is currently not used for anything. Prepare for its use in encoders by rejecting frames where time_base is set, but differs from the AVCodecContext one.
* avcodec/audiotoolboxenc: return AVERROR_EXTERNAL immediately when encode errorSteven Liu2022-08-22
| | | | | | | | Just return AVERROR_EXTERNAL immediately when encode error. The other logic should keep the old behavior before commit 7c05b7951. Suggested-By: Zhao Zhili <zhilizhao@tencent.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avcodec/mpegvideo: Allocate encoder-only tables in mpegvideo_enc.cAndreas Rheinhardt2022-08-21
| | | | | | | | | | | | | | | This commit moves the encoder-only allocations of the tables owned solely by the main encoder context to mpegvideo_enc.c. This avoids checks in mpegvideo.c for whether we are dealing with an encoder; it also improves modularity (if encoders are disabled, this code will no longer be included in the binary). And it also avoids having to reset these pointers at the beginning of ff_mpv_common_init() (in case the dst context is uninitialized, ff_mpeg_update_thread_context() simply copies the src context into dst which therefore may contain pointers not owned by it, but this does not happen for encoders at all). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpeg4videodec: Keep data_partitioning in sync between threadsAndreas Rheinhardt2022-08-21
| | | | | | | | | Fixes frame-threaded decoding of samples created by concatting a video with data partitioning and a video not using it. (Only the MPEG-4 decoder sets this, so it is synced in mpeg4_update_thread_context() despite being a MpegEncContext-field.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Combine two loopsAndreas Rheinhardt2022-08-21
| | | | | | (I think the check for !reference is unnecessary.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* The vuya pixel format was recently added, so this lavc workaround is no longerJames Almer2022-08-19
| | | | | | needed. Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/half2float: move non-inline init code out of headerTimo Rothenpieler2022-08-19
|
* avutil/half2float: move tables to header-internal structsTimo Rothenpieler2022-08-19
| | | | | Having to put the knowledge of the size of those arrays into a multitude of places is rather smelly.
* avutil/half2float: adjust conversion of NaNTimo Rothenpieler2022-08-19
| | | | | | | | | | | IEEE-754 differentiates two different kind of NaNs. Quiet and Signaling ones. They are differentiated by the MSB of the mantissa. For whatever reason, actual hardware conversion of half to single always sets the signaling bit to 1 if the mantissa is != 0, and to 0 if it's 0. So our code has to follow suite or fate-testing hardware float16 will be impossible.
* avutil: move half-precision float helper to avutilTimo Rothenpieler2022-08-19
|
* avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manuallyAndreas Rheinhardt2022-08-18
| | | | | | | They are already synced generically in update_context_from_thread() in pthread_frame.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo_dec: Remove commented-out cruftAndreas Rheinhardt2022-08-18
| | | | | | | The fields in question were removed in 759001c534287a96dc96d1e274665feb7059145d. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ffv1enc: Remove redundant wrapperAndreas Rheinhardt2022-08-18
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ffv1enc: Don't create and keep unnecessary referenceAndreas Rheinhardt2022-08-18
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/get_buffer: Don't get AVPixFmtDescriptor unnecessarilyAndreas Rheinhardt2022-08-18
| | | | | | | | | It is unused since 3575a495f6dcc395656343380e13c57d48b9f976 (and the error message is dangerous: av_get_pix_fmt_name(format) returns NULL iff av_pix_fmt_desc_get(format) returns NULL and using a NULL string for %s would be UB). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Reset fields explicitly instead of memsetting themAndreas Rheinhardt2022-08-18
| | | | | | | | Improves the grepability of the code. (Furthermore, I hope that no compiler will really call memset for 28 bytes.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Don't set frame parameters redundantlyAndreas Rheinhardt2022-08-18
| | | | | | | This frame will be reset later in ff_mpv_frame_start() anyway. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/h263dec: Remove redundant code to set cur_pic_ptrAndreas Rheinhardt2022-08-18
| | | | | | | | | | | | | | It is done later in ff_mpv_frame_start() (and nobody uses current_picture_ptr between setting it in ff_mpv_frame_start()). (The reason the vsynth*-h263-obmc ref files change is because the call to ff_find_unused_picture() now happens after the older pictures have been unreferenced in ff_mpv_frame_start(), so that their slots in the picture array can be immediately reused; the obmc code is somehow buggy and changes its output depending on the earlier contents of the motion_val buffer.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/aarch64: hevc_add_res add 12bit variantsJ. Dekker2022-08-18
| | | | | | | | | | | | | hevc_add_res_4x4_12_c: 46.0 hevc_add_res_4x4_12_neon: 18.7 hevc_add_res_8x8_12_c: 194.7 hevc_add_res_8x8_12_neon: 25.2 hevc_add_res_16x16_12_c: 716.0 hevc_add_res_16x16_12_neon: 69.7 hevc_add_res_32x32_12_c: 3820.7 hevc_add_res_32x32_12_neon: 261.0 Signed-off-by: J. Dekker <jdek@itanimul.li>
* aarch64: me_cmp: Remove a leftover unnecessary instructionMartin Storsjö2022-08-18
| | | | | | This was missed in a2e45ad407c526cd5ce2f3a361fb98084228cd6e. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc/aarch64: Add neon implementation for pix_abs8Hubert Mazur2022-08-18
| | | | | | | | | | | | | | Provide optimized implementation of pix_abs8 function for arm64. Performance comparison tests are shown below. - pix_abs_1_0_c: 101.2 - pix_abs_1_0_neon: 22.5 - sad_1_c: 101.2 - sad_1_neon: 22.5 Benchmarks and tests are run with checkasm tool on AWS Graviton 3. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc/aarch64: Add neon implementation for sse8Hubert Mazur2022-08-18
| | | | | | | | | | | | | Provide optimized implementation of sse8 function for arm64. Performance comparison tests are shown below. - sse_1_c: 130.7 - sse_1_neon: 29.7 Benchmarks and tests run with checkasm tool on AWS Graviton 3. Signed-off-by: Hubert Mazur <hum@semihalf.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc/aarch64: Add neon implementation for pix_abs16_y2Hubert Mazur2022-08-18
| | | | | | | | | | | | | Provide optimized implementation of pix_abs16_y2 function for arm64. Performance comparison tests are shown below. pix_abs_0_2_c: 317.2 pix_abs_0_2_neon: 37.5 Benchmarks and tests run with checkasm tool on AWS Graviton 3. Signed-off-by: Hubert Mazur <hum@semihalf.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc/aarch64: Add neon implementation for sse4Hubert Mazur2022-08-18
| | | | | | | | | | | | | Provide neon implementation for sse4 function. Performance comparison tests are shown below. - sse_2_c: 80.7 - sse_2_neon: 31.0 Benchmarks and tests are run with checkasm tool on AWS Graviton 3. Signed-off-by: Hubert Mazur <hum@semihalf.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc/aarch64: Add neon implementation for sse16Hubert Mazur2022-08-18
| | | | | | | | | | | | | Provide neon implementation for sse16 function. Performance comparison tests are shown below. - sse_0_c: 268.2 - sse_0_neon: 43.5 Benchmarks and tests run with checkasm tool on AWS Graviton 3. Signed-off-by: Hubert Mazur <hum@semihalf.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* aarch64: me_cmp: Fix the indentation of function declarationsMartin Storsjö2022-08-18
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avcodec/me_cmp: Remove now incorrect av_assert2()Andreas Rheinhardt2022-08-17
| | | | | | | | | | | | Since d69d12a5b9236b9d2f1fd247ea452f84cdd1aaf9 these av_assert2() (or more exactly, the ones in hadamard8_diff8x8_c() and hadamard8_intra8x8_c()) are hit. So just remove all of these asserts. (If the test were improved to know which functions expect h == 8 and which support any value, the asserts could be readded at the appropriate places.) Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* x86: Don't hardcode the height to 8 in sad8_xy2_mmxMartin Storsjö2022-08-17
| | | | | | | | | | | | The height is hardcoded in some of the me_cmp functions, but not in all of them. But in the case of all other functions, it's hardcoded in the same place in SIMD functions as in the C reference functions, while this one function differs from the behaviour of the C code. (Before 542765ce3eccbca587d54262a512cbdb1407230d, there were a couple other sad8_*_mmx functions with similar hardcoded height.) Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc/aarch64: reformat add_res funcsJ. Dekker2022-08-16
| | | | Signed-off-by: J. Dekker <jdek@itanimul.li>
* avcodec/mpegvideo: Don't zero unnecessarilyAndreas Rheinhardt2022-08-15
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideodec: Constify some functionsAndreas Rheinhardt2022-08-15
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegpicture: Don't copy unnecessarily, fix raceAndreas Rheinhardt2022-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mpegvideo uses an array of Pictures and when it is done with using them, it only unreferences them incompletely: Some buffers are kept so that they can be reused lateron if the same slot in the Picture array is reused, making this a sort of a bufferpool. (Basically, a Picture is considered used if the AVFrame's buf is set.) Yet given that other pieces of the decoder may have a reference to these buffers, they need not be writable and are made writable using av_buffer_make_writable() when preparing a new Picture. This involves reading the buffer's data, although the old content of the buffer need not be retained. Worse, this read can be racy, because the buffer can be used by another thread at the same time. This happens for Real Video 3 and 4. This commit fixes this race by no longer copying the data; instead the old buffer is replaced by a new, zero-allocated buffer. (Here are the details of what happens with three or more decoding threads when decoding rv30.rm from the FATE-suite as happens in the rv30 test: The first decoding thread uses the first slot of its picture array to store its current pic; update_thread_context copies this for the second thread that decodes a P-frame. It uses the second slot in its Picture array to store its P-frame. This arrangement is then copied to the third decode thread, which decodes a B-frame. It uses the third slot in its Picture array for its current frame. update_thread_context copies this to the next thread. It unreferences the third slot containing the other B-frame and then it reuses this slot for its current frame. Because the pic array slots are only incompletely unreferenced, the buffers of the previous B-frame are still in there and they are not writable; in fact the previous thread is concurrently writing to them, causing races when making the buffer writable.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Remove redundant checkAndreas Rheinhardt2022-08-15
| | | | | | | | At this point active_thread_type is set iff active_thread_type is set to FF_THREAD_FRAME iff AVCodecInternal.frame_thread_encoder is set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>