1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

36956 Commits

Author SHA1 Message Date
Michael Niedermayer
daccbe81a2 avcodec/mjpegenc: Drop i_tex misuse, set itex/header bits correctly, fix 2pass encoding
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-10 00:12:01 +01:00
Michael Niedermayer
e10bd12c25 avcodec/mjpegenc: Remove non functional huffman reallocation and error handling
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>
2017-02-10 00:12:01 +01:00
Rostislav Pehlivanov
53234b9ba5 tests/mjpegenc_huffman: align static tables
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-02-09 03:08:50 +00:00
Rostislav Pehlivanov
a70f0927ea mjpegenc: use s->avctx as a context for av_log rather than NULL
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-02-09 03:01:58 +00:00
Rostislav Pehlivanov
20614e868b tests/mjpegenc_huffman: replace assert() with av_assert0()
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-02-09 02:59:22 +00:00
Rostislav Pehlivanov
d164ef6589 mjpegenc_common: add missing ff_ prefix to init_uni_ac_vlc
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-02-09 02:56:13 +00:00
Mark Thompson
d1acab8293 vaapi_encode: Add VP8 support
Fixes ticket #6116.

(cherry picked from commit ca62236a89)
2017-02-08 19:14:05 +00:00
Mark Thompson
be6546a4ff vaapi_encode: Pass framerate parameters to driver
Only do this when building for a recent VAAPI version - initial
driver implementations were confused about the interpretation of the
framerate field, but hopefully this will be consistent everywhere
once 0.40.0 is released.

(cherry picked from commit ff35aa8ca4)
2017-02-08 19:14:05 +00:00
Mark Thompson
2201c02e6d vaapi_h264: Enable VBR mode
Default to using VBR when a target bitrate is set, unless the max rate
is also set and matches the target.  Changes to the Intel driver mean
that min_qp is also respected in this case, so set a codec default to
unset the value rather than using the current default inherited from
the MPEG-4 part 2 encoder.

(cherry picked from commit eddfb57210)
2017-02-08 19:14:05 +00:00
Mark Thompson
ceb28c3cc4 vaapi_encode: Support VBR mode
This includes a backward-compatibility hack to choose CBR anyway on
old drivers which have no CBR support, so that existing programs will
continue to work their options now map to VBR.

(cherry picked from commit f033ba470f)
2017-02-08 19:14:05 +00:00
Mark Thompson
3b95c7c17d vaapi_encode: Add MPEG-2 support
(cherry picked from commit ca6ae3b77a)
2017-02-08 19:14:05 +00:00
Mark Thompson
eefa4b76ee vaapi_h264: Scale log2_max_pic_order_cnt_lsb with max_b_frames
Before this change, it was possible to overflow pic_order_cnt_lsb and
generate a stream with invalid POC numbering.  This makes sure that
the field is large enough that a single IDR B* P sequence uses fewer
than half the available POC lsb values.

(cherry picked from commit 89725a8512)
2017-02-08 19:14:05 +00:00
Mark Thompson
c667c0979c vaapi_encode: Support forcing IDR frames via AVFrame.pict_type
(cherry picked from commit a3c3a5eac2)
2017-02-08 19:14:04 +00:00
Mark Thompson
760f1a7727 vaapi_encode: Fix GOP sizing
This change makes the configured GOP size be respected exactly -
previously the value could be exceeded slightly due to flaws in the
frame type selection logic.

(cherry picked from commit 37fab0661a)
2017-02-08 19:14:04 +00:00
Mark Thompson
37de9ce713 vaapi_h265: Fix CFR mode with framerate set in AVCodecContext
Same issue as 17a0f9481c.

(cherry picked from commit 7d81698b89)
2017-02-08 19:14:04 +00:00
Mark Thompson
b9514756ba vaapi_h265: Add main 10 encode support
(cherry picked from commit 5a5df90d9c)
(cherry picked from commit d08e02d929)
2017-02-08 19:14:04 +00:00
Michael Niedermayer
c03029a835 avcodec/h264_slice: Clear ref_counts on redundant slices
Fixes reading freed memory
Fixes: 568/clusterfuzz-testcase-6107186067406848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-08 18:31:04 +01:00
Jerry Jiang
884506dfe2 Implement optimal huffman encoding for (M)JPEG.
> seems to break
> make fate-vsynth1-mjpeg-444

Fixed.
2017-02-08 13:59:53 +00:00
Rl
1835ed19bb libavcodec/cinepak.c: fix a wrong (inverted) misleading comment
Make the comment message understandable and correct.
2017-02-07 23:31:25 +01:00
Derek Buitenhuis
91ed4e7196 avcodec: Mark some codecs with threadsafe init as such
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-07 23:31:25 +01:00
Michael Niedermayer
8c2ea3030a avcodec/pictordec: Fix logic error
Fixes: 559/clusterfuzz-testcase-6424225917173760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-07 21:32:08 +01:00
Michael Niedermayer
e248522d1b avcodec/movtextdec: Fix decode_styl() cleanup
Fixes: null pointer dereference
Fixes: 555/clusterfuzz-testcase-5986646595993600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-06 11:19:05 +01:00
Michael Niedermayer
1e5cfad57e avcodec/pthread_frame: Check av_packet_ref() for failure
Fixes CID1396242
2017-02-06 01:01:33 +01:00
Michael Niedermayer
e477f09d0b avcodec/pngdec: Check trns more completely
Fixes out of array access
Fixes: 546/clusterfuzz-testcase-4809433909559296

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-04 13:22:29 +01:00
Rostislav Pehlivanov
084f3addda opus_rc: rename total_bits_used to total_bits and #define some constants
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-02-04 12:07:52 +00:00
Michael Niedermayer
b1e2192007 avcodec/interplayvideo: Move parameter change check up
Fixes out of array read
Fixes: 544/clusterfuzz-testcase-5936536407244800.f8bd9b24_8ba77916_70c2c7be_3df6a2ea_96cd9f14

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-04 02:45:46 +01:00
Michael Niedermayer
831274fba4 avcodec/flacdsp: Avoid undefined operations in non debug builds
This fixes ubsan warnings in non debug builds by using unsigned operations

in debug builds the correct signed operations are retained so that overflows
(which should not occur in valid files and may indicate problems in the DSP code
or decoder) can be detected.

Alternatively they can be changed to unsigned unconditionally, then its
not possible though to detect overflows easily if someone wants to test
the DSP code for overflows.

The 2nd alternative would be to leave the code as it is and accept that
there are undefined operations in the DSP code and that ubsan output is
full of them in some cases.

Similar changes would be needed in some other DSP routines

Suggested-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-04 02:27:53 +01:00
Michael Niedermayer
fd00203554 avcodec/flacdec: Check for invalid vlcs
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-04 02:26:37 +01:00
Paul B Mahol
c331be21c4 avcodec/ivi: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-03 20:36:23 +01:00
Paul B Mahol
2b707018bc avcodec/metasound: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-03 20:29:27 +01:00
Paul B Mahol
7ecdc03ea3 avcodec/xsubdec: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-03 20:25:53 +01:00
Paul B Mahol
f09afb4a90 avcodec/mpc7: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-03 20:16:30 +01:00
Paul B Mahol
6a6e20bfdf avcodec/mpc7: return meaningful error values
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-03 20:15:00 +01:00
Paul B Mahol
207fa224a0 avcodec/mpc8: use init_get_bits8()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-03 20:01:07 +01:00
Michael Niedermayer
39afd0482f avcodec/ituh263dec: Implement U263s interpretation of H.263 B frames
Fixes Ticket1536

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-03 03:33:37 +01:00
Michael Niedermayer
ad7a3f5294 avcodec/utils: Fix memleak with subtitles and sidedata
Fixes: 454/fuzz-3-ffmpeg_SUBTITLE_AV_CODEC_ID_MOV_TEXT_fuzzer

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-03 00:27:28 +01:00
James Almer
c8467abbad x86/rv34dsp: add ff_rv34_idct_dc_add_sse2
Also disable ff_rv34_idct_dc_add_mmx on x86_64 as the presence of sse2
is guaranteed in such builds.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-02-02 17:51:21 -03:00
James Almer
ab5c4d006d x86/vp8dsp: add ff_vp8_idct_dc_add_sse2
Also disable ff_vp8_idct_dc_add_mmx on x86_64 as the presence of sse2
is guaranteed in such builds.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-02-02 17:18:58 -03:00
addr-see-the-website@aetey.se
712ad6b661 libavcodec/cinepakenc.c: comments cleanup (contents)
Change the encoding of the original developer name from ISO-8859-1 to UTF-8.
Remove the stale/completed TODO list.
Fix two small typos.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-02 16:31:13 +01:00
Michael Niedermayer
61f70416f8 avcodec/dca_lbr: Fix off by 1 error in freq check
Fixes out of array read
Fixes: 510/clusterfuzz-testcase-5737865715646464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-02 15:48:50 +01:00
Steinar H. Gunderson
08b098169b speedhq: fix out-of-bounds write
Certain alpha run lengths (for SHQ1/SHQ3/SHQ5) could be stored in
both long and short versions, and we would only accept the short version,
returning -1 (invalid code) for the others. This could cause an
out-of-bounds write on malicious input, as discovered by
Andreas Cadhalpun during fuzzing.

Fix by simply allowing both versions, leaving no invalid codes
in the alpha VLC.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2017-02-02 01:12:07 +01:00
Michael Niedermayer
0126cd95cc avcodec/ituh263dec: Correct timestamp recovery for B frames
Improves u263_b-frames_5.avi

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-01 22:01:34 +01:00
Paul B Mahol
71ca855c9d avcodec/wmalosslessdec: remove warning message as bug is fixed
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-02-01 19:35:24 +01:00
bnnm
c61b28e042 avcodec/atrac3: Add multichannel joint stereo ATRAC3
Multichannel joint stereo simply interleaves stereo pairs (6ch: 2ch + 2ch + 2ch), so each pair is decoded separatedly.

***

To test my changes, I converted examples to wav with ffmpeg.exe (old and new), and compared them to see they are byte-exact.

Regular 2ch files (JS and normal) were straightforward to test.

For multichannel, to check each JS pair is correctly decoded separatedly I did:
- manually demux 6ch.msf into 3 pairs and convert them (2ch_1.wav + 2ch_2.wav + 2ch_3.wav)
- convert the 6ch.msf file to wav (with my changes)
- manually demux the 6ch.wav into 3 pairs (6ch_d1.wav + 6ch_d2.wav + 6ch_d3.wav)
- compare each pair (ex. 2ch_3.wav vs 6ch_d3.wav): all pairs are byte-exact.

The new code just processes each JS pair separatedly, there are no algorithm changes.
It could be improved a bit but I'm not sure about typical styles.
I've only seen 6ch .MSF (probably the AT3 spec only supports 2ch audio).

Signed-off-by: bnnm <bananaman255@gmail.com>
2017-02-01 19:14:12 +01:00
Michael Niedermayer
4f651c723b avcodec/h263: Remove disabled and wrong code from ff_h263_loop_filter()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-01 19:09:27 +01:00
Michael Niedermayer
901c625494 avcodec/ituh263dec: Use correct error codes in ff_h263_decode_mb()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-01 19:09:27 +01:00
Michael Niedermayer
e00c516d1e avcodec/ituh263dec: Correct indention
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-01 19:09:27 +01:00
Carl Eugen Hoyos
aecdb14ad9 lavc/error_resilience: Remove two unused variables. 2017-02-01 17:51:59 +01:00
Michael Niedermayer
b28ae1e09b avcodec/ituh263dec: Implement B frame support with UMV
Fixes: u263_b-frames_1.avi
Fixes part of Ticket1536

return -1 is used here as it is used in similar code in this function, I intend
to replace it by proper error codes in the whole function.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-01 17:35:54 +01:00
Clément Bœsch
26d5caf679 Merge commit 'a1f6a2dfdaf9beb42ca66e49d10bfaf5905a0128'
* 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-01 14:50:21 +01:00