summaryrefslogtreecommitdiff
path: root/libavcodec/dvenc.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec: use the new AVFrame interlace flags in all decoders and encodersJames Almer2023-05-041-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/mp_cmp: reject invalid comparison function valuesJames Almer2023-04-141-1/+3
| | | | | | Fixes tickets #10306 and #10318. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: add AVCodecContext.frame_num as 64 bit variant to frame_numberMarton Balint2023-02-131-1/+1
| | | | | | | | | | Frame counters can overflow relatively easily (INT_MAX number of frames is slightly more than 1 year for 60 fps content), so make sure we use 64 bit values for them. Also deprecate the old 32 bit frame_number attribute. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavc: support AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE in all no-delay encodersAnton Khirnov2023-01-291-1/+2
| | | | Including fake-delay encoders marked with FF_CODEC_CAP_EOF_FLUSH.
* lavc/dv: rename constants to follow our naming conventionsAnton Khirnov2022-09-051-16/+16
| | | | CamelCase for enum tags, ALL_CAPS for enum values.
* lavc/dv.h: move encoder/decoder-specific code to a new headerAnton Khirnov2022-09-051-0/+1
| | | | | dv.h is also used by libavformat, so avoid exposing encoder/decoder code to it.
* lavc/dvenc: stop using DVVideoContextAnton Khirnov2022-09-051-11/+28
| | | | | Move the parts of it used by the encoder into a new DVEncContext and remove DVVideoContext.
* lavc/dv: do not pass DVVideoContext to dv_calculate_mb_xy()Anton Khirnov2022-09-051-1/+1
| | | | | | Pass the two variables needed from it directly. This is done in preparation to splitting DVVideoContext.
* lavc/dv: do not pass DVVideoContext to ff_dv_init_dynamic_tables()Anton Khirnov2022-09-051-1/+1
| | | | | | It only needs work_chunks from it, so pass that directly. This is done in preparation to splitting DVVideoContext.
* lavc/dv: remove ff_dvvideo_init()Anton Khirnov2022-09-051-1/+11
| | | | | | | | | | | The function contains only two assignments, setting DVVideoContext.avctx and AVCodecContext.chroma_sample_location. However, the decoder does not use the former, and the encoder should not be setting the latter. Therefore move the first assignment to dvenc and the second to dvdec. Make the encoder warn if the user-signalled chroma sample location does not match the supported one, and return an error on higher compliance levels.
* avcodec/codec_internal: Add macro to set AVCodec.long_nameAndreas Rheinhardt2022-09-031-1/+1
| | | | | | | | It reduces typing: Before this patch, there were 105 codecs whose long_name-definition exceeded the 80 char line length limit. Now there are only nine of them. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify frame->data pointers for encoders where possibleAndreas Rheinhardt2022-08-051-6/+5
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Make init-threadsafety the defaultAndreas Rheinhardt2022-07-181-1/+0
| | | | | | | | | | | and remove FF_CODEC_CAP_INIT_THREADSAFE All our native codecs are already init-threadsafe (only wrappers for external libraries and hwaccels are typically not marked as init-threadsafe yet), so it is only natural for this to also be the default state. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Use union for FFCodec decode/encode callbacksAndreas Rheinhardt2022-04-051-1/+1
| | | | | | | | | | | This is possible, because every given FFCodec has to implement exactly one of these. Doing so decreases sizeof(FFCodec) and therefore decreases the size of the binary. Notice that in case of position-independent code the decrease is in .data.rel.ro, so that this translates to decreased memory consumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/codec_internal: Add FFCodec, hide internal part of AVCodecAndreas Rheinhardt2022-03-211-8/+8
| | | | | | | | | | | | | | | | Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.hAndreas Rheinhardt2022-03-211-1/+1
| | | | | | | | | | Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault. This reduces the amount of files that have to include internal.h (which comes with quite a lot of indirect inclusions), as e.g. most encoders don't need it. It is furthemore in preparation for moving the private part of AVCodec out of the public codec.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/encoders: Remove redundant setting of AV_PKT_FLAG_KEYAndreas Rheinhardt2021-09-281-1/+0
| | | | | | | It is now set generically for all those encoders whose corresponding AVCodecDescriptor has the AV_CODEC_PROP_INTRA_ONLY. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dvenc: Avoid copying packet data, allow user-supplied buffersAndreas Rheinhardt2021-06-081-2/+6
| | | | | | | | | | | | When the packet size is known in advance like here, one can avoid an intermediate buffer for the packet data; this also makes it easy to allow user-supplied buffers. Only one thing needed to be changed: The earlier code relied on the buffer having been initially zeroed by av_fast_padded_malloc(), so one now needs to zero the packet at first. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dvenc: Make encoder init-threadsafeAndreas Rheinhardt2021-05-061-2/+9
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-271-1/+1
| | | | | | | | | | 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: Remove deprecated AVCodecContext.coded_frameAndreas Rheinhardt2021-04-271-6/+0
| | | | | | | | | | Deprecated in 40cf1bbacc6220a0aa6bed5c331871d43f9ce370. (The currently disabled filter vf_mcdeint and vf_uspp were users of this field; they have not been changed, so that whoever wants to fix them can see the state of these filters when they were disabled.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/dvenc: Avoid using PutBitContext fields directlyAndreas Rheinhardt2021-03-301-4/+1
| | | | | | Also avoid using bitcounts in case one is actually byte-aligned. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dvenc: Remove dead error messageAndreas Rheinhardt2021-03-301-5/+0
| | | | | | | The PutBits API checks the available space before every write, so this check for overread is dead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/dvenc: dv100_weight_shift never usedPeter Ross2021-01-241-2/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavu: move LOCAL_ALIGNED from internal.h to mem_internal.hAnton Khirnov2021-01-011-0/+1
| | | | That is a more appropriate place for it.
* avcodec/dvenc: Fix undefined left shift of negative numbersAndreas Rheinhardt2020-10-041-10/+10
| | | | | | | | | The earlier code was based on the assumption that AVFrame.linesize can not be negative. Fixes ticket #8280. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: deprecate Lossless and Intra Only encoder capabilitesJames Almer2020-05-211-1/+1
| | | | | | | 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>
* avcodec/dvenc: support encoding dvcprohdBaptiste Coudurier2019-11-131-58/+503
|
* avcodec/dvenc: Change quantizer dead zone default to 7Michael Niedermayer2017-08-081-1/+1
| | | | | | This improves the quality and reduces the "blocking" in flat areas Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvenc: Support adjusting the quantizer deadzoneMichael Niedermayer2017-08-081-1/+23
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'de452e503734ebb0fdbce86e9d16693b3530fad3'Clément Bœsch2017-03-201-4/+5
|\ | | | | | | | | | | | | * commit 'de452e503734ebb0fdbce86e9d16693b3530fad3': pixblockdsp: Change type of stride parameters to ptrdiff_t Merged-by: Clément Bœsch <u@pkh.me>
| * pixblockdsp: Change type of stride parameters to ptrdiff_tDiego Biurrun2016-09-141-4/+5
| | | | | | | | | | | | | | This avoids SIMD-optimized functions having to sign-extend their line size argument manually to be able to do pointer arithmetic. Also adjust parameter names to be "stride" everywhere.
* | Merge commit 'b7f98659f21dce438c33b512e25fd64b8d07c347'Clément Bœsch2016-06-291-0/+2
|\ \ | |/ | | | | | | | | | | * commit 'b7f98659f21dce438c33b512e25fd64b8d07c347': Remove unnecessary get_bits.h #includes Merged-by: Clément Bœsch <clement@stupeflix.com>
| * Remove unnecessary get_bits.h #includesDiego Biurrun2016-06-071-0/+2
| |
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-271-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-1/+1
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-271-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-271-1/+1
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec: Add a min size parameter to ff_alloc_packet2()Michael Niedermayer2015-07-271-1/+1
| | | | | | | | | | | | | | | | This parameter can be used to inform the allocation code about how much downsizing might occur, and can be used to optimize how to allocate the packet Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370'Michael Niedermayer2015-07-211-0/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370': Deprecate avctx.coded_frame Conflicts: ffmpeg.c libavcodec/a64multienc.c libavcodec/asvenc.c libavcodec/cljrenc.c libavcodec/dpxenc.c libavcodec/gif.c libavcodec/mpegvideo_enc.c libavcodec/nvenc.c libavcodec/proresenc_kostya.c libavcodec/pthread_frame.c libavcodec/rawenc.c libavcodec/sunrastenc.c libavcodec/tiffenc.c libavcodec/version.h libavcodec/xbmenc.c libavcodec/xwdenc.c libavdevice/v4l2.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * Deprecate avctx.coded_frameVittorio Giovara2015-07-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rationale is that coded_frame was only used to communicate key_frame, pict_type and quality to the caller, as well as a few other random fields, in a non predictable, let alone consistent way. There was agreement that there was no use case for coded_frame, as it is a full-sized AVFrame container used for just 2-3 int-sized properties, which shouldn't even belong into the AVCodecContext in the first place. The appropriate AVPacket flag can be used instead of key_frame, while quality is exported with the new AVPacketSideData quality factor. There is no replacement for the other fields as they were unreliable, mishandled or just not used at all. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534'Michael Niedermayer2015-07-201-11/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534': Gather all coded_frame allocations and free functions to a single place Conflicts: libavcodec/a64multienc.c libavcodec/asvenc.c libavcodec/cljrenc.c libavcodec/dpxenc.c libavcodec/dvenc.c libavcodec/gif.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libopenjpegenc.c libavcodec/libtheoraenc.c libavcodec/libvpxenc.c libavcodec/mpegvideo_enc.c libavcodec/nvenc.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/sunrastenc.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/v210enc.c libavcodec/v410enc.c libavcodec/xbmenc.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * Gather all coded_frame allocations and free functions to a single placeVittorio Giovara2015-07-201-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocating coded_frame is what most encoders do anyway, so it makes sense to always allocate and free it in a single place. Moreover a lot of encoders freed the frame with av_freep() instead of the correct API av_frame_free(). This bring uniformity to encoder behaviour and prevents applications from erroneusly accessing this field when not allocated. Additionally this helps isolating encoders that export information with coded_frame, and heavily simplifies its deprecation. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec: use av_mod_uintp2() where usefulJames Almer2015-04-211-1/+1
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | dvenc: fix 2x4x8 (interlaced) weight tableChristophe Gisquet2015-02-011-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the decoder has been fixed to output something similar to other implementations, the encoder weight table needed this fix. Reference PSNR values on a progressive sequence (from tiny_psnr) from a chained encoding and decoding: Full progressive: stddev: 0.74 PSNR: 50.69 MAXDIFF: 19 Before: stddev: 1.43 PSNR: 44.97 MAXDIFF: 17 This patch: stddev: 0.76 PSNR: 50.44 MAXDIFF: 14 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | replaced av_dv_codec_profile by av_dv_codec_profile2 in encoder and dv muxersSteve Jiekak2014-12-041-1/+1
| | | | | | | | | | Signed-off-by: Steve Jiekak <devaureshy@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | dvenc: mark encoder as intraChristophe Gisquet2014-10-281-1/+1
| | | | | | | | | | | | And thus allow various multithreading. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'ee0ebd3c1412fdd9d80aa97c98d1a20b893f1f47'Michael Niedermayer2014-09-091-284/+311
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | * commit 'ee0ebd3c1412fdd9d80aa97c98d1a20b893f1f47': dv: K&R formatting cosmetics Conflicts: libavcodec/dv.c libavcodec/dv.h libavcodec/dv_profile.c libavcodec/dvdec.c libavcodec/dvenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dv: K&R formatting cosmeticsGabriel Dume2014-09-091-283/+310
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge commit '7835c24e19d9e1cb43fba5a02ce9d81d518f1300'Michael Niedermayer2014-08-031-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | * commit '7835c24e19d9e1cb43fba5a02ce9d81d518f1300': dv: Update DV-profile-related functions to current public API Conflicts: libavcodec/dvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>