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

19849 Commits

Author SHA1 Message Date
Michael Niedermayer
894545cb71 mpegvideo: exit cleanly when ff_mpv_common_frame_size_change() fails
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-03 12:52:53 +00:00
Michael Niedermayer
7a38987f24 mpegvideo: free_context_frame() cannot fail, make it return void
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 12:52:04 +00:00
Michael Niedermayer
c45eeb2dbf mpegvideo: replace assert about interlaced EC with debug av_log()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 12:51:43 +00:00
Michael Niedermayer
3a56bcee7c mpeg12dec: Use more specific error codes
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-03 12:50:52 +00:00
Michael Niedermayer
b56afb48ae mpeg12dec: Print error/warning messages on issues in mpeg1_decode_sequence()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 12:44:58 +00:00
Gonzalo Garramuno
e0bb74a140 exr: Add a gamma flag to exr loader to avoid banding
This is needed to avoid banding artifacts when gammaing the picture.
Currently, if done with a video filter, the process is done on uints
instead of full float.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-12-03 02:55:40 +00:00
Michael Niedermayer
d69d787dad h264: proper cleanup in ff_h264_alloc_tables() if DPB alloc fails
CC: libav-devel@libav.org
2014-12-03 02:51:27 +00:00
Dale Curtis
56de2897a6 h264: Fix memory leak on ff_h264_decode_init() failure
CC: libav-devel@libav.org
2014-12-03 02:51:18 +00:00
Jon Morley
26e20dfd06 options_table: fix colorspace minimum option value
The min value for colorspace should be zero and not one since the first
valid index into the frame colorspace array is AVCOL_SPC_RGB which is 0.
2014-12-02 15:28:22 +00:00
Luca Barbato
7464e98f74 aac: Simplify decode_mid_side_stereo
Might spare few cycles if the compiler is naive and
makes the function more readable.
2014-12-02 15:28:22 +00:00
Anton Khirnov
1973079417 opusdec: make sure all substreams have the same number of coded samples
Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org
2014-11-27 14:06:03 +01:00
Martin Storsjö
f20141d73f vorbis_parser: Include stdint.h in the header, to make it work standalone
This fixes "make checkheaders".

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-25 14:01:46 +02:00
Michael Niedermayer
57ed5a64fe hnm4: change width/height to int to fix hypothetical integer overflows
CC: libav-stable@libav.org
Bug-Id: CID 1135770 / CID 1135771
2014-11-25 02:00:06 +00:00
Luca Barbato
16158da960 hnm4: Use av_image_check_size
As done for all the other codecs not calling it indirectly.

CC: libav-stable@libav.org
Bug-Id: CID 1135770 / CID 1135771
2014-11-25 02:00:06 +00:00
Michael Niedermayer
51946d2de8 vc1: Use the correct shift amount
`is_intra` is a 6bits bitfield.

CC: libav-stable@libav.org
Bug-Id: CID 1194380 / CID 1194381

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-11-25 02:00:06 +00:00
Luca Barbato
d25afb579f vc1: Set the is_intra bitfield to all 1 when needed
Keep the code as similar as possible across the codepaths to
ease spotting it for factorization.

Based on a patch from Michael Niedermayer <michaelni@gmx.at>.
2014-11-25 02:00:06 +00:00
Luca Barbato
b67138598c vc1: Simplify a little setting the intra variables
The code currently set the information in at least 4 places, spare
some pointless loops.

Make the code in the loop a little uniform to make easier factorize
it out later.
2014-11-25 02:00:06 +00:00
Michael Niedermayer
62e52b94e6 vorbis_parser: Move vp check to avoid a null pointer dereference
CC: libav-stable@libav.org
Bug-Id: CID 1251347
2014-11-25 02:00:06 +00:00
Michael Niedermayer
c117da9d3e lpc: remove unneeded {}
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-25 02:00:06 +00:00
Vittorio Giovara
bc75b64cff vc1pred: remove logically dead code
CC: libav-stable@libav.org
Bug-Id: CID 1245699 / CID 1245700
2014-11-25 02:00:06 +00:00
Vittorio Giovara
208f3abb91 aacsbr: always initialize max_qmf_subbands
Fixes a wordly warning from clang -Wsometimes-uninitialized.
2014-11-24 01:30:15 +00:00
Michael Niedermayer
55b59fab88 roqaudio: Always use the frame buffer on flush
Prevent NULL dereference.

CC: libav-stable@libav.org
Bug-Id: CID 703669
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-24 01:30:15 +00:00
Vittorio Giovara
0562887a98 tiffenc: initialize return value
'ret' can only be used without initialization if s->height <= 0, which can
only happen if avctx->height <= 0, which is validated elsewhere. Doesn't hurt
to still initialize it though.

CC: libav-stable@libav.org
Bug-Id: CID 732296
2014-11-24 01:30:15 +00:00
Luca Barbato
299d8ab104 cook: Make sure there is enough extradata
At least 8 bytes are needed (Mono audio).

Bug-Id: CID 741418
CC: libav-stable@libav.org
2014-11-24 01:30:15 +00:00
Vittorio Giovara
b99ca86350 aacdec: avoid an out-of-bounds write
Also move the check in the case it is actually used.

CC: libav-stable@libav.org
Bug-Id: CID 1087090
2014-11-24 01:30:15 +00:00
Vittorio Giovara
277ff7f5dc lavu: move internal define to the only places where it is used 2014-11-24 01:30:14 +00:00
Vittorio Giovara
9c12c6ff95 motion_est: convert stride to ptrdiff_t
CC: libav-stable@libav.org
Bug-Id: CID 700556 / CID 700557 / CID 700558
2014-11-24 01:30:10 +00:00
Luca Barbato
cd975d5658 hevc: Spin the mv_mpv_mode calls in a stand alone function
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-11-21 23:17:37 +01:00
Vittorio Giovara
1f80742f49 qdm2: avoid integer overflow
CC: libav-stable@libav.org
Bug-Id: CID 700555
2014-11-21 12:37:50 +00:00
Luca Barbato
312daa1589 vp9: Use the correct upper bound for seg_id
And use a macro to make apparent why the value.

Bug-Id: CID 1108595
2014-11-21 12:37:05 +00:00
Luca Barbato
d466d82faa dvdsubdec: Do not leak on failure path
CC: libav-stable@libav.org
Bug-Id: CID 1198262
2014-11-21 12:36:19 +00:00
Vittorio Giovara
a42d5c861f libtwolame: prevent a NULL pointer dereference
CC: libav-stable@libav.org
Bug-Id: CID 1250330 / CID 1250335
2014-11-21 12:27:07 +00:00
Martin Storsjö
aa8b39d999 lavc: Move the libtwolame encoder registration to the list for external libraries
This makes sure the default behaviour of using the internal encoder
stays the same regardless if libtwolame is enabled or not (as for
any external library).

This fixes fate-lavf-mpg if libav is built with libtwolame enabled.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-21 12:27:07 +00:00
Vittorio Giovara
85dc006b1a lavc: fix bitshifts amount bigger than the type
CC: libav-stable@libav.org
Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638
2014-11-18 00:39:23 +01:00
Vittorio Giovara
771656bd85 libvpxenc: clean memory on error
CC: libav-stable@libav.org
Bug-Id: CID 733795
2014-11-18 00:38:56 +01:00
Anton Khirnov
8b573ddda7 hevc: remove superfluous assignments and checks 2014-11-17 09:26:45 +01:00
Anton Khirnov
eac3ac1fe0 hevc: eliminate an unneeded intermediate variable 2014-11-17 09:26:45 +01:00
Anton Khirnov
eb335f3c5c hevc: reduce variable scope
Also, collapse the array into a scalar, since only one value is needed
at a time.
2014-11-17 09:26:45 +01:00
Anton Khirnov
84c0ece5fd hevc: further reduce code duplication in hls_prediction_unit() 2014-11-17 09:25:15 +01:00
Anton Khirnov
a7b365ae19 hevc: reduce code duplication in hls_prediction_unit() 2014-11-17 09:25:12 +01:00
Anton Khirnov
de1f8ead89 hevcdsp_template: templatize transquant_bypass 2014-11-17 09:25:12 +01:00
Anton Khirnov
16c01fb434 hevc: remove an unused function parameter 2014-11-17 09:25:12 +01:00
Anton Khirnov
84b9463984 hevc: remove a redundant line
pred_mode is overwritten a few lines immediately below.
2014-11-17 09:25:12 +01:00
Anton Khirnov
2c6a7f9348 hevc: do not store rqt_root_cbf in the context
It does not need to be accessed outside of hls_coding_unit().
2014-11-17 09:25:12 +01:00
Anton Khirnov
920bca3e23 hevc: do not store pcm_flag in the context
It does not need to be accessed outside of hls_coding_unit().
2014-11-17 09:25:12 +01:00
Martin Storsjö
c00365b46d aarch64: Make the function pointer tables position independent
This allows running the code on android, where 64 bit binaries with
text relocations aren't allowed to be loaded.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-16 01:07:24 +02:00
Michael Niedermayer
2fa6d21124 on2avc: Fix out of array access
CC: libav-stable@libav.org
Bug-Id: CID 1206648
2014-11-15 12:50:05 +01:00
Luca Barbato
74d7db586a dv: Drop a spurious check
The buffer is always valid.

Bug-Id: CID 700682
2014-11-15 12:49:37 +01:00
Vittorio Giovara
d16ec1b6db atrac3plus: always initialize refwaves
CC: libav-stable@libav.org
Bug-Id: CID 1163851
2014-11-14 20:26:32 +01:00
Vittorio Giovara
60e0ee7ca2 lpc: always initialize ref and err
CC: libav-stable@libav.org
Bug-Id: CID 29585 / CID 700759
2014-11-14 20:25:52 +01:00
Vittorio Giovara
3a6ddfb874 exr: check return value
CC: libav-stable@libav.org
Bug-Id: CID 1198259
2014-11-14 20:25:21 +01:00
Thilo Borgmann
e4cb6abb2f bgmc: fix sizeof arguments
CC: libav-devel@libav.org
Bug-Id: CID 608084 / CID 700724
2014-11-14 20:25:02 +01:00
Vittorio Giovara
a2448cfe16 jpeg2000: do not compute the same value twice
CC: libav-stable@libav.org
Bug-Id: CID 1026771 / CID 1026772 / CID 1026773
2014-11-13 01:41:27 +01:00
Vittorio Giovara
59846452af svq1enc: check ff_get_buffer return value
CC: libav-stable@libav.org
Bug-Id: CID 747723
2014-11-13 01:41:27 +01:00
Vittorio Giovara
994ab1804b ansi: check ff_set_dimensions return value
CC: libav-stable@libav.org
Bug-Id: CID 1135737
2014-11-13 01:41:27 +01:00
Vittorio Giovara
c7384664ba avs: check ff_set_dimensions return value
CC: libav-stable@libav.org
Bug-Id: CID 1135738
2014-11-13 01:41:27 +01:00
Vittorio Giovara
2b5c1efa14 g2meet: check ff_set_dimensions return value
CC: libav-stable@libav.org
Bug-Id: CID 1135739
2014-11-13 01:41:26 +01:00
Vittorio Giovara
c6d7c201df indeo3: check ff_set_dimensions return value
CC: libav-stable@libav.org
Bug-Id: CID 1135740
2014-11-13 01:41:26 +01:00
Vittorio Giovara
8e104619a6 shorten: check for return value
Avoid a possible negative bitshift.

CC: libav-stable@libav.org
Bug-Id: CID 1194400
2014-11-13 01:41:26 +01:00
Vittorio Giovara
d5d2d6c3b8 dcadec: initialize variables before use
CC: libav-stable@libav.org
Bug-Id: CID 700751 / CID 700752
2014-11-13 01:41:26 +01:00
Vittorio Giovara
1a9c1333b5 escape124: explicitly set get_bits1 variable
Makes coverity less confused.

CC: libav-stable@libav.org
Bug-Id: CID 1203487
2014-11-13 01:41:26 +01:00
Vittorio Giovara
2ffb0598db mlpdec: check for negative index
CC: libav-stable@libav.org
Bug-Id: CID 970924
2014-11-13 01:41:26 +01:00
Vittorio Giovara
6abe7edabb ffv1: fix out-of-bounds read
CC: libav-stable@libav.org
Bug-Id: CID 1047234
2014-11-13 01:41:26 +01:00
Vittorio Giovara
5aa710f461 vorbisenc: add missing parenthesis
Bug-Id: CID 1238791
2014-11-13 01:41:26 +01:00
Vittorio Giovara
e9a6ae775d dpxenc: mention missing break
Bug-Id: CID 732229
2014-11-13 01:41:26 +01:00
Vittorio Giovara
4dda5e9b08 sunrastenc: mention missing break
Bug-Id: CID 732231
2014-11-13 01:41:26 +01:00
Vittorio Giovara
28d82b7675 vc1dec: refactor check with missing parenthesis
FATE tests updated accordingly, no visual difference.

CC: libav-stable@libav.org
Bug-Id: CID 1087087
2014-11-13 01:41:25 +01:00
Vittorio Giovara
2c98dc75f2 vc1dec: always initialize tx and ty
CC: libav-stable@libav.org
Bug-Id: CID 1245702 / CID 1245703
2014-11-13 01:41:25 +01:00
Vittorio Giovara
e3f50f2471 dnxhdenc: check negative index
CC: libav-stable@libav.org
Bug-Id: CID 700464
2014-11-13 01:41:25 +01:00
Vittorio Giovara
b1b1a7370e display: fix order of operands
CC: libav-stable@libav.org
Bug-Id: CID 1238828 / CID 1238832
2014-11-13 01:41:25 +01:00
Vittorio Giovara
bdcb5794f0 nellymoserenc: fix array index
CC: libav-stable@libav.org
Bug-Id: CID 732258
2014-11-13 01:41:25 +01:00
Michael Niedermayer
aa7c429c4e nellymoserenc: fix array element ordering
Fixes assertion failures and valgrind warnings in trellis encoder.

CC: libav-stable@libav.org
Bug-Id: CID 732256 / CID 732257
2014-11-13 01:41:25 +01:00
Vittorio Giovara
8dd0a2c5cf libopusenc: prevent an out-of-bounds read by returning early
CC: libav-stable@libav.org
Bug-Id: CID 1244188
2014-11-13 01:41:25 +01:00
Vittorio Giovara
b09cf8afc5 libopusenc: check return value
CC: libav-stable@libav.org
Bug-Id: CID 739870
2014-11-13 01:41:25 +01:00
Michael Niedermayer
29234f5681 vp7: fix checking vp7_feature_value_size()
CC: libav-stable@libav.org
Bug-Id: CID 1197061
2014-11-13 01:41:25 +01:00
Vittorio Giovara
68a35473ed 4xm: more thorought check for negative index and negative shift
CC: libav-stable@libav.org
Bug-Id: CID 1087094
2014-11-13 01:18:09 +01:00
Luca Barbato
c9c7d59b7d tiff: Use av_mallocz_array
CC: libav-stable@libav.org
2014-11-11 12:01:00 +01:00
John Stebbins
1b66726906 h264_parser: don't stop on SPS_EXT in split
Add SPS_EXT, SEI, and subset SPS to codes that are skipped during split.
These codes can come before the PPS and results in incomplete extradata.
2014-11-11 11:49:55 +01:00
Michael Niedermayer
4cb9f1a774 h264_cabac: fix one fill_rectangle() indentation level
Bug-Id: CID 1087088
2014-11-11 11:49:54 +01:00
Vittorio Giovara
60b0551334 png_parser: fix size of chunk_lenght
Fixes the comparison against constant value 0x7fffffff.

CC: libav-stable@libav.org
Bug-Id: CID 1198260
2014-11-11 11:49:54 +01:00
Vittorio Giovara
443502aed8 dvbsubdec: move shared codepath
CC: libav-stable@libav.org
Bug-Id: CID 1238839
2014-11-11 11:49:54 +01:00
Vittorio Giovara
2383323661 dvbsubdec: improve error checking
Use av_mallocz_array instead of iterating and check the returned memory.
Check returned memory and cleanly exit in case of error during the loop.
Avoid a null pointer dereference for invalid data.

CC: libav-stable@libav.org
Bug-Id: CID 29575
2014-11-11 11:49:54 +01:00
Jernej Fijačko
1bdd21d975 dvbsubdec: add missing break
Fix a memory leak too.

CC: libav-stable@libav.org
Bug-Id: CID 732230
2014-11-11 11:49:54 +01:00
Michael Niedermayer
a6defd1f5b hevc_cabac: decrease CABAC_MAX_BIN
Prevents shifts with undefined behavior, as no syntax element has a valid
value greater than 1 << 31.

Bug-Id: CID 1206635
2014-11-11 11:49:54 +01:00
Vittorio Giovara
9e9be5a20c hevc_mvs: prevent unitialized use
CC: libav-stable@libav.org
Bug-Id: CID 1244202
2014-11-11 11:49:47 +01:00
Vittorio Giovara
0e1ebfebc8 4xm: drop unnecessary check
data_size is always >= 0 in this case.

CC: libav-stable@libav.org
Bug-Id: CID 1238788
2014-11-11 11:41:49 +01:00
Michael Niedermayer
7c61e4b1a0 hpeldsp: Increase put_no_rnd_pixels_tab[][] size
CC: libav-stable@libav.org
Bug-Id: CID 991852
2014-11-11 11:41:49 +01:00
Vittorio Giovara
db71c4926d mjpegenc: fix argument size in encode_mb
CC: libav-stable@libav.org
Bug-Id: CID 1047235
2014-11-11 11:41:49 +01:00
Vittorio Giovara
f349f4b550 mpegvideo: fix size of array
CC: libav-stable@libav.org
Bug-Id: CID 1238789
2014-11-11 11:26:02 +01:00
Vittorio Giovara
898e9a24ef mpegvideo: check mpv return value
CC: libav-stable@libav.org
Bug-Id: CID 1238786
2014-11-11 11:26:02 +01:00
Michael Niedermayer
fe27aeaeab mpeg12enc: increase declared size of block function argument
CC: libav-stable@libav.org
Bug-Id: CID 1047236
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-11 11:26:02 +01:00
Martin Storsjö
52f954da75 libavcodec: Unconditionally build xiph.o
vorbis_parser.o is built unconditionally since 5e80fb7ff, and the
unconditionally built parts of it depend on xiph.o.

This fixes builds with --disable-everything.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-11 12:01:16 +02:00
Martin Storsjö
28396d17ff libfdk-aacdec: Support building with the latest version of fdk-aac
The latest fdk-aac code drop (from android 5.0) changed the channel
layout enums (changing the value of existing enum constants), and
renamed the option for downmixing.

The failsafe comparison between ctype and FF_ARRAY_ELEMS(channel_counts)
can trigger warnings (-Wtautological-constant-out-of-range-compare)
when building with the old FDK AAC releases, where it can't be
out of range with the enum values used there.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-10 09:43:57 +02:00
Luca Barbato
e3e317e0c0 lavc: Compact the side-data passthrough 2014-11-09 12:29:59 +01:00
Vittorio Giovara
199d9f995d mjpegdec: fix undefined shift
Add a comment to explain the code.

CC: libav-stable@libav.org
Bug-Id: CID 1194388
2014-11-06 10:44:46 -05:00
Luca Barbato
ac4a5e3abd pthreads_frame: Do not leak on failure path
CC: libav-stable@libav.org
Bug-Id: CID 1135767
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-11-06 10:44:46 -05:00
Vittorio Giovara
5d29efe4b0 mpeg12dec: simplify context duplication
CC: libav-stable@libav.org
Bug-Id: CID 717453 / CID 717454 / CID 717915
2014-11-06 10:44:46 -05:00
Vittorio Giovara
37b3361e75 mpeg12enc: factor out check in encode_dc
Makes coverity less confused and the code more readable.

CC: libav-stable@libav.org
Bug-Id: CID 751744
2014-11-06 10:44:46 -05:00
Vittorio Giovara
0a66647061 mpegvideo_enc: factor out denominator and explicitly cast operands
CC: libav-stable@libav.org
Bug-Id: CID 608053
2014-11-06 10:44:46 -05:00
Vittorio Giovara
e0a1d0a2b0 mpegvideo_enc: rework direct mode check
Remove stray semicolon and share codepaths.

CC: libav-stable@libav.org
Bug-Id: CID 991857
2014-11-06 10:44:46 -05:00
Anton Khirnov
acc897e6b1 lavc: make avpriv_flac_is_extradata_valid() private on the next bump 2014-11-06 09:04:56 +01:00
Anton Khirnov
c070a87515 lavc: make avpriv_flac_parse_streaminfo() private on the next bump 2014-11-06 09:04:12 +01:00
Anton Khirnov
7784f47762 lavf: stop using avpriv_flac_parse_streaminfo()
The only parameters needed by the demuxers are the sample rate and sample
count, which can be trivially extracted manually, without resorting to
an avpriv function.
2014-11-06 09:02:25 +01:00
Anton Khirnov
2f3fadfbe3 lavc,lavf: switch to the new vorbis parse API 2014-11-06 09:00:46 +01:00
Anton Khirnov
5e80fb7ff2 lavc: add a public API for parsing vorbis packets.
It is required by (at least) the ogg demuxer.

Mark the current semi-public apriv API for removal.
2014-11-06 08:51:25 +01:00
Anton Khirnov
6896f95b24 vorbis_parser: add an AV prefix to VorbisParseContext
This is done in preparation for making it public.
2014-11-06 08:47:54 +01:00
Anton Khirnov
874792641e vorbis_parser: use a dedicated AVClass for logging
Currently, the API takes an external AVCodecContext, which is used only
for extradata and logging. This change will allow to it to work without
an AVCodecContext in the following commits.
2014-11-06 08:47:21 +01:00
Rémi Denis-Courmont
4ff670d99b hwaccel: Deinitialize hardware acceleration early enough
The application will destroy the underlying hardware handles when
get_format() gets called again. Also this ensures the
deinitialization takes place if the get_format callback returns an
error.

Regression from 1c80c9d7ef.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-11-04 22:15:17 +01:00
Vittorio Giovara
77ab341c0c aacdec: add default case in channel layout
Bug-Id: CID 732291
2014-11-04 09:28:45 -05:00
Michael Niedermayer
930ffd46e1 aacsbr: change order of operation to prevent out of array read
CC: libav-stable@libav.org
Bug-Id: CID 732250
2014-11-04 09:28:45 -05:00
Vittorio Giovara
9f6f407463 aacsbr: treat 1-d arrays as such
CC: libav-stable@libav.org
Bug-Id: CID 1238802 / CID 1238793 / CID 1238785
        CID 1238808 / CID 1238809
2014-11-03 12:46:18 -05:00
Vittorio Giovara
f52b871761 celp_filters: don't use filter lenght as loop bound
CC: libav-stable@libav.org
Bug-Id: CID 717906 / CID 717907 / CID 717916 /
        CID 717917 / CID 717919 / CID 732259
2014-11-03 12:45:42 -05:00
Vittorio Giovara
c442190a6b error_resilience: initialize prev_* variables
CC: libav-stable@libav.org
Bug-Id: CID 732293 / CID 732294
2014-11-03 12:45:09 -05:00
Vittorio Giovara
240b22afe1 motion_est: remove dead code
mb_type is initialized to 0 and never updated before the check.

Bug-Id: CID 1238782
2014-11-03 10:15:53 -05:00
Vittorio Giovara
351d0f8b7a get_bits: remove unused assignment
Bug-Id: CID 1238816
2014-11-03 10:15:07 -05:00
Rémi Denis-Courmont
ce91b2eae6 vdpau: return MAIN instead of BASELINE for H.264 CBP
This is the same as the previous change, but for applications using the
old API (such as VLC 2.2).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-28 07:06:33 +01:00
Rémi Denis-Courmont
26ab504ad8 vdpau/h264: request MAIN rather than BASELINE VDPAU profile for CBP
The H.264 Constrained Baseline Profile (CBP) is a subset of both the
Main Profile and the Baseline Profile. In principles, a hardware
decoder that supports either of those can decode CBP content. As it
happens, Main is supported by all VDPAU drivers, and Baseline is not.

So favor map CBP to MP for now. Hopefully in the future libvdpau will
offer an explicit choice for CBP.

This fixes bug 757.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-28 07:06:13 +01:00
Olivier Langlois
6fdf35fe35 lavc: Use av_gettime_relative
Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:42 +03:00
Anton Khirnov
530c1441fd lavc: make lmax/lmin into private options of mpegvideo encoders 2014-10-18 05:29:14 +02:00
Anton Khirnov
15ec053c4c lavc: make border_masking into private options of mpegvideo encoders 2014-10-18 05:28:40 +02:00
Anton Khirnov
c4f7bee087 lavc: deprecate unused mb_threshold field 2014-10-18 05:28:29 +02:00
Anton Khirnov
685be3d1ae libvpxenc: add static-thresh private option
Currently, this option is accessed through AVCodecContext.mb_threshold,
which originally controlled reusing MB data when transcoding mpeg to
mpeg. Since the libvpx meaning is completely different from the original
mpegvideo meaning, it is better to use a separate private option for
this.
2014-10-18 05:28:03 +02:00
Anton Khirnov
59b55c494e lavc: deprecate unused me_threshold field 2014-10-18 05:26:56 +02:00
Anton Khirnov
66a68ddd1a lavc: make rc_buffer_aggressivity/rc_initial_cplx into private options of mpegvideo encoders 2014-10-18 05:26:29 +02:00
Anton Khirnov
a75c2eb25a lavc: make rc_eq into private options of mpegvideo encoders 2014-10-18 05:23:51 +02:00
Anton Khirnov
946f95354b lavc: make rc_qmod_* into private options of mpegvideo encoders 2014-10-18 05:23:05 +02:00
Anton Khirnov
a6e4ce9fd5 lavc: make rc_qsquish a private option of mpegvideo encoders 2014-10-18 05:21:50 +02:00
Vittorio Giovara
bae557edce dump: display codec tags when available
For both audio and video.
2014-10-17 14:45:07 +01:00
Omer Osman
66e9f83953 libfdk-aacdec: Enable Dynamic Range Control Metadata Support
For streams which contain DRC metadata, the FDK decoder is able to
control rendering of the decoded output. The rendering parameters
are detailed in fdk_aac_dec_options [].

The default behavior is left up to the decoder.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 15:48:31 +03:00
Omer Osman
b01a2204b5 libfdk-aacdec: Enable Decoder Downmix including Downmix Metadata Support
The FDK decoder is capable of producing mono and stereo downmix from
multichannel streams. These streams may contain metadata that control
the downmix process. The decoder requires an Ancillary Buffer in order to
correctly apply downmix in streams containing downmix Metadata. The
decoder does not have an API interface to inform of the presence of
Metadata in the stream, and therefore the Ancillary Buffer is always
allocated whenever a downmix is requested.

When downmixing multichannel streams, the decoder requires the output
buffer in aacDecoder_DecodeFrame call to be of fixed size in order to
hold the actual number of channels contained in the stream. For example,
for a 5.1ch to stereo downmix, the decoder requires that the output buffer
is allocated for 6 channels, regardless of the fact that the output is in
fact two channels.

Due to this requirement, the output buffer is allocated for the maximum
output buffer size in case a downmix is requested (and also during
decoder init). When a downmix is requested, the buffer used for output
during init will also be used for the entire duration the decoder is open.
Otherwise, the initial decoder output buffer is freed and the decoder
decodes straight into the output AVFrame.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 15:48:30 +03:00
Vittorio Giovara
1ac5a29b2e imc: fix order of operations in coefficients read
Reported-by: Ruoyu <liangry@ucweb.com>
2014-10-15 14:48:07 +01:00
Anton Khirnov
7ea1b3472a lavc: deprecate the use of AVCodecContext.time_base for decoding
When decoding, this field holds the inverse of the framerate that can be
written in the headers for some codecs. Using a field called 'time_base'
for this is very misleading, as there are no timestamps associated with
it. Furthermore, this field is used for a very different purpose during
encoding.

Add a new field, called 'framerate', to replace the use of time_base for
decoding.
2014-10-15 06:37:43 +00:00
Rémi Denis-Courmont
d565fef1b8 vdpau: add AV_HWACCEL_FLAG_IGNORE_LEVEL to skip the codec level check
Decoding acceleration may work even if the codec level is higher than
the stated limit of the VDPAU driver. Or the problem may be considered
acceptable by the user. This flag allows skipping the codec level
capability checks and proceed with decoding.

Applications should obviously not set this flag by default, but only if
the user explicitly requested this behavior (and presumably knows how
to turn it back off if it fails).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-15 06:21:56 +00:00
Rémi Denis-Courmont
c1724623ce vdpau: have av_vdpau_bind_context() fail on unsupported flag
Currently, no flags are supported.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-15 06:21:47 +00:00
Anton Khirnov
2df0c32ea1 lavc: use a separate field for exporting audio encoder padding
Currently, the amount of padding inserted at the beginning by some audio
encoders, is exported through AVCodecContext.delay. However
- the term 'delay' is heavily overloaded and can have multiple different
  meanings even in the case of audio encoding.
- this field has entirely different meanings, depending on whether the
  codec context is used for encoding or decoding (and has yet another
  different meaning for video), preventing generic handling of the codec
  context.

Therefore, add a new field -- AVCodecContext.initial_padding. It could
conceivably be used for decoding as well at a later point.
2014-10-13 19:09:01 +00:00
Rémi Denis-Courmont
c80a816142 h263dec: call get_format() on resolution changes
Fail safe if the pixel format changes.
2014-10-13 16:05:04 +02:00
Rémi Denis-Courmont
1f29e5d7a2 h263dec: call get_format after setting resolution and profile
Bug-Id: 541
2014-10-13 16:04:53 +02:00
Vittorio Giovara
1a02e78653 vc1: initialize color properties 2014-10-08 18:17:50 +01:00
Vittorio Giovara
eddf95283f vp9: initialize color space and range properties 2014-10-08 18:17:50 +01:00
Vittorio Giovara
65875a8b3b vp8: initialize color space and range properties 2014-10-08 18:17:50 +01:00
Vittorio Giovara
586ea0379c avcodec: fix colorspace option description 2014-10-08 18:17:50 +01:00
Marc-Antoine Arnaud
91eef40203 avcodec: add enum values on chroma sample location 2014-10-08 18:17:50 +01:00
Marc-Antoine Arnaud
9d5fed6dc4 avcodec: fix descriptions on color transfer options
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-10-08 18:17:49 +01:00
Vittorio Giovara
9f3a70c442 dump: print the original coded dimensions when available 2014-10-08 18:17:49 +01:00
Vittorio Giovara
41e86146e7 dump: print detailed color space information 2014-10-08 18:17:49 +01:00
Vittorio Giovara
20a5956b8d dump: split audio and video probing on multiple lines
Also always report pixel format.
2014-10-08 18:17:49 +01:00
Vittorio Giovara
147f2e91ee avcodec: make sure color_range is properly initialized 2014-10-08 18:17:49 +01:00
Luca Barbato
04d14c9b68 vc1: Split the decoder in components
Speed up the overall compilation time.
2014-10-08 18:34:48 +02:00
Henrik Gramner
2d91abade2 x86: h264_intrapred: Don't treat 32-bit integers as 64-bit
The upper halves are not guaranteed to be zero in x86-64.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-08 08:15:52 +00:00
James Almer
82f8eb5f77 jpeg2000: split off inverse MCT as Jpeg2000DSP
This makes the addition of arch optimized functions easier.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-08 08:02:55 +00:00
Josh Allmann
9a03c23235 h263dec: Force padding bug workaround for H.263.
Fixes decoding of http://samples.mplayerhq.hu/V-codecs/h263/h263-raw/messenger.h263

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-07 07:30:32 +00:00
Anton Khirnov
d208d1eba3 hevc_mvs: make sure to always initialize the temporal MV fully
The spec requires this.

Fixes uninitialized reads on some samples.

Remove now unnecessary initialization of the whole merge candidate list.
2014-10-07 07:13:01 +00:00
Anton Khirnov
79a60c8e77 hevc_mvs: initialize the temporal MV in case of missing ref
The caller expects the MV to always be initialized.
2014-10-07 07:12:55 +00:00
Rémi Denis-Courmont
153fadc390 ff_get_format: fix infinite loop
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-06 18:39:45 +00:00
Manfred Georg
577899a645 lavc: specify the behavior of av_lockmgr_register on failure.
The register function now specifies that the user callback should
leave things in the same state that it found them on failure but
that failure to destroy is ignored by the library.  The register
function is now explicit about its behavior on failure
(it unregisters the previous callback and destroys all mutex).

Signed-off-by: Manfred Georg <mgeorg@google.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-06 18:20:17 +00:00
Rémi Denis-Courmont
bef067f88c vdpau: check video surface and decoder capabilities
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-06 06:20:40 +00:00
Rémi Denis-Courmont
e3e158e81f vdpau: add av_vdpau_bind_context()
This function provides an explicit VDPAU device and VDPAU driver to
libavcodec, so that the application is relieved from codec specifics
and VdpDevice life cycle management.

A stub flags parameter is added for future extension. For instance, it
could be used to ignore codec level capabilities (if someone feels
dangerous).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-06 06:20:40 +00:00
Rémi Denis-Courmont
502cde409c vdpau: force reinitialization when output resolution changes
This is necessary to recreate the decoder with the correct parameters,
as not all codecs invoke get_format() in this case.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-06 06:18:56 +00:00
Rémi Denis-Courmont
89ac99ba5f vdpau: pass codec-specific parameters from hwaccel
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-05 10:41:31 +00:00
Rémi Denis-Courmont
ce083282f0 vdpau: common support for managing the VdpDecoder in avcodec
Using the not so new init and uninit callbacks, avcodec can now take
care of creating and destroying the VDPAU decoder instance.

The application is still responsible for creating the VDPAU device
and allocating video surfaces - this is necessary to keep video
surfaces on the GPU all the way to the output. But the application
will no longer needs to care about any codec-specific aspects.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-05 10:17:02 +00:00
Rémi Denis-Courmont
fcc1022611 vdpau: factor out common end-of-frame handling
Also add error handling.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-05 10:13:44 +00:00
Rémi Denis-Courmont
319424d25c vdpau: add helper for VDPAU to libav error codes conversion
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-05 10:08:53 +00:00
Luca Barbato
68211c70af vc1: Do not assume seek happens after decoding
If a seek is requested before the decoding start there is no
current picture.

CC: libav-stable@libav.org
2014-10-04 23:46:46 +02:00
Michael Niedermayer
d10d1b8655 libx265: enable psnr reporting when requested by the user
This is similar to what is done in libx264.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2014-10-01 14:31:48 +01:00
Michael Niedermayer
2cd7c99498 h264: reset ret to avoid propagating minor failures
Unbreak 772d150a6e.

CC: libav-stable@libav.org
Bug-Id: 750 / 905753
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-09-29 12:33:55 +01:00
Luca Barbato
e3a00acde0 hevc: Initialize mergecand_list to 0
Unbreak cf6090dc62.

CC: libav-stable@libav.org
Sample-Id: hevc-conformance-LTRPSPS_A_Qualcomm_1
2014-09-29 12:33:46 +01:00
Rémi Denis-Courmont
4e03b2097c mpeg12: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-26 21:28:37 +02:00
Rémi Denis-Courmont
ce42316321 h264: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-26 21:28:37 +02:00
Rémi Denis-Courmont
1c80c9d7ef hwaccel: Call ->get_format again if hwaccel init fails
This allows the application to fall back on another hwaccel or,
more likely, software decoding.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-26 21:28:36 +02:00
Tristan Matthews
7703995a2e flac: Remove unused headers
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-26 10:33:01 -07:00
Tim Walker
cc4992aaf3 ac3enc: allow Dolby Pro Logic IIz as the Dolby Surround EX mode.
This is actually defined in the A/52 specification.
2014-09-26 17:09:14 +02:00
Tim Walker
4c2fd4b262 ac3enc: allow Dolby Pro Logic II as a preferred downmix mode.
Some encoders already use this value even
though it's reserved in the A/52 specification.
2014-09-26 17:09:13 +02:00
Michael Niedermayer
a97328afef vc1: Use logical instead of bitwise or for twomv
CC: libav-stable@libav.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
2014-09-26 16:55:36 +02:00
Tim Walker
b5fe13448b vc1: Use logical instead of bitwise or for coded_inter
This appears to be the intended behavior.
2014-09-26 16:18:42 +02:00
Diego Biurrun
b97f6ef956 pcm-dvd: Move a variable to a smaller scope
This avoids an unused variable warning on big-endian systems.
2014-09-26 02:15:34 -07:00
Martin Storsjö
d07ddc93e2 avcodec: Fix a doxy comment to refer to the right function
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-09-25 10:01:25 +03:00
Diego Biurrun
103391ca90 dca: Remove some commented-out cruft 2014-09-20 13:49:52 +02:00
Gabriel Dume
45ff7c93dd dca: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-16 04:42:32 -07:00
Gabriel Dume
ee0ebd3c14 dv: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-09 05:30:28 -07:00
Gabriel Dume
9752d07d33 dirac: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-09 01:39:47 -07:00
Diego Biurrun
1274ea8dba Split off floating point AAN (I)DCT into separate components 2014-09-07 13:36:26 -07:00
Diego Biurrun
2143948381 Drop unnecessary av_unused attributes. 2014-09-05 13:55:04 +02:00
Diego Biurrun
213e606752 Replace av_unused attributes by block structures
This is more portable and avoids warnings with compilers that do not
properly support av_unused.
2014-09-05 13:55:04 +02:00
Diego Biurrun
096a1d5b46 rdft: Move some variables into a separate block
This avoids an unused variable warning with hardcoded tables.
2014-09-05 13:55:03 +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
Diego Biurrun
4d55e9de27 vc1: Split bits used in libavformat into a separate header
This reduces inter-library dependencies.
2014-09-04 07:11:03 -07:00
Diego Biurrun
f20518568a build: Split WMA frequencies into a separate object file
These are the only WMA bits shared with binkaudio. Splitting them off
reduces the binnkaudio dependency on general WMA code.
2014-09-04 05:19:46 -07:00
Diego Biurrun
803f8992f1 build: cosmetics: Group hwaccel OBJS declarations together 2014-09-04 05:19:39 -07:00
Diego Biurrun
2b8b0da09c fdctdsp: cosmetics: Drop one unnecessary if-block level 2014-09-03 03:13:56 -07:00
Gabriel Dume
d2a4e4b9cc wma: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-03 03:09:08 -07:00
Luca Barbato
4912b634b5 x265: Use the encoder defaults
Reset the settings as it is done for x264.
2014-09-03 02:14:17 +02:00
Gabriel Dume
eda7571ea1 wmv2: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-02 16:14:22 -07:00
Pascal Massimino
7a1d6ddd2c xvid: Add C IDCT
Thanks to Pascal Massimino and Michael Militzer for relicensing as LGPL.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-02 14:41:13 -07:00
Diego Biurrun
95c0cec03a idctdsp: Add global function pointers for {add|put}_pixels_clamped functions
These function pointers already existed in the ARM code. Adding them globally
allows calls to the function pointers to access arch-optimized versions of the
functions transparently.
2014-09-02 14:41:13 -07: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
Gabriel Dume
ff4d1aa8bc flv: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-02 04:03:45 -07:00
Gabriel Dume
f61e47dd68 asv: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-02 03:45:21 -07:00
Gabriel Dume
74512f7e36 8svx: Return proper error codes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-02 03:42:13 -07:00
Gabriel Dume
e205fe6831 mpeg4videodec: Fix low_delay error message
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-01 05:37:00 -07:00
Gabriel Dume
63f800ca5f aac_adtstoasc_bsf: Return proper error code
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-01 05:37:00 -07:00
Diego Biurrun
b8962d64cc dxva2: Clean up definition of _WIN32_WINNT
Only set a value if _WIN32_WINNT is undefined or smaller than 0x0600. This is
cleaner than unconditional definition and avoids a number of redefinition
warnings. Also only define a value in one of the two dxva2 headers.
2014-09-01 12:23:59 +02:00
Diego Biurrun
4600a85eaa dxva2: Pass variable of correct type to IDirectXVideoDecoder_GetBuffer()
This avoids related incompatible pointer type warnings.
2014-09-01 12:23:58 +02:00
Michael Niedermayer
37c46743ee avcodec: fix missing doxygen comment marker 2014-09-01 00:52:22 +01:00
Vittorio Giovara
9301486408 avcodec: add stream-level stereo3d side data 2014-08-28 12:33:26 -04:00
Diego Biurrun
8d27bf1cff x86: xvid: K&R formatting cosmetics 2014-08-27 05:58:04 -07:00
Diego Biurrun
dcb7c868ec cosmetics: Make naming scheme of Xvid IDCT consistent with other IDCTs 2014-08-27 04:54:05 -07:00
Diego Biurrun
1f156af427 x86: xvid_idct: Drop unused definitions 2014-08-27 04:36:41 -07:00
Luca Barbato
ff771f79b5 vc1: Initialize start_code_found to 0
Leftover of a4d3c20035.
2014-08-27 12:36:41 +02:00
Vittorio Giovara
e87f5e4e5f h264: fully check cropping amount from sps
Even if sps.crop is true, the cropping amount may be zero.
Fixes a sample with a valid but broken container cropping.
2014-08-26 13:31:29 -04:00
Gabriel Dume
0a02426826 libxvid: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-26 19:22:17 +02:00
Luca Barbato
a4d3c20035 vc1: Fix the skip condition
As written in the comment above, skip must be added only if a
start code is found.
2014-08-26 03:43:13 +02:00
Janne Grunau
dc4b2e7d33 rv34: use ff_mpeg_update_thread_context only when decoder is fully initialized
MpegEncContext based decoders are only fully initialized after the first
ff_thread_get_buffer() call. The RV30/40 decoders may fail before a frame
buffer was requested. ff_mpeg_update_thread_context() fails on half
initialized MpegEncContexts. Since this can only happen before a the
first frame was decoded there is no need to call
ff_mpeg_update_thread_context().

Based on patches by John Stebbins and tested by John Stebbins.

CC: libav-stable@libav.org
2014-08-22 13:11:43 +02:00
Diego Biurrun
8fc6a70c21 mpeg12enc: Add missing #include for PICT_FRAME 2014-08-21 04:18:23 -07:00
Diego Biurrun
7cb66ebc0b error_resilience: Drop asserts from guess_mv()
The asserts check struct members that are not referenced in guess_mv()
and one of them fails to compile.
2014-08-21 04:18:23 -07:00
Diego Biurrun
6af2930222 pcm: Drop av_unused attribute from variable that is always used 2014-08-19 06:22:08 -07:00
Diego Biurrun
14d2006ca6 pcm: Drop unused variable from DECODE_PLANAR macro 2014-08-19 06:22:07 -07:00
Diego Biurrun
d456baafb6 vc1: Add missing parentheses to conditions in vc1_decode_b_mb_intfr() 2014-08-19 06:22:07 -07:00
Christophe Gisquet
41e1354c10 proresenc: Properly account for alpha plane
The packet buffer allocation considers the alpha channel as DCT-coded,
while it is actually run-coded and thus requires a larger buffer.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 18:58:01 +02:00
Christophe Gisquet
45ce880a9b proresenc: Realloc if buffer is too small
The buffer allocation may be incorrect (e.g. with an alpha plane),
and currently causes the buffer to be set to NULL by init_put_bits,
causing a crash later on.

So, detect that situation, and if detected, reallocate the buffer
and ask for a sample that shows the problem.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 18:57:06 +02:00
Christophe Gisquet
58b68e4fde proresenc: Report buffer overflow
If the allocated size, despite best efforts, is too small, exit
with the appropriate error.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 18:51:44 +02:00
Christophe Gisquet
b16699f2da proresenc: Remove unneeded parameters from encode_alpha_plane()
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 18:48:14 +02:00
Diego Elio Pettenò
12640e4cbb tiff: Return proper error for missing LZMA compression
The LZMA support is a semi-official extension supported by libtiff 4.0.0
and later.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 14:23:24 +02:00
Gabriel Dume
4b1f5e5090 cosmetics: Write NULL pointer inequality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 05:34:13 -07:00
Gabriel Dume
f929ab0569 cosmetics: Write NULL pointer equality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 03:18:18 -07:00
Diego Biurrun
efd26bedec build: Add explanatory comments to (optimization) blocks in the Makefiles 2014-08-15 02:55:21 -07:00
Diego Biurrun
835f798c7d mpegvideo: cosmetics: Lowercase ugly uppercase MPV_ function name prefixes 2014-08-15 01:26:33 -07:00
John Stebbins
552bc42df4 h261dec: Fix order of initialization
ff_MPV_common_init requires the frame dimensions which get parsed in
h261_decode_picture_header.
2014-08-14 07:58:50 -07:00
John Stebbins
b869eea7ea h263dec: Fix order of initialization
ff_MPV_common_init requires the frame dimensions which get parsed in
*_decode_picture_header.
2014-08-14 07:58:50 -07:00
John Stebbins
998c9f15d1 idct: remove call to ff_idctdsp_init from ff_MPV_common_init
One step in untangling the mpegvideo code and fixing some problems in
the order that initialization is being done in h263dec and h261dec.
2014-08-14 07:58:49 -07:00
Nidhi Makhijani
93f29948e4 mpeg4video: Fix doxygen comment syntax to document correct struct member
Also fix some comment typos.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-14 11:59:59 +02:00
Edgar Hucek
ab059f0aa8 vaapi: set the scaling list correctly.
Fixes VAAPI decoding artefacts.

CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-14 05:50:08 +00:00
Michael Niedermayer
da7d839a0d ffv1dec: check that global parameters do not change in version 0/1
Such changes are neither allowed nor supported

Found-by: ami_stuff
Bug-Id: CVE-2013-7020
CC: libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 10:21:21 +00:00
Christophe Gisquet
3187fa14a3 hevc_mvs: avoid deriving tmvp in amvp
Reduces the number of calls to tmvp derivation from 933685 to 586271 on
a sequence.

Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 10:13:43 +00:00
Christophe Gisquet
14ca0aa69b hevc: wait proper position for tmvp
The position is either rounded or not checked, so delay the wait to
check the proper value.

Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 10:13:21 +00:00
Christophe Gisquet
cf6090dc62 hevc: use intreadwrite
When dealing with MVs, both components may be processed at a time.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 10:03:20 +00:00
Christophe Gisquet
ed53cc217f hevc: derive partial merge list
The merge list only needs to be derived up to the merge index.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 09:59:30 +00:00
Christophe Gisquet
3505b19652 hevc: derive partially amvp list
When the candidate has been found, no need to derive others.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 09:58:14 +00:00
Christophe Gisquet
09182b3224 hevc: simplify rounding
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 09:57:25 +00:00
Christophe Gisquet
d1b1c3bb5e hevc: reorder loops
iterate over memory in a more continuous order

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 09:57:05 +00:00
Diego Biurrun
cc1d8c54c1 avcodec: Postpone FF_IDCT_XVIDMMX removal until the next version bump 2014-08-10 10:41:55 -07:00
Anton Khirnov
d63443b968 lavc: drop the av_fast_{re,m}alloc compatibility wrappers
They were only needed until the bump.
2014-08-10 15:40:38 +00:00
Diego Elio Pettenò
2597a842a0 tiff: Improve grayscale support
Only use PAL8 if palette is present, else use GRAY8 for pixfmt.

Instead of simulating a grayscale palette, use real grayscale pixels, if no
palette is actually defined.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-10 15:21:44 +02:00
Anton Khirnov
9325d88eba lavc: remove obsolete and disabled avpriv functions 2014-08-09 16:59:34 +00:00
Anton Khirnov
472f9ed312 Remove obsolete FF_API_AVFRAME_COLORSPACE cruft. 2014-08-09 16:59:13 +00:00
Anton Khirnov
1985c2e75c Bump major versions of all libraries. 2014-08-09 16:58:33 +00:00
Anton Khirnov
f4c444e17d Postpone API-incompatible changes until the next bump. 2014-08-09 16:57:10 +00:00
Anton Khirnov
7acdd3a127 hevc_filter: avoid excessive calls to ff_hevc_get_ref_list()
1) each of the loops run within a single CTB, so the relevant reference
list is constant
2) when that CTB is, or lies on the same slice as, the current one, we
can use a simple access instead of a relatively expensive call to
ff_hevc_get_ref_list()
2014-08-09 16:15:51 +00:00
Anton Khirnov
52a2c17ec0 hevc_refs: drop the handling of negative coordinates in ff_hevc_get_ref_list()
It makes no sense and cannot happen in any place from which this
function is called.
2014-08-09 16:15:38 +00:00
Anton Khirnov
a7a17e3f19 hevc_filter: move some conditions out of loops 2014-08-09 16:15:11 +00:00
Anton Khirnov
70211539a3 hevc: deobfuscate slice/tile boundary handling for DBF
Use named constants instead of magic numbers, avoid using variables with
inverse meaning from what their name implies.
2014-08-09 16:13:48 +00:00
Anton Khirnov
5501971578 hevc_filter: drop more redundant checks
The if() around those loops ensures this condition is always false.
2014-08-09 16:13:37 +00:00
Anton Khirnov
65b8b6c476 hevc_filter: drop redundant checks
ff_hevc_deblocking_boundary_strengths() is never called if the
deblocking filter is disabled for the slice.
2014-08-09 16:13:24 +00:00
Anton Khirnov
4d1ff2a489 hevc: calculate the dbf strength in hls_pcm_sample() only if dbf is enabled 2014-08-09 16:13:11 +00:00
Diego Biurrun
d35b94fbab avcodec: Rename xvidmmx IDCT to xvid
The Xvid IDCT is not MMX-specific.
2014-08-08 11:13:30 -07:00
Diego Biurrun
84d173d3de xvididct: Ensure that the scantable permutation is always set correctly
This fixes cases where the scantable permuation would get overwritten by
the general idctdsp initialization.
2014-08-08 11:13:29 -07:00
Diego Biurrun
6f1960ab71 idct: cosmetics: Drop one unnecessary if-block level 2014-08-08 11:13:29 -07:00
Diego Biurrun
ad1ee5fa75 avcodec: Undeprecate reordered_opaque
It allows attaching other external, opaque data to the frame and passing it
through the reordering process, for cases when the caller wants other data
than just the plain packet pts.  There is no way to cleanly achieve this
without the field.
2014-08-07 04:03:00 -07:00
Felix Abecassis
a7e541c992 h264: fix interpretation of interleved stereo modes
Column and row frame packing arrangements were inverted.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-07 11:31:47 +01:00
Anton Khirnov
7b588bb691 svq1: do not modify the input packet
The input data must remain constant, make a copy instead. This is in
theory a performance hit, but since I failed to find any samples
using this feature, this should not matter in practice.

Also, check the size of the header, avoiding invalid reads on truncated
data.

CC:libav-stable@libav.org
2014-08-06 18:59:27 +00:00
Anton Khirnov
c7d9b473e2 cdgraphics: do not return 0 from the decode function
0 means no data consumed, so it can trigger an infinite loop in the
caller.

CC:libav-stable@libav.org
2014-08-06 18:32:42 +00:00
Anton Khirnov
a1599f3f7e cdgraphics: switch to bytestream2
Fixes possible invalid memory accesses on corrupted data.

CC:libav-stable@libav.org
Bug-ID: CVE-2013-3674
2014-08-06 18:32:38 +00:00
Vittorio Giovara
cbc808d726 jpeg2000: enable 4 component pixel formats
Bug-Id: 721
CC: libav-stable@libav.org
Sample-Id: 31230.mov
2014-08-06 12:23:21 +01:00
Michael Niedermayer
a7153444df huffyuvdec: check width size for yuv422p
Avoid out of array accesses.

CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 20:01:59 +00:00
Michael Niedermayer
70cd3b8e65 mmvideo: check horizontal coordinate too
Fixes out of array accesses.

Bug-Id: CVE-2013-3672
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 19:16:12 +00:00
Michael Niedermayer
849b9d34c7 wmalosslessdec: fix mclms_coeffs* array size
Fixes corruption of context

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Bug-Id: CVE-2014-2098
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 14:58:03 +00:00
Ben Avison
701e8b42e1 vc-1: Optimise parser (with special attention to ARM)
The previous implementation of the parser made four passes over each input
buffer (reduced to two if the container format already guaranteed the input
buffer corresponded to frames, such as with MKV). But these buffers are
often 200K in size, certainly enough to flush the data out of L1 cache, and
for many CPUs, all the way out to main memory. The passes were:

1) locate frame boundaries (not needed for MKV etc)
2) copy the data into a contiguous block (not needed for MKV etc)
3) locate the start codes within each frame
4) unescape the data between start codes

After this, the unescaped data was parsed to extract certain header fields,
but because the unescape operation was so large, this was usually also
effectively operating on uncached memory. Most of the unescaped data was
simply thrown away and never processed further. Only step 2 - because it
used memcpy - was using prefetch, making things even worse.

This patch reorganises these steps so that, aside from the copying, the
operations are performed in parallel, maximising cache utilisation. No more
than the worst-case number of bytes needed for header parsing is unescaped.
Most of the data is, in practice, only read in order to search for a start
code, for which optimised implementations already existed in the H264 codec
(notably the ARM version uses prefetch, so we end up doing both remaining
passes at maximum speed). For MKV files, we know when we've found the last
start code of interest in a given frame, so we are able to avoid doing even
that one remaining pass for most of the buffer.

In some use-cases (such as the Raspberry Pi) video decode is handled by the
GPU, but the entire elementary stream is still fed through the parser to
pick out certain elements of the header which are necessary to manage the
decode process. As you might expect, in these cases, the performance of the
parser is significant.

To measure parser performance, I used the same VC-1 elementary stream in
either an MPEG-2 transport stream or a MKV file, and fed it through avconv
with -c:v copy -c:a copy -f null. These are the gperftools counts for
those streams, both filtered to only include vc1_parse() and its callees,
and unfiltered (to include the whole binary). Lower numbers are better:

                Before          After
File  Filtered  Mean   StdDev   Mean   StdDev  Confidence  Change
M2TS  No        861.7  8.2      650.5  8.1     100.0%      +32.5%
MKV   No        868.9  7.4      731.7  9.0     100.0%      +18.8%
M2TS  Yes       250.0  11.2     27.2   3.4     100.0%      +817.9%
MKV   Yes       149.0  12.8     1.7    0.8     100.0%      +8526.3%

Yes, that last case shows vc1_parse() running 86 times faster! The M2TS
case does show a larger absolute improvement though, since it was worse
to begin with.

This patch has been tested with the FATE suite (albeit on x86 for speed).

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-04 22:22:54 +02:00
Ben Avison
adf8227cf4 vc-1: Add platform-specific start code search routine to VC1DSPContext.
Initialise VC1DSPContext for parser as well as for decoder.
Note, the VC-1 code doesn't actually use the function pointer yet.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-04 22:22:54 +02:00
Ben Avison
db7f1c7c5a h264: Move start code search functions into separate source files.
This permits re-use with parsers for codecs which use similar start codes.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-04 22:22:54 +02:00
Diego Biurrun
990e2f3555 avcodec: Suppress deprecation warnings from DTG code scheduled for removal 2014-08-04 11:08:35 -07:00
Carl Eugen Hoyos
60cbd6ad84 tiff: support reading gray+alpha at 8 bits
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-04 12:57:39 +01:00
Vittorio Giovara
bcc5f69b33 tiff: support reading gray+alpha at 16 bits 2014-08-04 12:57:38 +01:00
Vittorio Giovara
e64f0bf2d2 png: support reading gray+alpha at 16 bits 2014-08-04 12:57:38 +01:00
Vittorio Giovara
2257165bff png: disable broken MMX/SIMD code for bpp <= 2
The decoder was producing different results when ASM was disabled.
Based on a long debug session with Kostya.
2014-08-04 12:57:38 +01:00
Vittorio Giovara
e96c3b81ca avutil: rename AV_PIX_FMT_Y400A to AV_PIX_FMT_YA8
The rationale is that you have a packed format in form
<greyscale sample> <alpha sample> <greyscale sample> <alpha sample>
and shortening greyscale to 'G' might make one thing about Greenscale instead.
An alias pixel format and color space name are provided for compatibility.
2014-08-04 12:55:08 +01:00
Kieran Kunhya
1ef9e83764 avcodec: Deprecate dtg_active_format field in favor of avframe side-data
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-03 15:43:02 -07:00
Diego Biurrun
d0393d79bc huffyuv: Check and propagate function return values
Bug-Id: CVE-2013-0868

inspired by a patch from Michael Niedermayer <michaelni@gmx.at>
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Diego Biurrun <diego@biurrun.de>

CC: libav-stable@libav.org
2014-08-03 15:35:30 -07:00
Diego Biurrun
6234058148 huffyuv: Return proper error codes 2014-08-03 15:18:58 -07:00
Diego Biurrun
3160bdc7f7 huffyuv: Use avpriv_report_missing_feature() where appropriate 2014-08-03 15:18:58 -07:00
Diego Biurrun
b7616f5716 huffyuv: Eliminate some pointless casts 2014-08-03 15:18:58 -07:00
Diego Biurrun
c065f4a0c6 huffyuv: K&R formatting cosmetics 2014-08-03 15:18:58 -07:00
Anton Khirnov
f89d76c103 mpeg4video: Initialize xvididct for all threads
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-03 15:18:58 -07:00
Janne Grunau
ac6b95dbc0 aarch64: add ',' between assembler macro arguments where missing
llvm's integrated assembler does not accept spaces as macro argument
delimiter when targeting darwin. Using a explicit delimiter is a good
idea in principle since it makes case like 'macro 4 -2' vs 'macro 4 - 2'
clear.
2014-08-04 00:17:21 +02:00
Diego Biurrun
9f17685dfb avcodec: Deprecate unused defines and options 2014-08-03 03:24:16 -07:00
Diego Biurrun
bad81800bb avcodec: options: Add missing deprecation ifdefs around emu_edge 2014-08-03 03:24:15 -07:00
Diego Biurrun
c697c590fb lcl: Disentangle pointers to input data and decompression buffer
This is cleaner and avoids a cast plus a related const qualifier warning.
2014-08-03 01:29:43 -07:00
Diego Biurrun
df507d5aa0 tiff: Replace deprecated PIX_FMT names by modern ones 2014-08-02 12:54:37 -07:00
Diego Biurrun
7835c24e19 dv: Update DV-profile-related functions to current public API 2014-08-02 12:54:37 -07:00
Diego Biurrun
ffa4d4ef0b ppc: fft: Build AltiVec optimizations in the standard way 2014-08-02 07:40:37 -07:00
Vittorio Giovara
7ab551f9fd h264: prevent theoretical infinite loop in SEI parsing
Properly address CVE-2011-3946 and parse bitstream as described in the spec.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-01 13:08:32 +01:00
Vittorio Giovara
92a36a6b33 pngdec: correctly indent macros 2014-08-01 13:07:53 +01:00
Diego Biurrun
4da8cdbb91 tscc: Eliminate pointless variable indirections in decode_frame() 2014-08-01 04:08:46 -07:00
Diego Biurrun
5735552f1f pngenc: Drop pointless pointer cast in png_write_row() 2014-08-01 04:08:45 -07:00
Diego Biurrun
a786c8259d idct: Split off Xvid IDCT
The Xvid IDCT is only required to decode some Xvid-encoded MPEG-4 files,
so there is no point in having it as an unconditional part of idctdsp.
2014-08-01 01:25:18 -07:00
Diego Biurrun
03c9f357a4 ppc: idctdsp: Immediately return if no AltiVec is available
This is how all the other init functions operate.
2014-08-01 01:23:11 -07:00
Michael Niedermayer
d98e6c5d5d pgssubdec: Check RLE size before copying
Make sure the buffer size does not exceed the expected
RLE size.

Prevent an out of array bound write.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Bug-Id: CVE-2013-0852

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-01 02:13:32 +02:00
Nidhi Makhijani
ccbf370f20 mpegvideo: move vol_control_parameters to the only place it is used
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-29 09:13:18 -07:00
Diego Biurrun
019a28cd63 sanm: Use correct printf conversion specifiers for POSIX int types 2014-07-28 13:19:04 -07:00
Diego Biurrun
4f8cf0dc4e x86: build: Restore ordering of OBJS lines 2014-07-28 13:19:04 -07:00
Anton Khirnov
e76f2d1197 hevc: eliminate the last element from TransformTree
Replace it by passing an additional parameter to transform_unit()
2014-07-28 08:10:35 +00:00
Anton Khirnov
4aa80808bc hevc: eliminate unnecessary cbf_c{b,r} arrays
They are replaced by passing additional parameters to the transform
functions.
2014-07-28 08:09:18 +00:00