1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

120 Commits

Author SHA1 Message Date
Paul B Mahol
78c8a76536 avcodec/get_bits: unbreak get_bits_le() with cached reader 2019-04-19 13:58:54 +02:00
Marton Balint
694d9d5368 avcodec/get_bits: add assertion to limit ouptut value of get_bits
Should fix the following Coverity false positives:

Coverity CID #1415651.
Coverity CID #1420392.
Coverity CID #1420473.
Coverity CID #1433770.
Coverity CID #1435320.
Coverity CID #1439573.
Coverity CID #1439580.
Coverity CID #1439588.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-03-01 22:33:58 +01:00
Marton Balint
902e9334aa avcodec/get_bits: use unsigned integers in show_bits and get_bits
The return value is also unsigned.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-03-01 22:33:55 +01:00
James Almer
9305bdc68f avcodec/get_bits: actually make cached reader correctly disabled 2018-08-30 22:47:31 +02:00
Paul B Mahol
ca079b0954 avcodec/get_bits: add cached bitstream reader
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-08-30 11:50:23 +02:00
Michael Niedermayer
6261ef4251 avcodec/get_bits: Document skip_bits_long()
Found-by: Kieran
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-07 19:16:37 +02:00
Michael Niedermayer
e529fe7633 avcodec/get_bits: Make sure the input bitstream with padding can be addressed
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-03-26 02:12:15 +02:00
Michael Niedermayer
4a94ff4ccd avcodec/get_bits: Document the return code of get_vlc2()
Found-by: kierank
Reviewed-by: Kieran Kunhya <kieran618@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-01-29 04:11:28 +01:00
Steinar H. Gunderson
2a293ec7ac avcodec: add Newtek SpeedHQ decoder
This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9),
including correct decoding of the alpha channel.

1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell),
about evenly split between bitstream reader and IDCT. There is currently
no attempt at slice or frame threading, even though the format trivially
supports both.

NewTek very helpfully provided a full set of SHQ samples, as well as
source code for an SHQ2 encoder (not included) and assistance with
understanding some details of the format.
2017-01-11 16:02:10 +01:00
Paul B Mahol
14090b7050 avcodec/get_bits: add av_assert2 to get_bits_long()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-12-18 10:06:29 +01:00
Michael Niedermayer
c72fa43234 avcodec/get_bits: Fix get_sbits_long(0)
Fixes undefined behavior
Fixes: 640889-media

Found-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-03 23:45:43 +01:00
Hendrik Leppkes
e2836397f1 Merge commit '52567e8198669a1e7493c75771613f87a90466c3'
* commit '52567e8198669a1e7493c75771613f87a90466c3':
  get_bits: Drop some TRACE-level debug code

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-06-26 14:19:48 +02:00
Clément Bœsch
bcafc41a5a Merge commit 'ffa190d0479d2370dd89c95692f822cbff2cc24c'
* commit 'ffa190d0479d2370dd89c95692f822cbff2cc24c':
  Move VLC and RL_VLC_ELEM structure definitions to a separate header

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-23 00:29:25 +02:00
Clément Bœsch
6c98398b0b lavc/get_bits: add a logging context to check_marker()
Based on d338abb664
2016-06-22 20:07:49 +02:00
Clément Bœsch
8ef57a0d61 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'
* commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb':
  cosmetics: Fix spelling mistakes

Merged-by: Clément Bœsch <u@pkh.me>
2016-06-21 21:55:34 +02:00
Diego Biurrun
52567e8198 get_bits: Drop some TRACE-level debug code
It will not be provided by the new bit reader anyway.
2016-05-22 20:22:43 +02:00
Alexandra Hájková
ffa190d047 Move VLC and RL_VLC_ELEM structure definitions to a separate header
Use the newly created vlc.h directly instead of including get_bits when needed.
The VLC and RL_VLC_ELEM structures are independent from the bitreader.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-05-17 10:29:27 +02:00
Alexandra Hájková
e4b38878da Move check_marker() from get_bits to mpeg4videodec
MPEG-4 is the only decoder which uses check_marker().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-05-16 10:51:01 +02:00
Vittorio Giovara
41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
Andreas Cadhalpun
62825236db lavc: Add get_bitsz()
get_bit variant supporting 0-bits reads.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-11 21:51:11 +01:00
Kieran Kunhya
46350db737 get_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL 2016-01-11 15:32:57 -05:00
Andreas Cadhalpun
713654d9d3 get_bits: add get_bitsz for reading 0-25 bits
This can be used to simplify code in a couple of places.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-03 21:12:43 +01:00
Kieran Kunhya
906c0b7716 get_bits: Support max_depth > 2 in GET_RL_VLC_INTERNAL 2015-12-13 22:56:49 +00:00
Michael Niedermayer
29d147c94d Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'
* commit '059a934806d61f7af9ab3fd9f74994b838ea5eba':
  lavc: Consistently prefix input buffer defines

Conflicts:
	doc/examples/decoding_encoding.c
	libavcodec/4xm.c
	libavcodec/aac_adtstoasc_bsf.c
	libavcodec/aacdec.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.h
	libavcodec/asvenc.c
	libavcodec/avcodec.h
	libavcodec/avpacket.c
	libavcodec/dvdec.c
	libavcodec/ffv1enc.c
	libavcodec/g2meet.c
	libavcodec/gif.c
	libavcodec/h264.c
	libavcodec/h264_mp4toannexb_bsf.c
	libavcodec/huffyuvdec.c
	libavcodec/huffyuvenc.c
	libavcodec/jpeglsenc.c
	libavcodec/libxvid.c
	libavcodec/mdec.c
	libavcodec/motionpixels.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/noise_bsf.c
	libavcodec/nuv.c
	libavcodec/nvenc.c
	libavcodec/options.c
	libavcodec/parser.c
	libavcodec/pngenc.c
	libavcodec/proresenc_kostya.c
	libavcodec/qsvdec.c
	libavcodec/svq1enc.c
	libavcodec/tiffenc.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/utvideoenc.c
	libavcodec/vc1dec.c
	libavcodec/wmalosslessdec.c
	libavformat/adxdec.c
	libavformat/aiffdec.c
	libavformat/apc.c
	libavformat/apetag.c
	libavformat/avidec.c
	libavformat/bink.c
	libavformat/cafdec.c
	libavformat/flvdec.c
	libavformat/id3v2.c
	libavformat/isom.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/mpc.c
	libavformat/mpc8.c
	libavformat/mpegts.c
	libavformat/mvi.c
	libavformat/mxfdec.c
	libavformat/mxg.c
	libavformat/nutdec.c
	libavformat/oggdec.c
	libavformat/oggparsecelt.c
	libavformat/oggparseflac.c
	libavformat/oggparseopus.c
	libavformat/oggparsespeex.c
	libavformat/omadec.c
	libavformat/rawdec.c
	libavformat/riffdec.c
	libavformat/rl2.c
	libavformat/rmdec.c
	libavformat/rtpdec_latm.c
	libavformat/rtpdec_mpeg4.c
	libavformat/rtpdec_qdm2.c
	libavformat/rtpdec_svq3.c
	libavformat/sierravmd.c
	libavformat/smacker.c
	libavformat/smush.c
	libavformat/spdifenc.c
	libavformat/takdec.c
	libavformat/tta.c
	libavformat/utils.c
	libavformat/vqf.c
	libavformat/westwood_vqa.c
	libavformat/xmv.c
	libavformat/xwma.c
	libavformat/yop.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 23:15:19 +02:00
Vittorio Giovara
059a934806 lavc: Consistently prefix input buffer defines
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:59 +01:00
Michael Niedermayer
8f7b022c8c Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'
* 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-20 04:10:10 +02:00
Vittorio Giovara
6a85dfc830 lavc: Replace av_dlog and tprintf with internal macros 2015-04-19 12:41:59 +01:00
Michael Niedermayer
343f34c0b8 avcodec/get_bits: print details of the location of the missing bit in check_marker()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 15:30:39 +02:00
Vittorio Giovara
351d0f8b7a get_bits: remove unused assignment
Bug-Id: CID 1238816
2014-11-03 10:15:07 -05:00
Michael Niedermayer
8c6cfffa01 Merge commit 'b574e1e97ea7067a5fcd3876e30a67df0e4e6611'
* commit 'b574e1e97ea7067a5fcd3876e30a67df0e4e6611':
  get_bits: Add OPEN_READER macro variant w/o size_plus8

Conflicts:
	libavcodec/get_bits.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-05 19:08:27 +02:00
Diego Biurrun
b574e1e97e get_bits: Add OPEN_READER macro variant w/o size_plus8
This avoids a trillion warnings from MSVC.
2014-09-05 13:55:03 +02:00
Michael Niedermayer
9e59a7be1c Merge commit '91d305790ea0f6fe0f54b48236da42181c39c18b'
* commit '91d305790ea0f6fe0f54b48236da42181c39c18b':
  get_bits: Rename HAVE_BITS_REMAINING --> BITS_AVAILABLE

Conflicts:
	libavcodec/golomb.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-02 22:18:12 +02:00
Diego Biurrun
91d305790e get_bits: Rename HAVE_BITS_REMAINING --> BITS_AVAILABLE
The HAVE_ prefix is reserved for macros set by configure.
2014-09-02 13:10:38 +02:00
Michael Niedermayer
11512d70fa avcodec/get_bits: add BITS_LEFT() for finding the bits left with an opened reader
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 15:15:54 +02:00
Timothy Gu
ea6178fff8 get_bits: remove unused assignment
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-16 14:27:45 +02:00
Michael Niedermayer
e6f9fc4adc avcodec/bitstream: try to make vlc init code inherently thread safe
also remove spinlock, it doesnt work on AIX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-16 20:09:21 +02:00
Matthew Lindner
b372f67342 avcodec: better level/index printing 2014-05-09 22:05:57 +02:00
Michael Niedermayer
6df33c4926 avcodec: include GET_RL_VLC() in trace output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-09 02:03:54 +02:00
Reimar Döffinger
8cbf0827e1 Various small spelling fixes.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-04-22 20:44:31 +02:00
Michael Niedermayer
44e8e82d34 avcodec/get_bits: add skip_1stop_8data_bits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-30 18:22:03 +01:00
Michael Niedermayer
54197c7aae skip_bits: dont call UPDATE_CACHE
UPDATE_CACHE isnt needed and can cause segfaults

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-30 14:34:12 +02:00
Michael Niedermayer
121fc05b4d avcodec/get_bits: place volatile at the right spot
Should fix Ticket2825

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-30 20:55:54 +02:00
Michael Niedermayer
43411f416f avcodec/get_bits: init_state is used for thread sync, make it volatile
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-30 20:38:19 +02:00
Michael Niedermayer
6af8326354 avcodec/ff_init_vlc_sparse: use a spinlock for thread sync
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-29 16:48:41 +02:00
Paul B Mahol
48f2750de8 get_bits: add get_bits_le()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-07-05 16:51:08 +00:00
Michael Niedermayer
ff130d7363 get_xbits: assert validity of the number of bits
similar is already done in the other get_bits() functions

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-30 01:40:18 +02:00
Ronald S. Bultje
9918f57dcf get_bits: Return pointer to buffer that is the result of the alignment
This allows more transparent mixing of get_bits and whole-byte access
without having to touch get_bits internals.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-02-19 22:33:52 +02:00
Ronald S. Bultje
fd6a021d8e get_bits: return pointer to buffer that is the result of the alignment.
This allows more transparent mixing of get_bits and whole-byte access
without having to touch get_bits internals.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-11 02:29:43 +01:00
Michael Niedermayer
766f055201 Merge commit '4af5310d29379283553bcd9f541a3f6c317f706e'
* commit '4af5310d29379283553bcd9f541a3f6c317f706e':
  get_bits/put_bits: K&R formatting cosmetics

Conflicts:
	libavcodec/get_bits.h
	libavcodec/put_bits.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 13:49:45 +01:00
Diego Biurrun
4af5310d29 get_bits/put_bits: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-01-21 17:03:41 +01:00