Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-10avcodec/mpegpicture: Move encoding_error and mb_var_sum to MpegEncCtxAndreas Rheinhardt
These fields are only ever set by the encoder for the current picture and for no other picture. So only one set of these values needs to exist, so move them to MpegEncContext. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-09avcodec/mpegpicture: Move mb_var, mc_mb_var and mb_mean to MpegEncCtxAndreas Rheinhardt
These tables are only used by encoders and only for the current picture; ergo they need not be put into the picture at all, but rather into the encoder's context. They also don't need to be refcounted, because there is only one owner. In contrast to this, the earlier code refcounts them which incurs unnecessary overhead. These references are not unreferenced in ff_mpeg_unref_picture() (they are kept in order to have something like a buffer pool), so that several buffers are kept at the same time, although only one is needed, thereby wasting memory. The code also propagates references to other pictures not part of the pictures array (namely the copy of the current/next/last picture in the MpegEncContext which get references of their own). These references are not unreferenced in ff_mpeg_unref_picture() (the buffers are probably kept in order to have something like a pool), yet if the current picture is a B-frame, it gets unreferenced at the end of ff_mpv_encode_picture() and its slot in the picture array will therefore be reused the next time; but the copy of the current picture also still has its references and therefore these buffers will be made duplicated in order to make them writable in the next call to ff_mpv_encode_picture(). This is of course unnecessary. Finally, ff_find_unused_picture() is supposed to just return any unused picture and the code is supposed to work with it; yet for the vsynth*-mpeg4-adap tests the result depends upon the content of these buffers; given that this patchset changes the content of these buffers (the initial content is now the state of these buffers after encoding the last frame; before this patch the buffers used came from the last picture that occupied the same slot in the picture array) their ref-files needed to be changed. This points to a bug somewhere (if one removes the initialization, one gets uninitialized reads in adaptive_quantization in ratecontrol.c). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-13avcodec/mpegvideo: Move encoder-only stuff to a new headerAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-08all: Remove unnecessary libavcodec/internal.h inclusionsAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2020-06-03avcodec/ratecontrol: fix the integer overflow after long time runLimin Wang
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2017-03-31Merge commit '3b50dbc51fb0978d09c1a5b83d4bf5a59d170e1e'James Almer
* commit '3b50dbc51fb0978d09c1a5b83d4bf5a59d170e1e': ratecontrol: Use correct function pointer casts instead of void* Merged-by: James Almer <jamrial@gmail.com>
2017-02-01Merge commit 'a1f6a2dfdaf9beb42ca66e49d10bfaf5905a0128'Clément Bœsch
* commit 'a1f6a2dfdaf9beb42ca66e49d10bfaf5905a0128': ratecontrol: Reorder functions to avoid forward declarations Merged, but this seems to break the clear separation of 1-pass vs 2-pass. Merged-by: Clément Bœsch <u@pkh.me>
2017-02-01Merge commit 'd639dcdae022130078c9c84b7b691c5e9694786c'Clément Bœsch
* commit 'd639dcdae022130078c9c84b7b691c5e9694786c': ratecontrol: Move Xvid-related functions to the place they are actually used Merged-by: Clément Bœsch <u@pkh.me>
2017-01-31Merge commit 'b4bb9593834460bbbe0e70823f2c503cb01ad052'James Almer
* commit 'b4bb9593834460bbbe0e70823f2c503cb01ad052': ratecontrol: Drop commented out cruft Merged-by: James Almer <jamrial@gmail.com>
2016-11-12ratecontrol: Use correct function pointer casts instead of void*Diego Biurrun
libavcodec/ratecontrol.c:120:9: warning: ISO C forbids initialization between function pointer and ‘void *’ [-Wpedantic] libavcodec/ratecontrol.c:121:9: warning: ISO C forbids initialization between function pointer and ‘void *’ [-Wpedantic]
2016-07-20ratecontrol: Reorder functions to avoid forward declarationsVittorio Giovara
2016-07-20ratecontrol: Move Xvid-related functions to the place they are actually usedVittorio Giovara
This will simplify the de-MpegEncContextualization.
2016-07-20ratecontrol: Move mpegenc-only function where it is usedVittorio Giovara
2016-07-20ratecontrol: Drop commented out cruftVittorio Giovara
2016-06-21Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
2016-05-04cosmetics: Fix spelling mistakesVittorio Giovara
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2015-12-04avcodec/mpegvideo: use constants for rc_strategyClément Bœsch
2015-11-14avcodec/ratecontrol: use predefined M_EGanesh Ajjanagadde
M_E is defined in math.h, or in avutil/mathematics.h for compatibility hacks. This uses this value instead of an ad-hoc define. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-09-02avcodec/mpegvideo: change bit_rate to 64bitMichael Niedermayer
32bit is not sufficient for all cases Fixes: signal_sigabrt_7ffff6ac8cc9_686_cov_1897408623_microsoft_new_way_to_shove_mpeg2_in_asf.dvr_ms Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer
* commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27lavc: AV-prefix all codec flagsVittorio Giovara
Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-09Merge commit '1761ab838c75223a6b97d8c0720d09275374c53d'Michael Niedermayer
* commit '1761ab838c75223a6b97d8c0720d09275374c53d': lavc: Deprecate avctx.rc_strategy Conflicts: libavcodec/mpegvideo.h libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-08lavc: Deprecate avctx.rc_strategyVittorio Giovara
Only used by libxvid in ratecontrol module, so move it to a codec private option. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-06-01Merge commit '42df71d9bbb1a5b4bce0bb34417692565c72d390'Michael Niedermayer
* commit '42df71d9bbb1a5b4bce0bb34417692565c72d390': ratecontrol: Check memory allocation Conflicts: libavcodec/ratecontrol.c See: 0898a6d4e4b669704fce663f610aa43dd7483fe9 Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-31ratecontrol: Check memory allocationVittorio Giovara
2015-05-22Merge commit '848e86f74d3e6e87fa592ee8ba8c184cc5fd9a42'Michael Niedermayer
* commit '848e86f74d3e6e87fa592ee8ba8c184cc5fd9a42': mpegvideo: Drop flags and flags2 Conflicts: libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/ratecontrol.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-22mpegvideo: Drop flags and flags2Vittorio Giovara
They are just duplicates of AVCodecContext members so use those instead.
2015-04-20Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer
* commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-19lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara
2015-01-31avcodec/ratecontrol: replace asserts by av_assertsMichael Niedermayer
Also remove the now unneeded #include <assert.h> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-10avcodec/ratecontrol: Check for av_malloc*() failuresMichael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18Merge commit '530c1441fd1426b6a4bb33485ff3226e1ae0ad45'Michael Niedermayer
* commit '530c1441fd1426b6a4bb33485ff3226e1ae0ad45': lavc: make lmax/lmin into private options of mpegvideo encoders Conflicts: libavcodec/avcodec.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18Merge commit '15ec053c4c0b198a2e93eb8e60c8f41e091e0c40'Michael Niedermayer
* commit '15ec053c4c0b198a2e93eb8e60c8f41e091e0c40': lavc: make border_masking into private options of mpegvideo encoders Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18Merge commit '66a68ddd1ac376b24db8695058bc8fc28f5bada6'Michael Niedermayer
* commit '66a68ddd1ac376b24db8695058bc8fc28f5bada6': lavc: make rc_buffer_aggressivity/rc_initial_cplx into private options of mpegvideo encoders Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18Merge commit 'a75c2eb25a62105c09b48521aef429dc8a231637'Michael Niedermayer
* commit 'a75c2eb25a62105c09b48521aef429dc8a231637': lavc: make rc_eq into private options of mpegvideo encoders Conflicts: libavcodec/options_table.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18Merge commit '946f95354ba76ef73c9b66889d86ab5fba4fb486'Michael Niedermayer
* commit '946f95354ba76ef73c9b66889d86ab5fba4fb486': lavc: make rc_qmod_* into private options of mpegvideo encoders Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18Merge commit 'a6e4ce9fd50897dc6d9c2ada4b6b8090de7de5bf'Michael Niedermayer
* commit 'a6e4ce9fd50897dc6d9c2ada4b6b8090de7de5bf': lavc: make rc_qsquish a private option of mpegvideo encoders Conflicts: libavcodec/avcodec.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-18lavc: make lmax/lmin into private options of mpegvideo encodersAnton Khirnov
2014-10-18lavc: make border_masking into private options of mpegvideo encodersAnton Khirnov
2014-10-18lavc: make rc_buffer_aggressivity/rc_initial_cplx into private options of ↵Anton Khirnov
mpegvideo encoders
2014-10-18lavc: make rc_eq into private options of mpegvideo encodersAnton Khirnov
2014-10-18lavc: make rc_qmod_* into private options of mpegvideo encodersAnton Khirnov
2014-10-18lavc: make rc_qsquish a private option of mpegvideo encodersAnton Khirnov
2014-07-31avcodec/ratecontrol: remove unneeded statementMichael Niedermayer
Found-by: CSA Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01Merge commit 'b2c31710c96fa47d9dcd40b64d39663e8957f683'Michael Niedermayer
* commit 'b2c31710c96fa47d9dcd40b64d39663e8957f683': lavc: move CODEC_FLAG_NORMALIZE_AQP to mpegvideo Conflicts: libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01lavc: move CODEC_FLAG_NORMALIZE_AQP to mpegvideoAnton Khirnov
2014-04-20avcodec/ratecontrol: use av_malloc_array()Michael Niedermayer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-09Merge remote-tracking branch 'qatar/master'Michael Niedermayer
* qatar/master: mpegvideo: operate with pointers to AVFrames instead of whole structs Conflicts: libavcodec/h261dec.c libavcodec/h263dec.c libavcodec/intrax8.c libavcodec/mpeg12enc.c libavcodec/mpegvideo.c libavcodec/mpegvideo.h libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/mpegvideo_xvmc.c libavcodec/msmpeg4.c libavcodec/ratecontrol.c libavcodec/vaapi.c libavcodec/vc1dec.c libavcodec/vdpau_vc1.c See: fc567ac49e17151f00f31b59030cd10f952612ef Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-09mpegvideo: operate with pointers to AVFrames instead of whole structswm4
The most interesting parts are initialization in ff_MPV_common_init() and uninitialization in ff_MPV_common_end(). ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL checks for Picture.f, because these functions can be called on uninitialized or partially initialized Pictures. NULL pointer checks are added to ff_thread_release_buffer() stub function. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-03-21avcodec/ratecontrol: make (mc_)mb_var_sum(_last) 64bitMichael Niedermayer
This avoids hypothetical integer overflows