summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avformat/avformat: Update av_read_frame() documentationAndreas Rheinhardt2020-03-29
| | | | | | | | | | | | | This commit updates the documentation of av_read_frame() to match its actual behaviour in several ways: 1. On success, av_read_frame() always returns refcounted packets. 2. It can handle uninitialized packets. 3. On error, it always returns blank packets. This will allow callers to not initialize or unref unnecessarily. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/dashdec: Don't allocate and leak strings that are never usedAndreas Rheinhardt2020-03-29
| | | | | | | | | | | Since commit e134c203 strdups of several elements of a manifest are kept in the DASHContext; but said commit completely forgot to free these strings again (with xmlFree()). Given that these strings are never used at all, this commit closes this leak by reverting said commit. This reverts commit e134c20374ee3cbc6d04885d306b02c9871683a2. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* doc/filters: add tpad default valuesLou Logan2020-03-28
| | | | Signed-off-by: Lou Logan <lou@lrcd.com>
* avfilter/vf_showinfo: limit the max number of timecodeLimin Wang2020-03-28
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter: add vf_overlay_cudaYaroslav Pogrebnyak2020-03-28
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avutil/frame: make frame copy functions hwframe awareTimo Rothenpieler2020-03-28
|
* avutil/hwcontext: correctly set extended_data on hwframe_get_bufferTimo Rothenpieler2020-03-28
|
* nvdec: attach real hw_frames to post-processed framesTimo Rothenpieler2020-03-28
|
* ffplay, avcodec, avformat: Don't initialize before av_packet_ref()Andreas Rheinhardt2020-03-28
| | | | | | | It already initializes the packet. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avcodec, avpacket: Return blank packet on av_packet_ref() failureAndreas Rheinhardt2020-03-28
| | | | | | | | | | | | Up until now, it was completely unspecified what the content of the destination packet dst was on error. Depending upon where the error happened calling av_packet_unref() on dst might be dangerous. This commit changes this by making sure that dst is blank on error, so unreferencing it again is safe (and still pointless). This behaviour is documented. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avpacket: Always treat dst in av_packet_ref as uninitializedAndreas Rheinhardt2020-03-28
| | | | | | | | | | | | | | | | | | av_packet_ref() mostly treated the destination packet dst as uninitialized, i.e. the destination fields were simply overwritten. But if the source packet was not reference-counted, dst->buf was treated as if it pointed to an already allocated buffer (if != NULL) to be reallocated to the desired size. The documentation did not explicitly state whether the dst will be treated as uninitialized, but it stated that if the source packet is not refcounted, a new buffer in dst will be allocated. This and the fact that the side-data as well as the codepath taken in case src is refcounted always treated the packet as uninitialized means that dst should always be treated as uninitialized for the sake of consistency. And this behaviour has been explicitly documented. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/jpeg2000dec: error check when processing tlm markerGautam Ramakrishnan2020-03-27
| | | | | | | Validate the value of ST field in the TLM marker of JPEG2000. Throw an error when ST takes value of 0b11. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rtp: Pass sources and block filter addresses via sdp file for rtpphunkyfish2020-03-27
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* movenc: mark Opus encapsulation as stableLynne2020-03-27
| | | | | | | The specifications are de-facto frozen now as they've already been used in production for years, the author has indicated reluctance on IRC to change it further, and the only potential changes would, from what I understand, be forward-compatible.
* h264_ps: pass AVCodecContext as void* where possibleAnton Khirnov2020-03-27
| | | | Makes sure it is only used for logging and nothing else.
* tests/checkasm: add overflow test for hevc_add_resLinjie Fu2020-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add overflow test for hevc_add_res when int16_t coeff = -32768. The result of C is good, while ASM is not. To verify: make fate-checkasm-hevc_add_res ffmpeg/tests/checkasm/checkasm --test=hevc_add_res ./checkasm --test=hevc_add_res checkasm: using random seed 679391863 MMXEXT: hevc_add_res_4x4_8_mmxext (hevc_add_res.c:69) - hevc_add_res.add_residual [FAILED] SSE2: hevc_add_res_8x8_8_sse2 (hevc_add_res.c:69) hevc_add_res_16x16_8_sse2 (hevc_add_res.c:69) hevc_add_res_32x32_8_sse2 (hevc_add_res.c:69) - hevc_add_res.add_residual [FAILED] AVX: hevc_add_res_8x8_8_avx (hevc_add_res.c:69) hevc_add_res_16x16_8_avx (hevc_add_res.c:69) hevc_add_res_32x32_8_avx (hevc_add_res.c:69) - hevc_add_res.add_residual [FAILED] AVX2: hevc_add_res_32x32_8_avx2 (hevc_add_res.c:69) - hevc_add_res.add_residual [FAILED] checkasm: 8 of 14 tests have failed Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* checkasm/hevc_add_res: prepare test data only if the fuction is not testedLinjie Fu2020-03-27
| | | | | | | | | | | | check_func will return NULL for functions that have already been tested. If the func is tested and skipped (which happens several times), there is no need to prepare data(randomize_buffers and memcpy). Move relative code in compare_add_res(), prepare data and do check only if the function is not tested. Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc/x86/hevc_add_res: Fix coeff overflow in ADD_RES_SSE_16_32_8Linjie Fu2020-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix overflow for coeff -32768 in function ADD_RES_SSE_16_32_8 with no performance drop.(SSE2/AVX/AVX2) ./checkasm --test=hevc_add_res --bench Mainline: - hevc_add_res.add_residual [OK] hevc_add_res_32x32_8_sse2: 127.5 hevc_add_res_32x32_8_avx: 127.0 hevc_add_res_32x32_8_avx2: 86.5 Add overflow test case: - hevc_add_res.add_residual [FAILED] After: - hevc_add_res.add_residual [OK] hevc_add_res_32x32_8_sse2: 126.8 hevc_add_res_32x32_8_avx: 128.3 hevc_add_res_32x32_8_avx2: 86.8 Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc/x86/hevc_add_res: Fix overflow in ADD_RES_SSE_8_8Linjie Fu2020-03-27
| | | | | | | | | | | | | | | | | | | | | | Fix overflow for coeff -32768 in function ADD_RES_SSE_8_8 with no performance drop. ./checkasm --test=hevc_add_res --bench Mainline: - hevc_add_res.add_residual [OK] hevc_add_res_8x8_8_sse2: 15.5 Add overflow test case: - hevc_add_res.add_residual [FAILED] After: - hevc_add_res.add_residual [OK] hevc_add_res_8x8_8_sse2: 15.5 Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc/x86/hevc_add_res: Fix overflow in ADD_RES_MMX_4_8Linjie Fu2020-03-27
| | | | | | | | | | | | | | | | | | | | | | Fix overflow for coeff -32768 in function ADD_RES_MMX_4_8 with no performance drop. ./checkasm --test=hevc_add_res --bench Mainline: - hevc_add_res.add_residual [OK] hevc_add_res_4x4_8_mmxext: 15.5 Add overflow test case: - hevc_add_res.add_residual [FAILED] After: - hevc_add_res.add_residual [OK] hevc_add_res_4x4_8_mmxext: 15.0 Signed-off-by: Xu Guangxin <guangxin.xu@intel.com> Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc/pthread_frame: Update user context in ff_frame_thread_freeLinjie Fu2020-03-27
| | | | | | | | | | | | | | | | | | | | | | Resolution/format changes lead to re-initialization of hardware accelerations(vaapi/dxva2/..) with new hwaccel_priv_data in the worker-thread. But hwaccel_priv_data in user context won't be updated until the resolution changing frame is output. A termination with "-vframes" just after the reinit will lead to: 1. memory leak in worker-thread. 2. double free in user-thread. Update user context in ff_frame_thread_free with the last thread submit_packet() was called on. To reproduce: ffmpeg -hwaccel vaapi(dxva2) -v verbose -i fate-suite/h264/reinit-large_420_8-to-small_420_8.h264 -pix_fmt nv12 -f rawvideo -vsync passthrough -vframes 47 -y out.yuv Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avfilter/af_acrossover: revert 270068b5aPaul B Mahol2020-03-27
| | | | Actually it did not work well.
* libavcodec/jpeg2000.h: fix comments for JPEG2000 markersGautam Ramakrishnan2020-03-27
| | | | | | | The comments for some of the markers were incorrect. This patch fixes the comments associated with the markers. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_showinfo: check if the s12m data size is validLimin Wang2020-03-27
| | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* configure: Get the correct ident for clang-cl.exeCarl Eugen Hoyos2020-03-26
| | | | Instead of "No input file specified"
* configure: Remove all C standard versions from the MSVC command line.Carl Eugen Hoyos2020-03-26
| | | | Silences a warning for every file when compiling with clang-cl.exe
* avformat/webmdashenc: Fix memleak upon realloc failureAndreas Rheinhardt2020-03-26
| | | | | | | The classical ptr = av_realloc(ptr, size). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mpeg: Remove unnecessary av_packet_unref()Andreas Rheinhardt2020-03-26
| | | | | | | Forgotten in 6a67d518. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/yop: Use av_packet_move_ref() for packet ownership transferAndreas Rheinhardt2020-03-26
| | | | | | | Also return 0 after successfully reading a packet. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/nsvdec: Use av_packet_move_ref() for packet ownership transferAndreas Rheinhardt2020-03-26
| | | | | | | Also simply return 0 in case a packet has been successfully read. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Don't discard the upper 32bits of TrackNumberAndreas Rheinhardt2020-03-26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* doc/developer.texi: Add variadic macros to allowed C language featuresAndreas Rheinhardt2020-03-26
| | | | | | They are used in several places like CBS. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/movenc: Reduce size of the allocated MOVIentry arrayJames Almer2020-03-26
| | | | | | | | Increasing it by 2048 entries per realloc is exessive. Reduces memory usage, especially on long, non fragmented output. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vp9: use a buffer pool to allocate VP9Frame extradataJames Almer2020-03-26
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avfilter/vf_v360: improve sg input formatPaul B Mahol2020-03-26
| | | | Specifically unbreak yaw functionality.
* avfilter/vf_v360: improve sg output formatPaul B Mahol2020-03-26
|
* avformat/matroskadec: fix the type of the TrackLanguageSteve Lhomme2020-03-26
| | | | | | It's an ASCII string, not a UTF-8 string. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Avoid allocations for SeekHeadAndreas Rheinhardt2020-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until e7ddafd5, the Matroska muxer wrote two SeekHeads: One at the beginning referencing the main level 1 elements (i.e. not the Clusters) and one at the end, referencing the Clusters. This second SeekHead was useless and has therefore been removed. Yet the SeekHead-related functions and structures are still geared towards this usecase: They are built around an allocated array of variable size that gets reallocated every time an element is added to it although the maximum number of Seek entries is a small compile-time constant, so that one should rather include the array in the SeekHead structure itself; and said structure should be contained in the MatroskaMuxContext instead of being allocated separately. The earlier code reserved space for a SeekHead with 10 entries, although we currently write at most 6. Reducing said number implied that every Matroska/Webm file will be 84 bytes smaller and required to adapt several FATE tests; furthermore, the reserved amount overestimated the amount needed for for the SeekHead's length field and how many bytes need to be reserved to write a EBML Void element, bringing the total reduction to 89 bytes. This also fixes a potential segfault: If !mkv->is_live and if the AVIOContext is initially unseekable when writing the header, the SeekHead is already written when writing the header and this used to free the SeekHead-related structures that have been allocated. But if the AVIOContext happens to be seekable when writing the trailer, it will be attempted to write the SeekHead again which will lead to segfaults because the corresponding structures have already been freed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: CosmeticsAndreas Rheinhardt2020-03-26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Check unchecked functions for errorsAndreas Rheinhardt2020-03-26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Add deinit functionAndreas Rheinhardt2020-03-26
| | | | | | | | This fixes memleaks if an error happens after one of the allocations in init; or if the trailer isn't written (e.g. because there was an error when writing a packet). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Add init functionAndreas Rheinhardt2020-03-26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Remove unnecessary variableAndreas Rheinhardt2020-03-26
| | | | | | | | chunk_start_index (which was set via an option) was only used to initialize chunk_index and otherwise unused. So initialize chunk_index directly via the option and remove chunk_start_index. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Don't copy header filenameAndreas Rheinhardt2020-03-26
| | | | | | | Instead just reuse the filename string that is given via an option for the child muxer's url field. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Don't keep pointer to AVOutputFormatAndreas Rheinhardt2020-03-26
| | | | | | | It is no longer needed given that the function pointers of the child muxer's AVOutputFormat are no longer called directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Avoid unnecessary flushesAndreas Rheinhardt2020-03-26
| | | | | | | | | | The webm_chunk muxer caches its output to a dynamic buffer and when it outputs anything, it explicitly flushes it. So set the flags indicating that flushing after each packet should not be done automatically (basically avoiding avio_write_marker() to be called by flush_if_needed() in libavformat/mux.c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Use API functions for child muxerAndreas Rheinhardt2020-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of calling the write_header/packet/trailer functions directly via the function pointers. Also, use distinct AVStreams for the child AVFormatContext (up until now the two AVFormatContexts shared their AVStreams because allocating their own was deemed too onerous). Using the function pointers directly meant that the Matroska muxer's init-function was never called, because init-functions were only introduced a few months after webm_chunk has been added and no one thought of/bothered to adapt webm_chunk for this (when the init-function was added in b287d7ea, the code setting the timebase was moved to it, so that the timebases were no longer set to ms-precision when using the webm_chunk muxer; this has been fixed after some time in 42a635dd by setting the timebases direcly (instead of calling the init-function)). And when 982a98a0 added a deinit-function for the Matroska muxer, it introduced memleaks in webm_chunk, because the child muxer's internal structures were no longer freed when calling write_trailer directly. (Given that the init function has never ever been called, the child muxer has never ever been properly initialized, so that the deinit-function was not called when freeing the child context.) This commit stops calling the function pointers directly and instead uses the standard API functions for muxers. This fixes the above mentioned memleaks. (Memleaks are still possible on error. This will be fixed in a future commit that adds a deinit-function to webm_chunk itself.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Use appropriate initializer for AV_OPT_TYPE_STRINGAndreas Rheinhardt2020-03-26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Copy more information to the child AVFormatContextAndreas Rheinhardt2020-03-26
| | | | | | | In particular the flags are important so that AVFMT_FLAG_BITEXACT can be honoured by the child muxer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webm_chunk: Close IO if writing header failsAndreas Rheinhardt2020-03-26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>