1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-06 08:08:58 +02:00
Commit Graph

154 Commits

Author SHA1 Message Date
Ronald S. Bultje
be885da342 vp9: change order of operations in adapt_prob().
This is intended to workaround bug "665 Integer Divide Instruction May
Cause Unpredictable Behavior" on some early AMD CPUs, which causes a
div-by-zero in this codepath, such as reported in Mozilla bug #1293996.

Note that this isn't guaranteed to fix the bug, since a compiler is free
to reorder instructions that don't depend on each other. However, it
appears to fix the bug in Firefox, and a similar patch was applied to
libvpx also (see Chrome bug #599899).
2016-10-24 16:02:39 -04:00
Hendrik Leppkes
3f9137c57d Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'
* commit '32c8359093d1ff4f45ed19518b449b3ac3769d27':
  lavc: export the timestamps when decoding in AVFrame.pts

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-10-07 13:03:36 +02:00
Denis Charmet
38f99017e6 vp9: Return the correct size when decoding a superframe
According to avcodec.h, avcodec_decode_video2 should return the number of
bytes used if a frame was decoded.

The current implementation returns size - used size of all the subframes.
This fixes the VLC's bug https://trac.videolan.org/vlc/ticket/16836.

The superframe is always fully consumed.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-06-05 16:58:04 +02:00
Ronald S. Bultje
ee729cc0ed vp9: ignore frame_context_index field in key-/intraonly-frames.
Reproduces a bug to remain consistent with libvpx' behaviour.
2016-04-17 09:28:56 -04:00
Ronald S. Bultje
b86339a9f8 vp9: fix a few signed integer left-shifts.
Fixes trac tickets 5127, 5129, 5130.
2016-03-11 16:06:29 -05:00
Ronald S. Bultje
5307adadeb vp9: only call ff_get_format on stream format changes.
In practice, this means we don't call it N times for N-threaded decoding.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-13 19:49:34 +01:00
Hendrik Leppkes
e760641720 lavc: add vp9 profiles to AVCodecDescriptor 2016-01-01 16:25:50 +01:00
Timo Rothenpieler
d7c2b75681 vaapi: Add VP9 hwaccell support
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-12-22 12:54:23 +01:00
Hendrik Leppkes
1e6cf7272f avcodec: implement vp9 dxva2 hwaccel 2015-12-07 09:38:59 +01:00
Hendrik Leppkes
585083dd1f vp9: add hwaccel hooks 2015-12-07 09:25:02 +01:00
Hendrik Leppkes
cd1b7e2bd7 vp9: fix pixel format changes with threading 2015-12-07 09:23:18 +01:00
Ronald S. Bultje
1ac89869db vp9: always keep s->bytesperpixel and ctx->pix_fmt in sync.
Fixes mozilla bug 1229128.
2015-12-02 14:53:46 -05:00
Ronald S. Bultje
49d8a70dc5 vp9: uses ff_set_dimensions (which sets coded_width/height).
Fixes ticket 4935.
2015-10-24 15:11:59 -04:00
Hendrik Leppkes
e12908d71e vp9: use AVFrame.buf[0] to check if a frame is valid
AVFrame.data[0] is not guaranteed to be set with a HWAccel
2015-10-16 14:53:41 +02:00
Hendrik Leppkes
6e719dc6bb vp9: expose reference frames in VP9SharedContext 2015-10-15 13:02:23 +02:00
Ronald S. Bultje
b95f241b6e vp9: split header into separate struct and expose in vp9.h
This allows hwaccels to access the bitstream header information.
2015-10-15 13:02:20 +02:00
Ganesh Ajjanagadde
2cbaa078d1 avcodec: use HAVE_THREADS header guards to silence -Wunused-function
When compiled with --disable-pthreads, e.g
http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7,
a bunch of -Wunused-functions are reported due to missing header guards
around threading related functions.
This patch should silence such warnings.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-04 12:47:34 -04:00
Ronald S. Bultje
a0d8a81075 vp9: switch min_tile_cols location so it shifts up instead of down.
This fixes cases where the shifted number is 64, but we shifted non-
zero numbers away in the shift. The change makes behaviour consistent
with libvpx.
2015-09-15 09:20:34 -04:00
Ronald S. Bultje
a30a8beeb3 vp9: Fix emu[] edge overflow conditions for >8bpp/non-420. 2015-09-12 07:01:48 -04:00
Ronald S. Bultje
2563a33856 vp9: re-initialize internal buffers on bpp change also. 2015-09-12 07:01:47 -04:00
Ronald S. Bultje
fd8b90f5f6 vp9: fix overflow in 8x8 topleft 32x32 idct ssse3 version.
Also disable the mmx/iwht optimization when the bitexact flag is set.
With synthetically coded coefficients (i.e. these that lead to a
residual well outside the [-255,255] range), our optimizations will
overflow. It doesn't make sense to fix the overflows, since they can
only occur on synthetic input, not on real fwht-generated input. Thus,
add a bitexact flag that disables this optimization.
2015-09-10 07:51:16 -04:00
Ronald S. Bultje
4bb9dbe4d7 vp9: permanently delete segmentation refmap on any size change. 2015-09-10 07:51:16 -04:00
Ronald S. Bultje
ae9344cb9f vp9: check return value of ff_thread_ref_frame().
Fixes CID 1322309.
2015-09-05 15:50:01 -04:00
Ronald S. Bultje
1f7871ec42 vp9: fix edge copy for 10/12bpp frames. 2015-09-05 15:50:01 -04:00
Ronald S. Bultje
9cdeb105a6 vp9: do unscaled MC in scaled path if size of this reference matches.
This can happen if we do bidirectional MC, where one reference has the
same size as the current frame, but the other one doesn't.
2015-09-05 15:50:01 -04:00
Ronald S. Bultje
873dbc6758 vp9: sync segmentation.absolute_vals between threads. 2015-09-05 15:50:00 -04:00
Ronald S. Bultje
3d7173b509 vp9: always sync segmentation.feat between threads. 2015-09-05 15:50:00 -04:00
Ronald S. Bultje
4ecb8b4191 vp9: don't erase values for {lf,ref,skip,q}_enabled if segmentation=0.
Instead, use segmentation.enabled before accessing each of these values.
2015-09-04 09:33:45 -04:00
Ronald S. Bultje
8b45e87f64 vp9: fix segmentation map retention across keyframe boundaries. 2015-09-04 09:33:45 -04:00
Ronald S. Bultje
7cc7d13fe3 vp9: fix RGB chroma subsampling. 2015-09-04 09:33:45 -04:00
Ronald S. Bultje
ecd9f57edc vp9: read reserved bit in RGB header. 2015-09-04 09:33:45 -04:00
Ronald S. Bultje
48f641a18b vp9: clip intermediates in dequant calculations.
This makes values consistent with libvpx.
2015-09-04 09:33:45 -04:00
Ronald S. Bultje
eaff36c973 vp9: fix segmentation map retention if segmentation is turned off. 2015-09-04 09:33:44 -04:00
Ronald S. Bultje
8d25a11dc7 vp9: use resetctx in the same way as libvpx. 2015-09-04 09:33:44 -04:00
Ronald S. Bultje
cc9d3a3e36 vp9: fix indentation. 2015-09-04 09:33:44 -04:00
Ronald S. Bultje
caf6512ac4 vp9: deal with the case where update_map=0 but we're key/intraonly. 2015-09-04 09:33:44 -04:00
Ronald S. Bultje
339550e7c8 vp9: reset segmentation information on context reset. 2015-09-04 09:33:43 -04:00
Michael Niedermayer
444e9874a7 Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'
* commit 'def97856de6021965db86c25a732d78689bd6bb0':
  lavc: AV-prefix all codec capabilities

Conflicts:
	cmdutils.c
	ffmpeg.c
	ffplay.c
	libavcodec/8svx.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.c
	libavcodec/adpcm.c
	libavcodec/alac.c
	libavcodec/atrac3plusdec.c
	libavcodec/bink.c
	libavcodec/dnxhddec.c
	libavcodec/dvdec.c
	libavcodec/dvenc.c
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c
	libavcodec/fic.c
	libavcodec/flacdec.c
	libavcodec/flacenc.c
	libavcodec/flvdec.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/gifdec.c
	libavcodec/h261dec.c
	libavcodec/hevc.c
	libavcodec/iff.c
	libavcodec/imc.c
	libavcodec/libopenjpegdec.c
	libavcodec/libvo-aacenc.c
	libavcodec/libvorbisenc.c
	libavcodec/libvpxdec.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c
	libavcodec/mpegaudiodec_float.c
	libavcodec/msmpeg4dec.c
	libavcodec/mxpegdec.c
	libavcodec/nvenc_h264.c
	libavcodec/nvenc_hevc.c
	libavcodec/pngdec.c
	libavcodec/qpeg.c
	libavcodec/ra288.c
	libavcodec/rv10.c
	libavcodec/s302m.c
	libavcodec/sp5xdec.c
	libavcodec/takdec.c
	libavcodec/tiff.c
	libavcodec/tta.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/vp6.c
	libavcodec/vp9.c
	libavcodec/wavpack.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:50:18 +02:00
Vittorio Giovara
def97856de lavc: AV-prefix all codec capabilities
Express bitfields more simply.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Carl Eugen Hoyos
8dad213143 lavc: Add properties field to AVCodecContext.
The new field can hold information about losslessness and closed captions for now.
2015-07-16 12:18:30 +02:00
James Zern
e91f860ea7 vp9/update_prob: prevent out of bounds table read
the max value of the lookup in expanded form is:
(((1 << 7) - 1) << 1) - 65 + 1 + 64 = 254

add one entry of padding to inv_map_table[] to prevent out of bounds
access with non-conforming / fuzzed bitstreams

Signed-off-by: James Zern <jzern@google.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-30 13:24:19 +02:00
Ronald S. Bultje
d5a36edda4 vp9: fix profile check for intraonly frames.
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-25 04:29:03 +02:00
Andreas Cadhalpun
d216b9debd vp9: don't retain NULL as segmentation_map
This fixes segmentation faults, which were introduced in commit
4ba8f327.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-06-19 00:07:43 +02:00
Andreas Cadhalpun
28efeb6502 doc: avoid incorrect phrase 'allows to'
Also fix typo found by Lou Logan:
Sacrifying -> Sacrificing

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-06-16 21:48:51 +02:00
Andreas Cadhalpun
b18eac7ff2 vp9: change type of tile_size from unsigned to int64_t
Otherwise the check 'tile_size < size' treats a negative size as
unsigned, causing the check to pass. This subsequently leads to
segmentation faults.

This was originally fixed as part of Libav commit 72ca83, so the
original author is one of the following developers:
        Anton Khirnov <anton@khirnov.net>
        Diego Biurrun <diego@biurrun.de>
        Luca Barbato <lu_zero@gentoo.org>
        Martin Storsjö <martin@martin.st>

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-06-08 21:43:16 +02:00
Ronald S. Bultje
138581c41a vp9: clamp final zero MV if find_ref_mvs() found no suitable candidates.
This may actually result in a non-zero MV. Fixes ticket 4583.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 17:23:34 +02:00
Vittorio Giovara
3f38d4b816 vp9: Parse subsampling and report missing feature 2015-05-31 12:19:19 +02:00
Michael Niedermayer
451be676f3 Merge remote-tracking branch 'rbultje/vp9-bugfixes'
* rbultje/vp9-bugfixes:
  vp9: match another find_ref_mvs() bug in libvpx.
  vp9: fix scaled motion vector clipping for sub8x8 blocks.
  vp9: improve signbias check.
  vp9: don't allow compound references if error_resilience is enabled.
  vp9: clamp segmented lflvl before applying ref/mode deltas.
  vp9: reset loopfilter mode/ref deltas on keyframe.
  vp9: fix crash when playing back 440/440 content with width%64<56.
  vp9: extend loopfilter workaround for vp9 h/v mix-up to work for 422.
  vp9: clip motion vectors in the same way as libvpx does.
  vp9: set skip flag if the block had no coded coefficients.
  vp9: apply mv scaling workaround only when subsampling is enabled.
  vp9: read all 4x4 blocks in sub8x8 blocks individually with scalability.
  vp9: fix segmentation map referencing upon framesize change.
  vp9: disable more pmulhrsw optimizations in idct16/32.
  vp9: disable all pmulhrsw in 8/16 iadst x86 optimizations.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-18 02:35:16 +02:00
Ronald S. Bultje
900e3af857 vp9: match another find_ref_mvs() bug in libvpx.
If we find a second non-sub8x8 motion vector for a non-first sub8x8
block, and the clamped value is identical to the first non-sub8x8
motion vector, then the resulting nearmv motion vector is forced to
zero.
2015-05-16 11:59:01 -04:00
Ronald S. Bultje
ccfb03ecc4 vp9: fix scaled motion vector clipping for sub8x8 blocks.
To match the obscure clipping bug behaviour in libvpx.
2015-05-16 08:36:19 -04:00