summaryrefslogtreecommitdiff
path: root/libavcodec/bytestream.h
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/bytestream: fix warnings with signed/unsigned compare in bytestream.hDevin Heitmueller2023-04-021-5/+5
| | | | | | | | | | | | When including the header in decklink_enc.cpp it would be fed through the C++ compiler rather than the C compiler, which has more strict warnings when comparing signed/unsigned values. Make the local variables unsigned to match the arguments they are being passed for those functions. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/bytestream: Add unchecked bytestream2 peek functionsAndreas Rheinhardt2020-09-261-1/+5
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* bytestream: Make get_bytes_left compatible with overreadAndreas Rheinhardt2020-03-061-2/+2
| | | | | | | | | | | | | bytestream2_get_bytes_left returns an unsigned int; as a result, it returns big positive numbers if an overread already happened, making it unsuitable for scenarios where one wants to allow this in a controlled way (because the buffer is actually padded so that no segfaults can happen). So change it to return an ordinary int. Also, bytestream2_get_bytes_left_p has been modified in the same way. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/bytestream: check for AV_HAVE_BIGENDIAN instead of HAVE_BIGENDIANJames Almer2017-03-231-1/+1
| | | | | No need to include config.h for HAVE_BIGENDIAN when libavutil/avconfig.h is already included.
* Merge commit '86eee85daddb682fa072c2e2657c90a514b855e3'Michael Niedermayer2015-07-121-1/+3
|\ | | | | | | | | | | | | * commit '86eee85daddb682fa072c2e2657c90a514b855e3': bytestream2: set the reader to the end when reading more than available Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * bytestream2: set the reader to the end when reading more than availableAnton Khirnov2015-07-121-1/+3
| | | | | | | | | | | | | | | | This prevents possible infinite loops with the calling code along the lines of while (bytestream2_get_bytes_left()) { ... }, where the reader does not advance. CC: libav-stable@libav.org
* | Merge commit '5748faf291fec297ef25d81962b52b3438f54278'Michael Niedermayer2014-04-131-0/+26
|\ \ | |/ | | | | | | | | | | * commit '5748faf291fec297ef25d81962b52b3438f54278': bytestream: add bytestream2_copy_buffer() functions Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bytestream: add bytestream2_copy_buffer() functionsJustin Ruggles2014-04-121-0/+26
| | | | | | | | | | | | | | This is basically an overread/overwrite-safe memcpy between a GetByteContext and a PutByteContext. CC:libav-stable@libav.org
| * bytestream: add functions for accessing size of bufferPaul B Mahol2014-04-121-0/+10
| | | | | | | | | | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com> CC:libav-stable@libav.org
* | bytestream2_init: assert that buf_size is validMichael Niedermayer2013-06-211-0/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-10-061-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: yuv4mpeg: return proper error codes. Give all anonymously typedeffed structs in headers a name fate: Add parseutils test parseutils-test: Drop random colors from parsing test vf_pad/scale: use double precision for aspect ratios. build: error on variable-length arrays ppc: swscale: rework yuv2planeX_altivec() ppc: fmtconvert: kill VLA in float_to_int16_interleave_altivec() x86: dsputil: kill VLA in gmc_mmx() libspeexenc: Updated commentary to reflect recent changes libspeexenc: Add an option for enabling DTX doc/APIchanges: fill in missing dates and hashes. lavr: bump major to 1 and declare it stable. lavr: change the type of the data buffers to uint8_t**. lavc: deprecate the audio resampling API. Conflicts: cmdutils.h configure doc/APIchanges ffplay.c libavcodec/dwt.h libavcodec/libspeexenc.c libavfilter/vf_pad.c libavfilter/vf_scale.c libavformat/asf.h tests/fate/libavutil.mak tests/ref/fate/parseutils Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Give all anonymously typedeffed structs in headers a nameDiego Biurrun2012-10-061-2/+2
| | | | | | | | Anonymous structs cannot be forward declared and have no benefit.
* | bytestream: add functions for accessing size of bufferPaul B Mahol2012-03-211-0/+10
| | | | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-181-19/+11
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: fate: make compare() function compatible with POSIX bc Update Janne's email address. APIchanges: Replace Subversion revision numbers by Git hashes. bytestream: Eliminate one level of pointless macro indirection. xwd: convert to bytestream2. vqavideo: port to bytestream2 API Read preset files with suffix .avpreset prores: allow user to set fixed quantiser lavf: remove some disabled code. lavf: only set average frame rate for video. lavf: remove a pointless check. avcodec: add XBM encoder Conflicts: Changelog cmdutils.c cmdutils.h doc/APIchanges libavcodec/Makefile libavcodec/avcodec.h libavcodec/version.h libavcodec/vqavideo.c libavformat/img2enc.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bytestream: Eliminate one level of pointless macro indirection.Diego Biurrun2012-03-181-19/+11
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-151-0/+32
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: h264: stricter reference limit enforcement. h264: increase reference poc list from 16 to 32. xa_adpcm: limit filter to prevent xa_adpcm_table[] array bounds overruns. snow: check reference frame indices. snow: reject unsupported chroma shifts. Add ffvhuff encoding and decoding regression test anm: convert to bytestream2 API bytestream: add more unchecked variants for bytestream2 API jvdec: unbreak video decoding jv demux: set video stream duration fate: add pam image regression test Conflicts: libavcodec/adpcm.c libavcodec/anm.c libavcodec/h264.c libavcodec/mpegvideo.h libavcodec/snowdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bytestream: add more unchecked variants for bytestream2 APIPaul B Mahol2012-03-141-0/+32
| | | | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-02-101-53/+68
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (26 commits) eac3dec: replace undefined 1<<31 with INT32_MIN in noise generation yadif: specify array size outside DECLARE_ALIGNED prores: specify array size outside DECLARE_ALIGNED brackets. WavPack demuxer: set packet duration tta: use skip_bits_long() mxfdec: Ignore the last entry in Avid's index table segments mxfdec: Sanity-check SampleRate mxfdec: Handle small EditUnitByteCount mxfdec: Consider OPAtom files that do not have exactly one EC to be OP1a mxfdec: Don't crash in mxf_packet_timestamps() if current_edit_unit overflows mxfdec: Zero nb_ptses in mxf_compute_ptses_fake_index() mxfdec: Sanity check PreviousPartition mxfdec: Never seek back in local sets and KLVs mxfdec: Move the current_partition check inside mxf_read_header() mxfdec: Fix infinite loop in mxf_packet_timestamps() mxfdec: Check eof_reached in mxf_read_local_tags() mxfdec: Check for NULL component mxfdec: Make sure mxf->nb_index_tables > 0 in mxf_packet_timestamps() mxfdec: Make sure x < index_table->nb_ptses build: Add missing directories to DIRS declarations. ... Conflicts: doc/build_system.txt doc/fate.texi libavfilter/x86/yadif_template.c libavformat/mxfdec.c libavutil/Makefile tests/fate/audio.mak tests/fate/prores.mak tests/fate/screen.mak tests/fate/video.mak tests/ref/fate/bethsoft-vid tests/ref/fate/cscd tests/ref/fate/dfa4 tests/ref/fate/nuv tests/ref/fate/vp8-sign-bias tests/ref/fate/wmv8-drm tests/ref/lavf/gxf Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bytestream: K&R formatting cosmeticsAneesh Dogra2012-02-091-53/+68
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-02-081-0/+112
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: swscale: make yuv2yuv1 use named registers. h264: mark h264_idct_add8_10 with number of XMM registers. swscale: fix V plane memory location in bilinear/unscaled RGB/YUYV case. vp8: always update next_framep[] before returning from decode_frame(). avconv: estimate next_dts from framerate if it is set. avconv: better next_dts usage. avconv: rename InputStream.pts to last_dts. avconv: reduce overloading for InputStream.pts. avconv: rename InputStream.next_pts to next_dts. avconv: rework -t handling for encoding. avconv: set encoder timebase for subtitles. pva-demux test: add -vn swscale: K&R formatting cosmetics for SPARC code apedec: allow the user to set the maximum number of output samples per call apedec: do not unnecessarily zero output samples for mono frames apedec: allocate a single flat buffer for decoded samples apedec: use sizeof(field) instead of sizeof(type) swscale: split C output functions into separate file. swscale: Split C input functions into separate file. bytestream: Add bytestream2 writing API. The avconv changes are due to massive regressions and bugs not merged yet. Conflicts: ffmpeg.c libavcodec/vp8.c libswscale/swscale.c libswscale/x86/swscale_template.c tests/fate/demux.mak tests/ref/lavf/asf tests/ref/lavf/avi tests/ref/lavf/mkv tests/ref/lavf/mpg tests/ref/lavf/nut tests/ref/lavf/ogg tests/ref/lavf/rm tests/ref/lavf/ts tests/ref/seek/lavf_avi tests/ref/seek/lavf_mkv tests/ref/seek/lavf_rm Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bytestream: Add bytestream2 writing API.Aneesh Dogra2012-02-061-0/+112
| | | | | | | | Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-151-0/+36
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: sgidec: Use bytestream2 functions to prevent buffer overreads. cosmetics: Move static and inline attributes to more standard places. configure: provide libavfilter/version.h header to get_version() swscale: change yuv2yuvX code to use cpuflag(). libx264: Don't leave max_b_frames as -1 if the user didn't set it FATE: convert output to rgba for the targa tests which currently output pal8 fate: add missing reference files for targa tests in 9c2f9b0e2 FATE: enable the 2 remaining targa conformance suite tests targa: add support for rgb555 palette FATE: fix targa tests on big-endian systems Conflicts: libavcodec/sgidec.c libavcodec/targa.c libswscale/x86/output.asm tests/fate/image.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * sgidec: Use bytestream2 functions to prevent buffer overreads.Aneesh Dogra2012-01-141-0/+36
| | | | | | | | | | | | The patch also adds several bytestream macros to deal with native endian. Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-071-1/+30
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: flicvideo: fix invalid reads vorbis: Avoid some out-of-bounds reads vqf: add more known extensions cabac: remove unused function renorm_cabac_decoder h264: Only use symbols from the SVQ3 decoder under proper conditionals. add bytestream2_tell() and bytestream2_seek() functions parsers: initialize MpegEncContext.slice_context_count to 1 spdifenc: use special alignment for DTS-HD length_code Conflicts: libavcodec/flicvideo.c libavcodec/h264.c libavcodec/mpeg4video_parser.c libavcodec/vorbis.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * add bytestream2_tell() and bytestream2_seek() functionsJustin Ruggles2012-01-051-1/+30
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-01-051-1/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (46 commits) mtv: Make sure audio_subsegments is not 0 v4l2: use V4L2_FMT_FLAG_EMULATED only if it is defined avconv: add symbolic names for -vsync parameters flvdec: Fix compiler warning for uninitialized variables rtsp: Fix compiler warning for uninitialized variable ulti: convert to new bytestream API. swscale: Use standard multiple inclusion guards in ppc/ header files. Place some START_TIMER invocations in separate blocks. v4l2: list available formats v4l2: set the proper codec_tag v4l2: refactor device_open v4l2: simplify away io_method v4l2: cosmetics v4l2: uniform and format options v4l2: do not force interlaced mode avio: exit early in fill_buffer without read_packet vc1dec: fix invalid memory access for small video dimensions rv34: fix invalid memory access for small video dimensions rv34: joint coefficient decoding and dequantization avplay: Don't call avio_set_interrupt_cb(NULL) ... Conflicts: Changelog avconv.c doc/APIchanges doc/indevs.texi libavcodec/adxenc.c libavcodec/dnxhdenc.c libavcodec/h264.c libavdevice/v4l2.c libavformat/flvdec.c libavformat/mtv.c libswscale/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ulti: convert to new bytestream API.Ronald S. Bultje2012-01-041-1/+5
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-211-0/+44
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavc: always align height by 32 pixel raw: add 10bit YUV definitions nut: support 10bit YUV mpegvideo_enc: separate declarations and statements oma: make header compile standalone vp3: Reorder some functions to fix VP3 build with Theora disabled. build: fix standalone compilation of ADX encoder build: fix standalone compilation of ADPCM decoders build: fix standalone compilation of mpc7/mpc8 decoders 4xm: Use bytestream2 functions to prevent overreads bytestream: add a new set of bytestream functions with overread checking mpegts: Suppress invalid timebase warnings on DMB streams. mpegts: Fix typo in handling sections in the PMT. vc1dec: Use the right pointer type for the tmp pointer Conflicts: libavcodec/4xm.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/vp3.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * bytestream: add a new set of bytestream functions with overread checkingAneesh Dogra2011-12-201-0/+44
| | | | | | | | Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Directly #include some required headers.Diego Biurrun2009-01-251-0/+1
| | | | Originally committed as revision 16780 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix build: Add intreadwrite.h and bswap.h #includes where necessary.Diego Biurrun2009-01-111-0/+1
| | | | Originally committed as revision 16556 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Globally rename the header inclusion guard names.Stefano Sabatini2008-08-311-3/+3
| | | | | | | | | Consistently apply this rule: the guard name is obtained from the filename by stripping the leading "lib", converting '/' and '.' to '_' and uppercasing the resulting name. Guard names in the root directory have to be prefixed by "FFMPEG_". Originally committed as revision 15120 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use full path for #includes from another directory.Diego Biurrun2008-05-091-1/+1
| | | | Originally committed as revision 13098 to svn://svn.ffmpeg.org/ffmpeg/trunk
* constsMichael Niedermayer2008-02-011-2/+2
| | | | | | I have underestimated this a little, and these are just some ... Originally committed as revision 11708 to svn://svn.ffmpeg.org/ffmpeg/trunk
* whitespace cosmeticsMåns Rullgård2007-07-071-7/+7
| | | | Originally committed as revision 9524 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add 64-bit bytestream read/write functionsMåns Rullgård2007-07-071-3/+12
| | | | Originally committed as revision 9523 to svn://svn.ffmpeg.org/ffmpeg/trunk
* include all prerequisites in header filesMåns Rullgård2007-06-161-0/+2
| | | | Originally committed as revision 9344 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove unneeded semicolon.Panagiotis Issaris2007-06-151-1/+1
| | | | Originally committed as revision 9316 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add little endian 24bit read/writeAlex Beregszaszi2007-03-061-0/+1
| | | | Originally committed as revision 8270 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add bytestream_get/put_be24 functionsBaptiste Coudurier2007-03-041-0/+1
| | | | Originally committed as revision 8217 to svn://svn.ffmpeg.org/ffmpeg/trunk
* simplify and remove useless index in AV_W*Michael Niedermayer2007-02-061-48/+15
| | | | Originally committed as revision 7852 to svn://svn.ffmpeg.org/ffmpeg/trunk
* rename BE/LE_8/16/32 to AV_RL/B_8/16/32Alex Beregszaszi2007-01-191-2/+2
| | | | Originally committed as revision 7587 to svn://svn.ffmpeg.org/ffmpeg/trunk
* rename always_inline to av_always_inline and move to common.hMåns Rullgård2006-12-081-10/+10
| | | | Originally committed as revision 7256 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add bytestream big endian 16/32 writing functionsBaptiste Coudurier2006-12-011-0/+14
| | | | Originally committed as revision 7200 to svn://svn.ffmpeg.org/ffmpeg/trunk
* change gif muxer to simple gif encoderBaptiste Coudurier2006-11-021-0/+25
| | | | Originally committed as revision 6874 to svn://svn.ffmpeg.org/ffmpeg/trunk
* change gif demuxer to gif decoderBaptiste Coudurier2006-10-221-0/+50
Originally committed as revision 6760 to svn://svn.ffmpeg.org/ffmpeg/trunk