summaryrefslogtreecommitdiff
path: root/libavcodec/mjpegenc.c
Commit message (Collapse)AuthorAge
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mpegvideo: Deprecate bframe opts for encoders not supporting themAndreas Rheinhardt2021-04-10
| | | | | | | | | | | MPEG-1/2/4 are the only mpegvideo based encoders that support bframes; yet even the encoders not supporting bframes have options that only make sense for an encoder that supports bframes; setting any of these options for such an encoder has no impact on the encoded outcome (but setting b_strategy to two slows down encoding considerably). So deprecate these options. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Deprecate duplicate matrix opt for unsupported codecsAndreas Rheinhardt2021-04-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Deprecate a53cc option for encoders != MPEG-2Andreas Rheinhardt2021-04-10
| | | | | | | The MPEG-2 encoder is the only mpegvideo-based encoder that supports embedding a53 side data. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mpegvideo: Deprecate mpeg_quant option for codecs != MPEG-4Andreas Rheinhardt2021-04-10
| | | | | | | | | | | | | | mpeg_quant may only be set for MPEG-4 and MPEG-2, yet for the latter it is no option as the code acts as if it were always set. So deprecate the option for all codecs for which it makes no sense. Furthermore, given that the code already errors out if the option is set for a codec that doesn't support it we can restrict the range of the option for all these codecs without breaking something. This means that the checks for whether mpeg_quant is set for these codecs can be removed as soon as AVCodecContext.mpeg_quant is removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegenc: Include all supported pix_fmts in mpegenc pix_fmtsAndreas Rheinhardt2021-04-10
| | | | | | | | | | | | | | | Currently said list contains only the pixel formats that are always supported irrespective of the range and the value of strict_std_compliance. This makes the MJPEG encoder an outlier as all other codecs put all potentially supported pixel formats into said list and error out if the chosen pixel format is unsupported. This commit brings it therefore in line with the other encoders. The behaviour of fftools/ffmpeg_filter.c has been preserved. A more informed decision would be possible if colour range were available at this point, but it isn't. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegenc: Remove dependency of AMV encoder on mjpegenc_huffmanAndreas Rheinhardt2021-04-10
| | | | | | | | | Using optimal Huffman tables is not supported for AMV and always disabled by ff_mpv_encode_init(); therefore one can build the AMV encoder without mjpegenc_huffman if one adds the necessary compile-time checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/mjpegenc: Fix segfault when freeing incomplete contextAndreas Rheinhardt2021-03-31
| | | | | | | | | | When allocating the MJpegContext fails (or if the dimensions run afoul of the 65500x65500 limit), an attempt to free a subbuffer of said context leads to a segfault in ff_mjpeg_encode_close(). Seems to be a regression since 467d9e27e0cb2bf74f41dc832f2f8d191ba58ec9. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Avoid intermediate bitcount for number of bytes in PutBitContextAndreas Rheinhardt2021-03-30
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mjpegenc_common: Move stuff only used by mjpegenc.c to itAndreas Rheinhardt2021-02-23
| | | | | | | | This allows to make ff_init_uni_ac_vlc static; ff_mjpeg_encode_picture_frame has also been made static, but it could always have been made static. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/mpegvideo_enc: Make mpv_encode_defaults thread-safeAndreas Rheinhardt2021-01-25
| | | | | | | | | This is a prerequisite for making any encoder that uses ff_mpv_encode_init() init-threadsafe; it already makes the AMV, the MJPEG and the MPEG-1/2 encoders init-threadsafe. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Add FF_CODEC_CAP_INIT_CLEANUPLimin Wang2020-05-27
| | | | | | | | | | then ff_mpv_encode_end() will be unnecessary in ff_mpv_encode_init() if it's failed. The FF_CODEC_CAP_INIT_CLEANUP flag is need for single thread, For multithread, it'll be cleanup still by AV_CODEC_CAP_FRAME_THREADS flag if have. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: deprecate Lossless and Intra Only encoder capabilitesJames Almer2020-05-21
| | | | | | | Both are codec properties and not encoder capabilities. The relevant AVCodecDescriptor.props flags exist for this purpose. Signed-off-by: James Almer <jamrial@gmail.com>
* mjpeg: Use profile names in the encoder and decoderVittorio Giovara2018-11-05
|
* Merge commit 'b3739599bda740ac12d3dde31a331b744df99123'James Almer2017-10-23
|\ | | | | | | | | | | | | * commit 'b3739599bda740ac12d3dde31a331b744df99123': lavc: Drop deprecated emu edge functionality Merged-by: James Almer <jamrial@gmail.com>
| * Drop pointless assert.h #includesDiego Biurrun2016-05-03
| |
* | avcodec/mjpegenc: cosmetic changesDavinder Singh2017-08-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mjpegenc: disable unused code with AMVDavinder Singh2017-08-11
| | | | | | | | | | | | disable unused amv_encode_picture() when AMV encoder is not configured. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mjpegenc: move ff_mjpeg_encode_picture_frame to mjpegenc_commonJames Almer2017-05-08
| | | | | | | | Fixes compilation of ljpeg encoder if mjpeg and amv encoders are disabled
* | mjpegenc: enable optimal huffman coding by defaultRostislav Pehlivanov2017-04-09
| | | | | | | | | | | | | | | | As it gives excellent encoding gains at an insignificant speed increase and passes fate without problems, it should now be safe to enable by default. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* | avcodec/mjpegenc: Bypass the 2 pass encoding when optimal tables are not ↵Michael Niedermayer2017-02-10
| | | | | | | | | | | | | | | | | | | | requested This limits the bugs, speedloss and extra memory allocation to the case when optimal tables are needed. Fixes regressions with slice multi-threading Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mjpegenc: Revert some differences in ff_mjpeg_encode_mb() relative ↵Michael Niedermayer2017-02-10
| | | | | | | | | | | | | | | | to pre optimal huffman The changes are not needed anymore and the return code was never used Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mjpegenc: Drop i_tex misuse, set itex/header bits correctly, fix ↵Michael Niedermayer2017-02-10
| | | | | | | | | | | | 2pass encoding Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avcodec/mjpegenc: Remove non functional huffman reallocation and error handlingMichael Niedermayer2017-02-10
| | | | | | | | | | | | | | If this is wanted iam not against it but it must be designed to work with all cases like slice threads, and a single growing buffer does not work very well with slices. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mjpegenc: use s->avctx as a context for av_log rather than NULLRostislav Pehlivanov2017-02-09
| | | | | | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* | mjpegenc_common: add missing ff_ prefix to init_uni_ac_vlcRostislav Pehlivanov2017-02-09
| | | | | | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* | Implement optimal huffman encoding for (M)JPEG.Jerry Jiang2017-02-08
| | | | | | | | | | | | | | > seems to break > make fate-vsynth1-mjpeg-444 Fixed.
* | mjpegenc: Remove duplicate initializerDerek Buitenhuis2016-02-03
| | | | | | | | | | | | This was causing c99conv to crash. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '2862b63783b5556f7f3fb2d097629bc6879f833a'Derek Buitenhuis2016-02-03
|\| | | | | | | | | | | | | * commit '2862b63783b5556f7f3fb2d097629bc6879f833a': lavc: Move prediction_method to codec private options Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavc: Move prediction_method to codec private optionsVittorio Giovara2016-01-21
| | | | | | | | | | | | | | | | | | | | This options is only used by huffyuv, ffvhuv, jpegls, mjpeg, mpegvideoenc, png, utvideo. It is a very codec-specific options, so deprecate the global variant. Set proper limits to the maximum allowed values, and update utvideoenc tests to use the new option name. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Put remaining pieces of CODEC_FLAG_EMU_EDGE under FF_API_EMU_EDGE.Ronald S. Bultje2015-08-28
| | | | | | | | | | | | The amv one probably looks suspicious, but since it's an intra-only codec, I couldn't possibly imagine what it would use the edge for, and the vsynth fate result doesn't change, so it's probably OK.
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'f1fa1eed2abdc8dfb0af318a43f5d293b81141bd'Michael Niedermayer2015-06-12
|\| | | | | | | | | | | | | * commit 'f1fa1eed2abdc8dfb0af318a43f5d293b81141bd': mpegvideo: Expand macro Merged-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '4978850ca2cb1ec6908f5bc79cc592ca454d11e8'Michael Niedermayer2015-03-31
|\| | | | | | | | | | | | | | | | | | | * commit '4978850ca2cb1ec6908f5bc79cc592ca454d11e8': build: Split JPEG-related tables off into a separate component Conflicts: configure Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * build: Split JPEG-related tables off into a separate componentDiego Biurrun2015-03-30
| |
| * mjpegenc: fix argument size in encode_mbVittorio Giovara2014-11-11
| | | | | | | | | | CC: libav-stable@libav.org Bug-Id: CID 1047235
* | avcodec/mjpegenc: Mark ff_mjpeg_encode_close() as av_coldMichael Niedermayer2015-02-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mjpegenc: support trellis quantizationMichael Niedermayer2015-02-11
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mjpegenc: use av_freep(), avoid leaving stale pointers in memoryMichael Niedermayer2014-10-31
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mjpegenc: add priv_class to encodersMichael Niedermayer2014-10-18
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mjpegenc: the AMV encoder doesnt support yuv422Michael Niedermayer2014-09-14
| | | | | | | | | | | | Fixes Ticket3883 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '835f798c7d20bca89eb4f3593846251ad0d84e4b'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '835f798c7d20bca89eb4f3593846251ad0d84e4b': mpegvideo: cosmetics: Lowercase ugly uppercase MPV_ function name prefixes Conflicts: libavcodec/h261dec.c libavcodec/intrax8.c libavcodec/mjpegenc.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpeg4videoenc.c libavcodec/mpegvideo.c libavcodec/mpegvideo.h libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/x86/mpegvideoenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mpegvideo: cosmetics: Lowercase ugly uppercase MPV_ function name prefixesDiego Biurrun2014-08-15
| |
| * mjpeg: return proper error codeNidhi Makhijani2014-07-21
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit 'adcb8392c9b185fd8a91a95fa256d15ab1432a30'Michael Niedermayer2014-07-01
|\| | | | | | | | | | | | | | | | | | | | | * commit 'adcb8392c9b185fd8a91a95fa256d15ab1432a30': mjpeg: Split off bits shared by MJPEG and LJPEG encoders Conflicts: libavcodec/mjpegenc.c libavcodec/mjpegenc.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * mjpeg: Split off bits shared by MJPEG and LJPEG encodersDiego Biurrun2014-06-30
| | | | | | | | This obviates a dependency of the LJPEG encoder on mpegvideo.
* | avcodec/mjpegenc: allow encoding amv with height % 16 != 0 when strict -1 is setMichael Niedermayer2014-06-01
| | | | | | | | | | | | | | This should make it simpler for users to test if such videos work Suggested-by: carl Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix nonsense non-mod16 AMV flipping code.Reimar Döffinger2014-06-01
| | | | | | | | | | | | | | | | | | It is obviously nonsense since it produces wrong results or even crashes (crashes should be encode-only though). Fixes trac issue #1092. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mjpegenc: disallow encoding amv with height%16!=0Michael Niedermayer2014-06-01
| | | | | | | | | | | | | | I do not know on which side to place the padding to encode with 16x16 MBs If someone knows or has a known to be correct sample, please contact me Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/mjpegen: Fix declared argument sizeMichael Niedermayer2014-04-16
| | | | | | | | | | | | Fixes part of Ticket3466 Found-by: Andrey_Karpov / PVS-Studio Signed-off-by: Michael Niedermayer <michaelni@gmx.at>